question

Ethan K. G avatar image
Ethan K. G asked

How to know if the submitted result is ignored or recorded by the leaderboard?

The same player keeps playing the same game and sending every result to the same leaderboard. Is there a way or API to know if the submitted result is ignored or recorded by the leaderboard?

I check the API UpdatePlayerStatistics, it returns nothing.

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

·
Rick Chen avatar image
Rick Chen answered

Every data updated to the player statistics will be updated to the leaderboard. But there could be some delay in updating the leaderboard.

If the UpdatePlayerStatistics API returns code 200, it means the data is successfully updated to player statistics. You can also check the player statistics using GetPlayerStatistics API. After that, you could wait a few seconds then use GetLeaderboard API to check whether the data is updated to the leaderboard.

EDIT: the first sentence is based on that leaderboard uses the “Last” aggregation method.

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.

Ethan K. G avatar image Ethan K. G commented ·
@Junjin Chen

Thanks for your answer.

Suppose this is a high_score leaderboard, always use the highest value(Maximum). My current leaderboard score is 1000. When call UpdatePlayerStatistics with a score value at 900, since 900 < 1000, my leaderboard score will not be changed, still is 1000, right?

So in this case, if I want to know my current local score will not change leadboard records even I call UpdatePlayerStatistics, I need to use GetPlayerStatistics & GetLeaderboard APIs to figure it out by myself, right? Is there a qucik way to achieve that?

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Ethan K. G commented ·

Yes, if the leaderboard is set to use the Maximum aggregation method, the leaderboard score will keep the maximum score. I was thinking about the “Last” aggregation method, which always uses the last score, sorry for the confusion.

There is no API that directly checks whether the score is updated to the leaderboard. Depending on the scenario of your game, for example, if you only want to update the maximum score player ever achieved to his statistic, you could do as follow:

  1. Use GetPlayerStatistics API to get the last maximum score before update the score to statistics.
  2. Compare the last maximum score with the current score
  3. If the current score is greater, use UpdatePlayerStatistics API and update it to the player statistic. Otherwise, do not update.
1 Like 1 ·

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.