question

usachovdailymagic avatar image
usachovdailymagic asked

Delete or reset leaderboard data

How can I delete Statistics table or reset its data from CloudScript?

10 |1200

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

brendan avatar image
brendan answered

Deletion of statistics is not available yet - please see this post for more on this topic: https://community.playfab.com/questions/6212/when-will-functionality-to-delete-player-statistic.html.

Resetting a leaderboard occurs based on the reset period selected (daily, weekly, monthly), or else via the Admin API call. This is not enabled via the Server API at the moment.

We will be providing a way to specify a more granular reset time for leaderboards in an upcoming release, as well.

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

usachovdailymagic avatar image usachovdailymagic commented ·

Half of the year has gone since that post was created)) So there won't be any update in this direction?

We have a tournaments which start every three days. We store results in leaderboards, so we have to clean them manually?
Can you tell please - What time do they reset exactly?
daily - ?
weekly - ?
monthly - ?

0 Likes 0 ·
brendan avatar image brendan usachovdailymagic commented ·

Leaderboards reset at midnight UTC in all cases. For weekly leaderboards, the reset is midnight, Monday morning (monthly is, of course, midnight the morning of the 1st of each month).

We do want to provide for statistic deletion at a later date, but this is specifically why we don't provide dates for things that aren't at the top of the priority list - they can easily get pushed down as high priority items come in. As a live service, our first priority will always be making sure the service is reliable.

For your design, we actually have a number of game that do tournaments by "rotating" across several stats - so use stat1, then after three days switch to stat2, etc., and use the IncrementPlayerStatisticVersion call to reset the leaderboard when you need to.

0 Likes 0 ·
usachovdailymagic avatar image usachovdailymagic brendan commented ·

Thanks IncrementPlayerStatisticVersion helped

0 Likes 0 ·
Show more comments
colinchiu avatar image
colinchiu answered

If Server API could call IncrementPlayerStaticVersion from cloudscripts, then you could Schedule a cron task by calling CreateCloudScriptTask and achieve a similar result. This would at least let you automate the process to a certain extent

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.

brendan avatar image brendan commented ·

Yes, we'll be providing more options for leaderboard resets in a future update.

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.