Server Backend V1.2
Modular, server-authoritative inventory with per-player settings and anti-exploit protection
InventoryService
Central service with unified network protocol and operation lock.
→InventoryState
Per-player data with O(1) lookups and runtime-configurable settings.
→Utilities
SlotManager, LimitChecker, StackChecker, MetadataParser, ItemSpawner.
→Architecture V1.2
Modular directory structure
Directory Structure
Tree
src/server/StowayServerV1_2/ ├── init.luau # Entry + API + Network ├── Config/Settings.luau # Global defaults ├── Core/ │ ├── InventoryState.luau # Data + per-player settings │ ├── SlotManager.luau # Static Hotbar / Dynamic Storage │ └── LimitChecker.luau # Weight validation ├── Operations/ │ ├── AddOperation.luau # Limit → Stack → Slot │ ├── RemoveOperation.luau # Validate → Reduce/Destroy │ ├── SwapOperation.luau # All swap combinations │ ├── EquipOperation.luau # Equip/Unequip │ └── DropOperation.luau # Unequip → Remove → Spawn ├── Replication/ │ ├── Actions.luau # Payload builders │ └── Replicator.luau # Delta dispatcher ├── Utils/ # UUID, MetadataParser, StackChecker ├── Debug/ChatCommands.luau # ⚠️ REMOVE IN PRODUCTION └── World/ItemSpawner.luau # Physical tools
Data Flow
How requests are processed
Request Flow (V1.2)
Diagram
Client → InventoryAction (RemoteFunction) → Operation Lock Check
↓
InventoryService → Operation Module → InventoryState
↓
Replicator.Send*() → InventoryUpdate (RemoteEvent) → Client
All client requests go through a single InventoryAction RemoteFunction
with per-player operation locking. This prevents remote spam exploits.
Key V1.2 Features
- Per-Player Settings: Limit, CanStack, MaxStackSize, MaxHotbarSlots
- Anti-Exploit: Single remote + per-player operation lock
- UUID-Based Equip: Equipment follows item, not slot
- Dynamic Storage: Packed array with auto-shift on removal
- Delta Replication: Minimal network payloads
- Debug Commands: /add, /swap, /equip, /clear, etc.