question

mark-2 avatar image
mark-2 asked

Is there a delay between UpdatePlayerStatistics and when value is availalbe in GetLeaderboardAroundPlayer

I'm calling the API from node.js so have enabled the ability to call UpdatePlayerStatistics. For a statistic named "score", if I update the statistic using UpdatePlayerStatistics and then immediately call GetLeaderboardAroundPlayer for "score", will the current player's leaderboard entry have the most current value passed to UpdatePlayerStatistics?

If not, what is the delay? How do I remove the delay?

Leaderboards and Statistics
10 |1200

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

1 Answer

·
Seth Du avatar image
Seth Du answered

As many resources on PlayFab are sharded, there is latency before the data changes syncs to all shards. If you call GetLeaderboardAroundPlayer right after the updates, it is possible that the callback returns the last version of statistics. However, the sync process should be quite fast and usually it only takes few seconds or very few minutes.

As you can compare with the local version of the previous result and try to call the API again if duplicated.

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.