question

Taran Saini avatar image
Taran Saini asked

Weekly leaderboard not resetting properly

We currently have two weekly leaderboards for wins and kills. We've noticed in recent weeks that when leaderboards reset, some players are still incrementing the previous week's value instead of incrementing from 0. These players seem to be carrying their previous week's value over to the next week's leaderboards. We dealt with this so far by manually resetting weekly leaderboards.

Regarding updating player statistics: We have already taken into account players who may be playing during a leaderboard reset so this shouldn't be an issue (set player statistic is called in our cloud scripts and retrieve current player statistics before updating to make sure it has the most up to date statistics).

Leaderboards and Statistics
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.

Citrus Yan avatar image Citrus Yan commented ·

May I have your title id, the PlayFabId & statistic name of those players whose leaderboard not resetting properly?

0 Likes 0 ·
Taran Saini avatar image Taran Saini Citrus Yan commented ·

Title Id: A7796

Statistic Name: Weekly_wins

PlayFabIds: ACB75AE02917680D, F514C9DF1D1C78D5

Note: The player's ids provided are taken from this weeks reset. Players who leaderboards are not resetting are different week by week.

0 Likes 0 ·

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

I checked both of the players you provided and cannot identify the issue you were having. Take player ACB75AE02917680D for example, I can see the "player_statistic_changed" event emitted around 2021-02-22T00:06:34.0139147Z, which is about one minute after the weekly reset (2021-02-22T00:05:34.5387163Z):

{
    "PlayFabEnvironment": {
        "Application": "mainservercloudscriptint",
        "Vertical": "master",
        "Commit": "535f9a6",
        "Cloud": "main"
    },
    "EventNamespace": "com.playfab",
    "StatisticName": "Weekly_wins",
    "EntityType": "player",
    "SourceType": "BackEnd",
    "Timestamp": "2021-02-22T00:06:34.0139147Z",
    "EventName": "player_statistic_changed",
    "EntityId": "ACB75AE02917680D",
    "EventId": "b29c75a3e9b8457e9e87744f6457aacb",
    "TitleId": "A7796",
    "Version": 26,
    "Source": "PlayFab",
    "AggregationMethod": "Last",
    "StatisticValue": 69,
    "StatisticId": 1828836447
}

You can see there is no field called "StatisticPreviousValue" included in this event, compared to an event with a previous value:

"Version": 26,
"Source": "PlayFab",
"StatisticPreviousValue": 0,
"AggregationMethod": "Last",
"StatisticValue": 1<br>
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.

Citrus Yan avatar image Citrus Yan commented ·

That means the statistic did get resetted however got updated with last version's value somehow, may I know your flow of updating player statistics in details cause I think problems may reside in that part, thanks!

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.