play-games-plugin-for-unity icon indicating copy to clipboard operation
play-games-plugin-for-unity copied to clipboard

PlayGamesPlatform.Instance.LoadScores returns old scores

Open PrometeoProduction opened this issue 5 years ago • 15 comments

This is the code that I use:

PlayGamesPlatform.Instance.LoadScores(
            "CgkIvJ3e4_MWEAIQAQ",
            LeaderboardStart.PlayerCentered,
            100,
            LeaderboardCollection.Public,
            LeaderboardTimeSpan.AllTime,
            (data) =>
            {
                foreach(var score in data.Scores)
                {
                    Debug.Log(score.value + " - " + score.userID + " - " + score.leaderboardID);
                }
                
            });

When I load scores using the API (Social API or PlayGamesPlatform.Instance), I get out of date scores.

But, when I use ShowLeaderBoardUI() function instead, the scores are correct in the GUI.

Is this normal?

UPDATE EDIT:

The problem seems to be LeaderboardStart.PlayerCentered.

When I use PlayerCentered it returns old or wrong values, instead when I use LeaderboardStart.TopScores I get the right values.

Why does this happen?

PrometeoProduction avatar Aug 05 '19 07:08 PrometeoProduction

I confirm, PlayerCentered returns old scores

frolky avatar Aug 21 '19 07:08 frolky

LeaderboardStart.TopScores seems to return the highest score in the game from all players, should I filter to find the player's highscore? That sounds like an issue if the leaderboard contains a lot of entries

ovieira avatar Sep 10 '19 10:09 ovieira

LeaderboardStart.TopScores seems to return the highest score in the game from all players, should I filter to find the player's highscore? That sounds like an issue if the leaderboard contains a lot of entries

See #2740 I recently opened. There's also a bug where if you use PlayCentered it doesn't provide any paging, making it practically impossible to make a custom leaderboard UI starting from the PlayCentered part of the data.

exzizt avatar Oct 03 '19 23:10 exzizt

Thanks for reporting. We are looking at it.

olehkuznetsov avatar Nov 28 '19 11:11 olehkuznetsov

Any news on this issue? Thanks!

zoranigic avatar Dec 24 '19 12:12 zoranigic

Same here, using 0.10.7. Any hint how this could be fixed maybe locally already before an official new version is released? I can successfully write a new score (also then shown on different device), however reading it back again locally will just deliver a previous value only. Opening the „stock“ leaderboard UI, though, will already show the new value. So I‘d suspect some internal caching to be a bit too sustainable...

habitoti avatar Mar 23 '20 20:03 habitoti

Same on 0.10.8, PlayerCentered returns old values. Same thing also happens when using PlayGamesPlatform.Instance.ShowLeaderboardUI().

bazcat avatar Apr 12 '20 16:04 bazcat

@olehkuznetsov Any updates on this critical issue?

exzizt avatar Apr 12 '20 17:04 exzizt

In the BlueStack emulator PlayGamesPlatform.Instance.ShowLeaderboardUI() returns true values but in my phone return old values

kamiltonek avatar Apr 12 '20 19:04 kamiltonek

This breaks the entire plugin and is still not fixed after 1 damn year? Wow.

fr3qu3ncy-dev avatar Jul 13 '20 21:07 fr3qu3ncy-dev

Correct me if I'm wrong, but it seems that the "All times" is slow to update. When you check the score with "Today" filter on the Leaderboard GUI it displays the updated score, but the "All times" remains with the old one, so the issue may be the way "All times" is being updated, so they don't overburden their servers while collecting scores from, well, all time.

yosifovdimitar avatar Jul 14 '20 08:07 yosifovdimitar

Any updates on this? Running into the same issue.

mura94 avatar Sep 23 '20 21:09 mura94

Hey there. Is there any update?

UPD. Added a PR with the fix: https://github.com/playgameservices/play-games-plugin-for-unity/pull/3228

matiosfree avatar Mar 12 '23 07:03 matiosfree

Hey there. Is there any update?

UPD. Added a PR with the fix: #3228

Thanks! Your pull request helped me

JokePenny avatar Mar 19 '23 21:03 JokePenny