Protocol Reference
Reference for current packet handling behavior in Moongate v2.
Packet Framing
- First byte: opcode
- Fixed packet: total length from registry descriptor
- Variable packet: bytes
[1..2]are big-endian length including header
Parsing Rules
NetworkService enforces:
- descriptor must exist for opcode
- enough bytes must be buffered for full packet
- variable declared length must be within allowed bounds
TryParsemust succeed
On repeated violations, session is disconnected.
Selected Inbound Packets
0xEFLogin Seed (Length=21, fixed)0x80Account Login (Length=62, fixed)0xA0Server Select (Length=3, fixed)0x91Game Login (Length=65, fixed)0x5DLogin Character (Length=73, fixed)0xF8Character Creation (Length=106, fixed)0x02Move Request (Length=7, fixed)0x07Pick Up (Length=7, fixed)0x08Drop Item (Length=14, fixed)0x34Get Player Status (Length=10, fixed)0x72Request War Mode (Length=5, fixed)0x73Ping Message (Length=2, fixed)0xADUnicode Speech (variable)0xBFGeneral Information (variable)
Selected Outbound Packets
0xA8Server List (variable)0x8CServer Redirect (Length=11, fixed)0x1BLogin Confirm (Length=37, fixed)0xA9Character / Starting Locations (variable)0xB9Support Features (Length=5, fixed)0x55Login Complete (Length=1, fixed)0x78Mobile Incoming (variable)0x88Paperdoll (Length=66, fixed)0x11Player Status (Length=43, fixed)0xAEUnicode Speech Message (variable)
Opcode Constants
PacketDefinition is generated as a partial static class and used by bootstrap/handlers to avoid hardcoded byte literals.
Notes
- Length/source metadata is defined in packet attributes and registration.
- Runtime listener availability is independent from packet registration: a packet can be parseable but have no listener yet.
Previous: Packet System