Hi there!
Is there an easy way to list the leaderboards records around a player, on the server side?
I can get the owner rank and then iterate using the cursor, but accessing the database 100 by 100 until get the interval looks like heavy work (maybe I’m wrong)
Here is a client side example, but seems like that feature is missing on server code.
Returns me the first 100 entries in “entries” (where the player is in 7th place, for example) and the player entry in “ownerEntries”. The player rank in “entries” is different than the player rank in “ownerEntries”.
There’s currently no function exposed in the runtime to list a page of leaderboard records around an owner ID. You can open an issue on the tracker and we’ll add it to the list of requests to be addressed as soon as we can.
I’m not sure I’ve seen a case so far of a rank discrepancy like that. Can you create a separate issue for it with a reproducible case? Ideally a self-contained Lua module that creates a leaderboard, fills it with records, and performs the listing that shows this discrepancy. It’s possible the calculation is off in some case and it would help to have a reproducible test case.
Issue added.
Seems like that if you set some score, and this score is the same than other entries on the leaderboard. Leads to discrepancies between your real position (“entries”) and the one returned by “ownerEntries” entries, ownerEntries, previous, next, error := nk.LeaderboardRecordsList(ctx, "global", []string{playerID}, 100, "", 0)