mesosoi / silverwaregames-io-issue-tracker

Issue Tracker for SilverwareGames.io
https://silverwaregames.io
4 stars 0 forks source link

High scores need to have some kind of ID tied to them so that I can do leaderboards for different days. #357

Open michaelplzno opened 1 month ago

michaelplzno commented 1 month ago

I'm planning to have different boards for Bobble Bonanza based on what day (maybe a new one every month or week instead because it's a small community.) it is and I'd like to separate the score listings between the different boards.

Using timestamps to sort the boards is tricky because someone may start a board at midnight and play over the time barrier.

mesosoi commented 1 month ago

There's already an ID for each highscore. Use the get.game.stats method and see for the value of id.

Each highscore has a timestamp linked to it. You can specify the amount of seconds you want in the time parameter. Currently, it's not possible to get data based on the calendar date.

Also, you can store any additional data in the extra key value. Simply specify it when receiving the hash and posting game data in the extra parameter. It should be a JSON string up to 4096 characters long. Then, you'll be able to get its contents via get.game.stats. Don't store anything sensitive here as it's returned for all entries in selection at the same time!

michaelplzno commented 1 month ago

ok so with the extra parameter I could log that it was on board "5.14.24" and then when I load the scores I can get that string and deal with it client side?

mesosoi commented 1 month ago

ok so with the extra parameter I could log that it was on board "5.14.24" and then when I load the scores I can get that string and deal with it client side?

Yes, but only as JSON, so: ["5.14.24"]. And then call the first element of the array