question

Haris Sevinc avatar image
Haris Sevinc asked

Time Limit For Specific Cloud Function

Hi there,

Can i add time limit for specific function? For example 10 second is ok for all that scripts but i want one of them to be called every twelve hours.

For example, GetReward() should called only per twelve hours. Others can work for 10 seconds. is it possible?

Regards

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

·
Seth Du avatar image
Seth Du answered

There is no built-in feature like this, however, you may implement a workaround solution to fulfill this requirement.

You may simply store the remaining times and last execution timestamp in Player Read-Only Data or Player Internal Data so that when the Cloud Script function is called, it will firstly check the data of the player to make sure this execution is valid. While after the work is done, there will be an update of this timestamp.

If it is an automatic job, you may also implement a scheduled task.

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

Haris Sevinc avatar image Haris Sevinc commented ·

So i will check it on Unity - C# side, if timestamp is okay, it will be able to call cloud function.

I just started to learning cloud scripting, i was wonder its possible or not on built - in. Thanks for your clear reply

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Haris Sevinc commented ·

I believe it should be checked on both side. Client side checking can handle most of the cases, meanwhile if you didn't add any verification step on cloud script, malicious users can directly call API via RESTful tools.

0 Likes 0 ·
Haris Sevinc avatar image Haris Sevinc Seth Du ♦ commented ·

Thanks for warning me. Can i check it on playfab cloud? Can you give me keywords about it please?

0 Likes 0 ·
Show more comments

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.