question

ariellarias avatar image
ariellarias asked

LeaderBoards: Daily Resets with Accesible Data from Last One

Hi.

We are working using Leaderboards and Statistics for checking best players in a Daily Tournament Logic we have.

Once a day, the leaderboard is incremented and the last one is archived.. but we would like to access to the last one so we can show to the players the standing from Last Tournament and the standings from the current tournament being played.

What kind of approach we can use?

Thanks!

Leaderboards and Statistics
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

·
brendan avatar image
brendan answered

The simplest thing to do would be to use two Leaderboards, and rotate between them. You could store a UTC timestamp in Title Data that you use to compute which one is "current" based upon comparing that to the current UTC timestamp.

We'll also be adding more functionality to leaderboards in some upcoming sprints. We'll be making sure to consider this, and other features requests we've heard, as part of the planning for that.

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.

ariellarias avatar image ariellarias commented ·

Hi @Brendan, thanks for the answer.

I was doing basically that. I made 2 Leaderboards, I'm glad to see that I was somehow oriented.

For making the reset in the CloudScript, I needed to do a url request with an admin api call for the Increment, I'm ok with that or am I'm missing some way to call admin api from Cloudscript?

BTW, I'm excited to see the new features, keep up the good job!

0 Likes 0 ·
brendan avatar image brendan ariellarias commented ·

No, what I meant is that you would set the leaderboards to have a daily reset in their settings. Then, you would use the timestamp to know which one to write to, since the reset always occurs at 00:00:00 UTC.

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.