Hello! I want to reset the values saved by the players in Cloud Save every time the Leaderboard is restarted. So far I know that when the leaderboard is reset, a ‘reset’ event is emitted that can be captured by the Cloud Code Triggers.
Can you suggest a way to reset all user values using this event? (It cannot be through the user ID in the leaderboard since the maximum is 1000)
Hi @Rob_Elias
Depending on how many user values you may need to update, you may run into some current limitations with Cloud Code in terms of execution time (max 15 seconds) and this could be fairly costly? Soo I’d first consider whether you have to reset all users data or could you compare a field in the user data with a global value (e.g. a timestamp or a counter value in a Cloud Save custom data field or possibly remote config) - if the two don’t match, then the game client/ Cloud Code operation could consider the user data “reset”.
Otherwise have a look at this sample that rewards the top 5 users Interact with cross-player data as I think that could be modified to handle your use case.
Thank you very much for the help.
Thinking a little more about this, I came to the conclusion that the Leaderboard reset all the values, so when I start the game I can ask if there is a record in the leaderboard used and if there is not, send a script to be executed to reset the default values from the user to start the new season.