I’m trying to understand the exact behavior of the expireTime parameter in LeaderboardRecordsList API.
Specifically, I need to know:
- Does it return records before or after the specified timestamp?
- If I want to get last month’s records for a monthly leaderboard reset, what would be the correct expireTime value to use?
Could someone please clarify how this parameter works?
Leaderboards with a reset expression store the scores alongside the respective expiry time, and during that cycle only submitted scores with that expiry time are written and fetched. When the next cycle comes along the new cycle expiry time is used - the expiry time is part of a composite key that uniquely identifies the records in the database - this ensures that all records are kept but only the ones with current cycle expiry time are returned by the APIs.
To fetch previous records you’ll need to know what the expiry time was for them and override it in the listing API - when you list a leaderboard, the previous and next expiryTimes are returned by the API. If you need to go beyond that you may have to calculate the previous resets cron expression expiry times so you can input them in listing.
Hope this helps.
According to the documentation:
Leaderboards with a reset expression store the scores alongside the respective expiry time, and during that cycle only submitted scores with that expiry time are written and fetched. When the next cycle comes along the new cycle expiry time is used - the expiry time is part of a composite key that uniquely identifies the records in the database.
I understand I need to use the correct expiry time to fetch previous records, but:
- How do I calculate the correct expiry time for the previous cycle?
- Is there a way to get the previous cycle’s expiry time programmatically?
- What’s the correct value to pass as the expiry parameter in LeaderboardRecordsList?
Any help would be appreciated!
what is the parallel method in unity c#?
unity client.ListLeaderboardRecordsAsync also supports eexpiry.
howto get past time in corn on unity side?
currently, I’m reading it from the server side.
The immediate previous or next scheduled expiry times are part of LeaderboardList
or LeaderboardsGetId
result, I believe this API is only exposed in the server runtime so you’d need to set up an RPC to be able to call it from the client.
Similarly, the cron utility functions are only exposed in the server, if you need to expose them to the client you should use them in an RPC.
can i also use this method to calculate many periods before? for example calculate the leaderboard for 5 period ago.