question

joaomedesymbol2 avatar image
joaomedesymbol2 asked

Problem with Update leaderboards

I've made other calls as PlayerData (title) and so far all right, at the moment I'm trying to update the leaderboard and I'm not getting it, the script worked sometimes and then simply stopped updating the leaderboard. I'm using this script.

    public void UpdatePlayerStatistics()
    {
        PlayFabClientAPI.UpdatePlayerStatistics(
            new UpdatePlayerStatisticsRequest()
            {
                Statistics = new List<StatisticUpdate>() {
                new StatisticUpdate() {
                    StatisticName = "PontuacaoMaxima",
                    Version = 0,
                    Value = 5
                }
                }
            },
            result => Debug.Log("Complete"),
            error => Debug.Log(error.GenerateErrorReport())
        );
    }
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

By Default, using client API to update leaderboards is disabled so that players won’t be able to cheat. If you insist using client API to update statistics, you can navigate to [Game Manager] -> [API Feature] -> enable [Allow client to post player statistics].

Though, we recommend not enabling any players in clients to post their statistics in case of abusive use. It's better to implement this function in Cloud Script.

4 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.

joaomedesymbol2 avatar image joaomedesymbol2 commented ·

the option is already enabled in the configuration, but still does not update the leaderboard

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ joaomedesymbol2 commented ·

Is there any error report when you call this api? Please check if you are selecting a proper Aggregation method. what's the previous value of "PontuacaoMaxima"?

0 Likes 0 ·
joaomedesymbol2 avatar image joaomedesymbol2 Seth Du ♦ commented ·

I found that the aggregation method was influencing the problem, I switched to "LAST" and it worked normally. Thank you for your attention and help.

1 Like 1 ·
joaomedesymbol2 avatar image joaomedesymbol2 commented ·

there are no errors, the console informs that the update was carried out normally, when I check in the site the update did not happen, the method of aggregate that I am using is the "minimum"

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.