question

Arbuzov P avatar image
Arbuzov P asked

Get previous versions leaderboard

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Arbuzov P avatar image Arbuzov P commented ·

I want to show the previous version without knowing the number. Is it possible to get the number of the previous version or the current one so that s from it -1 and thus get the latest

0 Likes 0 ·
JayZuo avatar image
JayZuo answered

With GetLeaderboard API, if we do not set UseSpecificVersion and Version in request body, we will get current version of the leaderboard and the version detail will be returned in GetLeaderboardResult.

Besides this, you can also use GetPlayerStatisticVersions to get the current version.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rick Chen avatar image
Rick Chen answered

You could use the GetLeaderboard API, which should return the current version of the leaderboard. What do you mean by “without knowing the number”? If you don’t want to get the records, you could set the “MaxResultsCount” in the request body to 0.

4 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.

Arbuzov P avatar image Arbuzov P commented ·

I want to show the previous version. for example : today previous version 1,tomorrow 2 etc. i can't every day change version in code.

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Arbuzov P commented ·

The previous version equals to (current version - 1), if your leaderboard uses scheduled reset, you can also get the NextReset time in the response. You don't need to change the code every time the version refreshes, you could just call the GetLeaderboard API and use the result version in your code.

0 Likes 0 ·
Arbuzov P avatar image Arbuzov P Rick Chen ♦ commented ·

"The previous version equals to (current version - 1)" i know, but i dont know how get current version."you could just call the GetLeaderboard API and use the result version in your code" how can get result version? you can show me exapmle code

0 Likes 0 ·
Show more comments
Ahmed Gado avatar image
Ahmed Gado answered

Hello all, I am facing the same issue but I can't find the UseSpecificVersion boolean in the GetLeaderboardRequest class ? is it removed or I am using different version of sdk for example ?! because everything is fine with the version numbers printed in console, but it ended up having this error "Leaderboard Version Not Available" , event when passing the current version or the most previous one (supposing the current is 56, and the previous is 55) both show the same error.Note that when using the GetLeaderboard without passing any int for version it works fine and retrieve the current leaderboard

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ahmed Gado avatar image Ahmed Gado commented ·
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.