How can I delete Statistics table or reset its data from CloudScript?
How can I delete Statistics table or reset its data from CloudScript?
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.
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 - ?
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.
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
3 People are following this question.