Hi,
I am planning to have daily reward on our games and have a concern to implement it on cloudscript.
I found an article about daily reward:
https://community.playfab.com/hc/en-us/community/posts/205460028-Cloudscript-for-daily-reward
In this case, I suspect there's a chance having racing condition issue. (between checking the timestamp in UserInternalData and update it)
So my question is:
- does cloudscript limit number of threads to one per a user? (or a game?)
- if no, is there a way to make the operation atomic? or CAS operation or user lock?
I did some search on Playfab documents but cannot find those functions.
What is the best practice to make it safe?
(I came up an idea to use item count as a lock object but I thought it is a bit too expensive for the use)