Skip to content

five-on-it / apps/api/src/social-routes

apps/api/src/social-routes ​

The social routes (GAME_DESIGN §13, TECHNICAL_SPECS §9.6): friends and their presence, parties, the party's channel and direct messages, mutes, the feed, reports of players, and the moderation of a public room's chat that the game servers (and Nakama's module) ask for. The state is the SocialHub's (social.ts).

RouteWhoWhat
GET /social/friendssigned inFriends and requests, each online or not and in which room (its title and game).
POST /social/friends {name} or {id}signed inAsk an account to be friends, or accept its request.
DELETE /social/friends/:idsigned inRemove a friend, cancel or decline a request.
PUT /social/presence {room}signed inWhere the player's page is: a room's id, or null. Every half a minute or so.
GET /social/partysigned inThe player's party and the invitations they have.
POST /social/party, /social/party/invite {account}, /social/party/join {party}, /social/party/decline {party}, /social/party/leavesigned inCreate, invite a friend, join, decline, leave.
POST /social/messages {to, text}signed inA line on the party's channel (to: "party") or to a friend (their id).
GET /social/events?after=n&wait=ssigned inThe feed after event n, waiting up to s seconds (25 at most) for one.
GET /social/mutes, PUT and DELETE /social/mutes/:idsigned inThe accounts the player muted; mute one, or not any more.
POST /players/:id/reports {reason, text?, name?, room?}signed inA report of a player, into the moderators' queue.
POST /moderation/chat {texts, room?}the room secretWhether a public room's chat line may be read ({allowed, reasons}), by the chat's moderator (with FOI_MODERATION=openrouter the word list alone: the chat spends nothing): a room the API opened as private needs no check.

Interfaces ​

Functions ​