question

Jakub Smekal avatar image
Jakub Smekal asked

Position of user when calling GetLeaderboardAroundPlayer without the statistic isn't always 0

I'm calling GetLeaderboardAroundPlayer for user who doesn't have the corresponding statistic in leaderboard, but his position equals to 1 instead of 0, as stated by this:

Note: When calling 'GetLeaderboardAround...' APIs, the position of the user defaults to 0 when the user does not have the corresponding statistic.

This is the content of a leaderboard:

Unity output after calling GetLeaderboardAroundPlayer:

GetLeaderboardAroundPlayer - position: 1, stat. 0, name: guest654032
Leaderboards and Statistics
8dxx2.png (20.7 KiB)
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sarah Zhang avatar image Sarah Zhang commented ·

We cannot reproduce this behavior in our testing title, could you please provide the TitleId for us to investigate?

0 Likes 0 ·
Jakub Smekal avatar image Jakub Smekal Sarah Zhang commented ·

Our TitleId is 4AA30. I also managed to reproduce this issue step by step:

1. Add player A to the leaderboard

2. Add player B to the leaderboard with higher stat value than player A

3. Reset the leaderboard

4. Add player B to the leaderboard again, with same value as before

5. Call GetLeaderboardAroundPlayer for player A

For me, this outputs 1 instead of 0, as if it still considered the player to be there even after the leaderboard reset.

0 Likes 0 ·

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

Thanks for the clarification, we found that player that has no corresponding statistics would have the value that is 0, the position would not be 0. If you want to distinguish if a player has some statistic or not, we would suggest you use the API GetPlayerStatistics.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.