question

Deekshith avatar image
Deekshith asked

Leaderboard Reset Time

I have missions in my game and they will have their end time specified in epoch seconds in title data.

- I want my leaderboard to reset at this given end time. How can that be done?

- Also in leaderboard we can set weekly as reset frequency. But I might want it to reset weekly based on when I resetted it. If I reset it on wednesday 4 am then it should reset on next week wednesday 4 am. Can this be done?

Leaderboards and Statisticsscheduled tasks
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

·
Citrus Yan avatar image
Citrus Yan answered

- I want my leaderboard to reset at this given end time. How can that be done?

PlayFab does not support resetting the leaderboard at a given end time. In this case, you may need to reset it manually from a custom server of your own: Manually resetting a statistic.

- Also in leaderboard we can set weekly as reset frequency. But I might want it to reset weekly based on when I resetted it. If I reset it on wednesday 4 am then it should reset on next week wednesday 4 am. Can this be done?

This can be done using the Scheduled tasks feature PlayFab offers:

  1. The type of the task is a Cloud Script Azure Function that resets the leaderboard, and, the reason for using Azure Function is that the IncrementPlayerStatisticVersion API is a Admin API and legacy Cloud Script does not support making Admin calls.
  2. Schedule the task at 4 am every Wednesday using Cron expression.
3 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.

Rizwan Babar avatar image Rizwan Babar commented ·

Could you provide an example code to reset leaderboard via cloud script which can be executed as scheduled task?

1 Like 1 ·
Deekshith avatar image Deekshith commented ·

So when does it get reset by default. Is on Sunday?

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Deekshith commented ·

The reset periods are:

  • Never: Stop versioning the statistic on a time-based basis.
  • Hour: Version the statistic at the top of every Hour (XX:00 UTC).
  • Day: Version the statistic at midnight (00:00 UTC) every Day.
  • Week: Version the statistic at midnight (00:00 UTC) every Monday.
  • Month: Version the statistic at midnight (00:00 UTC) on the first day of every Month.

https://docs.microsoft.com/en-us/gaming/playfab/features/social/tournaments-leaderboards/using-resettable-statistics-and-leaderboards#configuring-resettable-statistics

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.