nakama
nakama copied to clipboard
Improve DM join protocol message to support multiple IDs.
The direct message join message in the server protocol currently lets you initiate a DM topic with a single user ID at a time. You can send multiple of these messages - but one for each of the users you want to direct message.
It would be more efficient to allow multiple IDs to be specified in a single join message so you could take your friends list and/or group members list and create DM topics for each one. This is more efficient and flexible for both the client and server.
- The server treats DMs the same as other topics, we should allow multi-join on all or a mix of topic types. For example join 2 DMs and 1 room in one operation.
- We must report results in a way that lets clients match the outgoing join operations with the resulting topic presences and IDs.
- The server and protocol must handle partial errors where some topics are successfully joined and some fail due to permissions or other reasons.
- If we're allowing topic multi-join we should look at multi-leave as well.
When a players connects to the server and have 100+ friends, it starts DMs with each of the friends. Calling 100+ methods takes a lot of time. If we decide to increase maximum amount of friends, that will become even more painful.
Being able to connect to all the friends at once would definitely solve the issue. Maybe there should be an inside method connectToFriendsDM? In this case I wouldn't need to send a huge package of all my friends to nakama.