question

vivi avatar image
vivi asked

is it possible to execute a cloud script on a specific date?

Hi,

We are working on a tournament system for our game. Basically when the player first creates a tournament a date will be saved. After 72 hours, the tournament should end. Is there no way to make playfab automate this. Basically, I want a cloud script to be executed after 72 hours from the tournament creation date.

Is that possible?

Cheers

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

·
pfnathan avatar image
pfnathan answered

Here is the reference for you to start automated tasks:

https://api.playfab.com/docs/tutorials/landing-automation/creating-a-scheduled-task

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.

vivi avatar image vivi commented ·

Sorry for the late replay, I understand that you can create an automated task, but is there anyway you can do it in code? Basically, this should be done on the client side. When the client creates a tournament, it also schedules a task for a cloud script to run after 72 hours. Any idea how to acoumblish that.

0 Likes 0 ·
brendan avatar image brendan vivi commented ·

No, Scheduled Tasks are designed as a way to run logic for a title in general (to start/stop events, for example), or over a player segment (to take an action on all players in the group). What you're describing is being able to set up a CRON job for an individual user, from a Client API call, which triggers server-side logic when the player is offline. That is not currently supported. You could potentially enable a daily check on a user segment that you define of players that have pending actions, but a better solution (assuming this is for a mobile game) would simply be to use scheduled local notifications to let the player know when it's time to check on something in the game.

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.