I’m trying to figure out what is the best solution for geting basic information about user (display name, avatar url, hat number, …) to present on leaderboard. The documentation does not contain any suggestion from what I see. I am considering two options (I saw second proposal on this forum):
-
Using get users method and provide user identifiers from leaderboard - The client must perform additional request. At the same time I don’t expect any performance issues with such additional request.
-
Adding basic information to a leaderboard record - All required data to present leaderboard will be delivered to client in a single response, so it simplifies client. At the same time, I have some doubts as to whether this is a good approach, because of the following:
- I cannot add any metadata to leaderboard records that belongs to not started tournament.
- Adding metadata on tournament join may lead to a data corruption, because adding metadata on join requires separate write that will happen in after hook. This write can fail, and the user will not be notified about this, because after hook errors are not propagated to the user. At the same time other users may read the leaderboard in such inconsistent state. Moreover even adding metadata will succeed there is a small time gap between both operation when the leaderboard is in inconsistent state.
I’d love to hear what you think of it.
- Versions: Nakama 3.13, Linux binary
- Server Framework Runtime language Go