five-on-it / apps/server/src/room-social
apps/server/src/room-social
A room's social side (GAME_DESIGN §13): who is in it, what they say to each other and the vote that puts a griefer out. It owns no simulation; the game server hands it its players as they come and go and the room commands they send (@foi/protocol's social.ts).
- The roster: every player's client id, name, account and party number, sent to each player (with which of them they are) whenever it changes.
- The room's channel: a player's line goes to everyone in the room, at most CHAT_BURST lines in CHAT_WINDOW_MS (the rest answered "slow down"). In a public room every line first goes through the platform's moderation (
moderate): a line it hides, or one it cannot check, reaches nobody but its sender, marked hidden. A private room (nomoderate) is not moderated. Quick-chat phrases and emotes are fixed ids nobody types: never moderated. The room says when a player comes, goes or is voted out. Muting is the reader's own business: the client hides a muted player's lines. - Vote-kick: any player may start a vote against another in a room of three or more; the starter's vote counts, the target has none, and a majority of the room's players (more than half of them, the target counted) puts the target out: their connection is closed and their account may not join the room again (the room hears who voted:
voted, a run's room telling its result). A vote not won within VOTE_SECONDS fails; one vote at a time.