question

robert avatar image
robert asked

Cloudscript method on title_statistic_version_changed event

We tried to setup a rule to call a cloud script function whenever a statistic value changes. We need this to cycle our daily/weekly/events. (We don't want to use a schedule task for this because we want to be as synchronous as possible with the statistics reset timepoint. It would add an additional source for errors when we have to maintain a scheduled task and a leaderboard reset time for each event we would to cycle).

Anyway, we setup up the rule with:

CustomAction = title_statistic_version_changed
or
CustomAction = com.playfab.title.title_statistic_version_changed

to call a cloudsript method.

Unfortunately the method is never called. Is this supposed to work at all? (or are rules for player events only?)

If not, how can we react in the cloud script on a statistic reset? (e.g. to update the title data to move on to the next event, etc...).

We would also use scheduled tasks instead of automatic resets of statistics on different time intervals. But unfortunately we can't reset a leaderboard from the cloud script. (This would be the preferred method for us, clean and straightforward).

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

Correct - of the built-in PlayFab events, only those available in the drop-down in the Rule editor are valid for triggering actions. Right now, the service isn't set up for additional logic to be triggered on a leaderboard reset, as the problem is that the time it will take for the prize table to be completely processed is going to be variable. However, you can easily set up a Scheduled Task which runs on the same schedule, since the reset times are on the hour/zero UTC.

For the latter idea, can you "like" this Idea in the Feature Requests forum (https://community.playfab.com/idea/12766/incrementplayerstatisticversion-to-be-callable-fro.html)? Aggregating that input via the Feature Requests forum is one of the inputs to our prioritization system.

10 |1200

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

giorgiotino avatar image
giorgiotino answered

Three years have passed, is this still what happens? There's no way to automatically execute a cloudscript when a (recurring) leaderboard is reset? Is an additional Scheduled Task still the suggested answer? Thanks!

10 |1200

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

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.