Open Firemaw opened 7 years ago
I'm encountering the same issue, and I dug into the code a little bit.
Here's the relevant code in LoadScores in PlayGamesPlatform.cs:
mClient.LoadScores(
board.id,
LeaderboardStart.PlayerCentered,
board.range.count > 0 ? board.range.count : mClient.LeaderboardMaxResults(),
board.userScope == UserScope.FriendsOnly ? LeaderboardCollection.Social : LeaderboardCollection.Public,
timeSpan,
(scoreData) => HandleLoadingScores(
(PlayGamesLeaderboard)board, scoreData, callback));
The starting point can only be LeaderboardStart.PlayerCentered or LeaderboardStart.TopScores. The range.from variable isn't even used in the entire plugin.
It's very disappointing how badly this plugin conforms to the ISocial interface. See also #2629 .
Would love to get an official reply for all these issues.
yes, after extensive testing the range 'fromValue' parameter appears to make no difference whatsoever. The 'valueCount' parameter does however limit the returned array size to that amount.
Android 6.0.1 with GPGS 0.9.36 and Unity 5.5.3f1.
When performing a ILeaderboard.LoadScores() operation with a range filter, the incorrect ranks are returned. It seems this part of the standard Unity Social API has not been implemented properly.
I understand on the main page there is an example of how to use PlayGamesPlatform.Instance.LoadScores() which works for the most part (except for a high score caching issue). However, for all other code I am using the standard Unity Social API, which is cross-compatible with iOS (where I am not using GPGS), so it would be nice to use the same code for both instead of having to write two separate blocks to get nearby players on leaderboards. The other issue I have run into using PlayGamesPlatform.Instance.LoadScores() is #1534.
Here is the core code in question:
Here is the full code for the fetch that works on iOS, but not Android (incorrect ranks returned):