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
We cannot reproduce this behavior in our testing title, could you please provide the TitleId for us to investigate?
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.
Answer by Sarah Zhang · Mar 09, 2021 at 01:54 AM
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.
Unity - UpdatePlayerStatistics followed by GetLeaderboardAroundPlayer 1 Answer
Leaderboards AvatarUrl and LinkedAccounts are always Null. 2 Answers
Update Player Statistic with decimal number value causes cryptic error 1 Answer
Significant delay in leaderboard updates 1 Answer
Not all my leaderboards were reset 3 Answers