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)0xBDClient Version (variable)0xF8Character Creation (Length=106, fixed)0x02Move Request (Length=7, fixed)0xC8Client View Range (Length=2, fixed)0x07Pick Up (Length=7, fixed)0x08Drop Item (Length=14, fixed)0x13Drop -> Wear (Length=10, fixed)0x09Single Click (Length=5, fixed)0x06Double Click (Length=5, fixed)0x34Get Player Status (Length=10, fixed)0x66Book Pages (variable)0x73Ping Message (Length=2, fixed)0xADUnicode Speech (variable)0xB3Chat Text (variable)0xB5Open Chat Window (Length=64, fixed)0x6CTarget Cursor Commands (Length=19, fixed)0xBFGeneral Information (variable)0xD6Mega Cliloc (variable)
Wired 0xBF Subcommands
0x06Party System0x13Request Popup Context Menu0x14Display Popup Context Menu (server -> client)0x15Popup Entry Selection0x1AStat Lock Change0x2CUse Targeted Item0x2DCast Targeted Spell0x2EUse Targeted Skill
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)0x22Move Confirm (Length=3, fixed)0x21Move Deny (Length=8, fixed)0x5BSet Time (Length=4, fixed)0xF2Time Sync Response (Length=13, fixed)0x78Mobile Incoming (variable)0x20Draw Player (Length=19, fixed)0x2EWorn Item (Length=15, fixed)0x24Draw Container (Length=9, fixed)0x3CAdd Multiple Items To Container (variable)0x88Paperdoll (Length=66, fixed)0x11Player Status (variable)0x3ASkill List (variable)0xF3Object Information (Length=24, fixed)0x23Dragging Of Item (Length=26, fixed)0x76Server Change (Length=16, fixed)0xBCSeason (Length=3, fixed)0x4FOverall Light Level (Length=2, fixed)0x4EPersonal Light Level (Length=6, fixed)0x6DSet Music (Length=3, fixed)0x65Set Weather (Length=4, fixed)0x54Play Sound Effect (Length=12, fixed)0x70Graphical Effect (Length=28, fixed)0xC0Hued Effect (Length=36, fixed)0xC7Particle Effect (Length=49, fixed)0xAEUnicode Speech Message (variable)0xB0Generic Gump (variable)0xDDCompressed Gump (variable)
Map transition notes:
- Map hue/map selection uses
0xBFsubcommand0x08(Set Cursor Hue / Set Map). - On map changes, Moongate also sends
0x76(Server Change) with target location + map dimensions.
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 still not be wired to gameplay flow.
Current Status And Skill Flow
0x34 is the shared client request for both status and skill window behavior.
GetPlayerStatusType.BasicStatus-> server replies with0x11Player StatusGetPlayerStatusType.RequestSkills-> server replies with0x3Afull skill list including lock state
Moongate currently treats the outgoing 0x11 status packet as a modern 7.x-style payload and serializes:
- hits / max hits
- effective str / dex / int
- stamina / mana
- carried gold aggregate
- effective physical / elemental resists
- luck
- carrying data
- follower counts
- weapon damage / tithing
- advanced modifier fields such as HCI, DCI, SSI, DI, LRC, SDI, FCR, FC, and LMC
Current Book Flow
Moongate now supports both read-only and writable classic book flows.
- double-click opens the classic book UI for supported items
0xD4saves writable booktitleandauthor0x66is used for both:- page requests
- writable page saves
- writable edits are accepted only when the book is:
- equipped by the player, or
- inside the player's backpack/container tree
- read-only books continue to serve rendered template content
- writable books persist
title,author, and canonical newline content on the item - book template files may force read-only or writable policy with
[ReadOnly] True|False; when present, this overrides fallback item/startupwritable
The book tooltip path uses the argument-style cliloc rule documented in Cliloc Notes, avoiding the legacy NEXT tooltip artifact caused by generic string cliloc rotation.
Previous: Packet System