question

John Peterson avatar image
John Peterson asked

When updating a statistic, is there any way to know whether the submitted statistic is the "winner"?

Dear PlayFab community,

I have a number of Leaderboards with a MAX aggregation method. I'd like to be able to easily determine whether a submission of UpdatePlayerStatistics() would yield in "winners" for any of the statistics in the list.

For example, if my current high score for StatisticA is 100, and I submit a value of 101, it'd be convenient if the UpdatePlayerStatisticsResult would indicate that StatisticA has been updated with the latest, or effectively ignored.

Thanks for any help anyone can provide!

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

·
brendan avatar image
brendan answered

The current behavior of that API call is that it returns an OK for any successful call, but a successful call may or may not actually result in updating the statistic for the player, depending on the value and the aggregation method. What I'd recommend is adding a feature request for the response info you'd like. But also, I can point out that the event for a change to the player statistic only fires if the statistic is actually updated. So depending on what it is you're aiming to do, you might be able to use a Rule to trigger it.

1 comment
10 |1200

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

John Peterson avatar image John Peterson commented ·

Thanks, @Brendan! I'll go ahead and submit a feature request to enhance the result object for the UpdatePlayerStatistic call. Unfortunately I don't think I can leverage the event in my case, but that's good to know that one is fired when the statistic actually gets updated.

0 Likes 0 ·

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.