Imported from ysle0/highp-mmorpg (
protocol/flatbuf/schemas/messages/AGENTS.md). Install upstream withnpx skills add ysle0/highp-mmorpg --skill messages. Copyright stays with the author.
messages
Purpose
FlatBuffers message schema files organized by communication direction. Client-to-server requests, server-to-client responses, and server broadcast messages each live in their own file to make the protocol contract easy to navigate.
Key Files
| File | Description |
|---|---|
| client.fbs | Client-to-server messages: JoinRoomRequest, LeaveRoomRequest, SendMessageRequest |
| server.fbs | Server-to-client response messages: JoinedRoomResponse |
| broadcast.fbs | Server-initiated broadcast messages: UserJoinedBroadcast, UserLeftBroadcast, ChatMessageBroadcast |
Subdirectories
None.
For AI Agents
Working In This Directory
- New message types belong in the file that matches their direction:
- Client initiates →
client.fbs - Server replies to a specific client →
server.fbs - Server sends to all room members →
broadcast.fbs
- Client initiates →
- After adding a new table here, register it in
../packet.fbs:- Add the table to the
Payloadunion. - Add a matching entry to the
MessageTypeenum in../enum.fbs. - Run
scripts/gen_flatbuffers.ps1to regenerate headers.
- Add the table to the
Common Patterns
- All files use
namespace highp.protocol;andincludeshared types from parent schema files (../common.fbs,../room.fbs,../user.fbs). - Request tables carry only the fields needed by the server; the server derives identity from the session context, not from the payload.
- Broadcast tables include all fields needed by every recipient (no session context on broadcast path).
Dependencies
Internal
../packet.fbs- aggregates these types into thePayloadunion../enum.fbs-MessageTypediscriminants must match entries here../common.fbs,../room.fbs,../user.fbs- shared field types
External
- FlatBuffers
flatccompiler (for regeneration)
