Paging through leaderboards

How to get a specific leaderboard page on the server side!?

The game displays leaderboards page by page with 20 records on each. It is possible to skip ahead by 5 pages for faster browsing so I can’t use the cursors (and there are other use cases beyond this example that wouldn’t have a cursor). How can I get an arbitrary page of records, say 1120 to 1140?

I can’t find any non-hacky way of doing it.

Hello @adbourdages,

Could you please elaborate a bit on the use-cases you’re trying to cover that need skipping or fetching arbitrary pages in the leaderboard?

Certainly

  • allowing the player to skip ahead 5 pages in the leaderboard
    • this seems a common feature in most games with large leaderboards. Admittedly, paging through a 10000 entries on the client is an unlikely use-case but since we are migrating to Nakama and don’t want to change the client UI, it is “needed”
  • fetching the last entries in the leaderboard for a “snapshot” view
    • the top 3 scores are shown, 5 scores around the player’s rank and 3 bottom scores
  • fetching a list of score milestones to beat: the scores at rank 1, 3, …, 100, 200, … 1000, 2000, …
  • building an “around me” view on the server side (can’t find typescript runtime methods for that)

That’s it so far for the competitive mode that uses leaderboards most intensively.