I have a Leaderboard that resets automatically everyday. I need to retrieve the following information (from the client app) for the Leaderboard feature in the game I am working on:
Looking at the Leaderboard API documentation, it seems that I lack the ability to get these information directly.
For example: If I want to retrieve the player's rank and score, I would need to call GetLeaderboard() and check every entry if it's the player's ID. If the player isn't in the first 100, I need to call GetLeaderboard() again and again until I find the player. I thought I could use GetPlayerStatistics() but it only includes the score and not the rank.
Is there a way to retrieve those information from the client?
Weird that I can't edit my own question. Anyway, #3 isn't an issue anymore.
Answer by Brendan · Jun 27, 2016 at 02:54 PM
Yes, you can use GetLeaderboardAroundPlayer to retrieve a leaderboard listing centered on the any player - and if you don't specify a PlayFabId, it'll be for the current player.
Currently, the previous scores (for older versions of the leaderboard) are available via S3, for tools that you write for use internally. If you need to have multiple days (for a reset-every-day) leaderboard, you may want to consider using two leaderboards, and a local tool to reset the leaderboard every other day, so that you always have two days' worth of data available.
Thanks. Could you point me to the documentation regarding the 2nd part? I can't seem to find it in the documentation page.
Sure thing! It's in the PlayerStatisticVersion info you get back from GetPlayerStatisticVersions. There more info on this in the tutorial on using resetting statistics, here: https://api.playfab.com/docs/using-version-statistics