Leaderboard Around Owner Returns Null Cursors

Unity client call to ListLeaderboardRecordsAroundOwnerAsync returns null cursors for previous and next - the client is unable to fetch additional records beyond the initial limit of 100 if the user scrolls to the beginning or end of the leaderboard. Is it expected behaviour to return null cursors on this command?

  1. Versions: Nakama 3.10, Windows, {Unity SDK 3.4.0}
result = await Client.ListLeaderboardRecordsAroundOwnerAsync(Session,PlayerDataKeys.NakamaDharma, PlayerData.NakamaID, limit: 50);
Debug.Log(result.PrevCursor);
Debug.Log(result.NextCursor);

This prints null for both cursors.

Hi @prateek-sirah,

what you’re seeing is expected behavior, this function in its current form does not return cursors.

@ftkg can y’all prioritize adding this? This really limits our ability to implement user-relative leaderboards. Why even offer this function if it’s not going to have cursors if users want to continue scrolling?

Hi @maxmiranda,

That is in our backlog but it doesn’t have a high priority yet. There are at least two option for now:

  • You could sponsor the feature by contacting us at contact@heroiclabs.com
  • You could send us a pull request which we would highly appreciate

Of course, it depends on how essential that feature is for you.

@maxmiranda, cursors for ListLeaderboardRecordsAroundOwner have been introduced in Nakama v3.13.1. We haven’t updated the Unity SDK yet to accept the new cursor param, but we’ll include it in one of our next releases.

For now, you can use the REST API, you’ll get a next/prev cursor in the first response that you can then set using the cursor param in the following request.

Otherwise, you can create your own custom RPC using the leaderboardRecordsHaystack runtime function.