Sign In Register

How can we help you today?

Start a new topic

How to retrieve the time remaining until a leaderboard resets ?

Does LeaderboardDataRequest return the server time or would I have to write some cloud code to retrieve that ? I've set up daily and weekly leaderboards but I want to display a timer on screen that shows how much time is left until the leaderboard resets. I could use the device's time but that doesn't seem like a good idea in case it's set to the wrong time. If I do have to use cloud code then can you link me to a Unity example as I haven't written any yet. It seems like LeaderboardDataRequest  should return the server time, or time remaining to reset so we don't have to make two request. Thanks!

1 Comment

Hi Peter,

Daily Reset Leaderboards reset at midnight UTC and Weekly Reset ones reset Sunday night at midnight UTC. In your leaderboard data response Cloud Code script you could calculate the time remaining to the end of the day/week and attach it to the response as scriptData. You could then handle it accordinly on the client.



Login to post a comment