five-on-it / packages/protocol/src/social
packages/protocol/src/social
The room's social frames (GAME_DESIGN §13): text frames between the game server and its clients for what players say and do to each other in a room.
- Client → server, a RoomCommand: say a line on the room's channel, a quick-chat phrase or an emote; start a vote to kick a player, or vote on the one under way.
- Server → client, a ChatMessage: lines of the room's channel (a player's text, a quick-chat phrase or an emote by its id, which each client words in its own language, or a line of the room itself: a player came, left, was voted out). A line the platform's moderation hid in a public room reaches nobody but its sender, marked
hidden. - Server → client, a RosterMessage: who is in the room (their client ids, names, accounts and party numbers), which of them the receiver is, whether the room is public (its chat moderated) and the vote to kick under way.
The phrases and emotes are fixed (QUICK_PHRASES, EMOTES): nobody types them, so they need no moderation. The party chat and the direct messages travel through the platform API, not the game server.
Type Aliases
Variables
- CHAT_MAX
- ChatLine
- ChatMessage
- EMOTES
- ModerationVerdict
- QUICK_PHRASES
- RoomCommand
- RosterMessage
- RosterPlayer
- SYSTEM_LINES