five-on-it / apps/api/src/social-nakama
apps/api/src/social-nakama
The friend graph, the mutes and the chat history on Nakama (TECHNICAL_SPECS §9.6): the API calls Nakama's REST API as the player, with the session token the player sent it (Nakama's own), so every account sees and changes only its own friends.
- Friends are Nakama's friends (
/v2/friend): adding someone who asked accepts them; Nakama's states 0 (friends), 1 (sent) and 2 (received) are the links, 3 (blocked) is left out. A name is a Nakama username. - Mutes are a storage object of the player's own (
foi/mutes, readable and writable by them alone). - The party's and the direct messages are kept in Nakama's chat channels by the runtime module's
foi_chat_keepRPC (apps/nakama), called with the runtime's HTTP key: a party's in the room channelparty-<id>, a direct message in the two players' direct channel, so their history is Nakama's. Without the key nothing is kept.