Hello,
I have an issue with leaderboards, namely when i try to get leaderboard entries the requests sometimes return an empty list.
These are my requests:
protected const string STATISTIC_NAME = "RankingPoints"; protected const int MAX_TOP_ENTRIES_COUNT = 3; //default 10, max 100 protected const int MAX_FRIENDS_ENTRIES_COUNT = 50; //default 10, max 100 protected const int MAX_CLOSE_ENTRIES_COUNT = 9; //default 10, max 100 protected const int MAX_USER_ENTRIES_COUNT = 1; //default 10, max 100 protected PlayerProfileViewConstraints PROFILE_CONSTRAINS = new PlayerProfileViewConstraints { ShowStatistics = true, ShowLinkedAccounts = true, ShowLocations = true, ShowDisplayName = true };
private void GetFriendsLeaderBoard(int version = -1) { var request = new GetFriendLeaderboardRequest { StatisticName = STATISTIC_NAME, MaxResultsCount = MAX_FRIENDS_ENTRIES_COUNT, ProfileConstraints = PROFILE_CONSTRAINS }; PlayFabClientAPI.GetFriendLeaderboard(request, GetFriendsLeaderboardsCallback,ErrorCallback); }
private void GetFriendsLeaderboardsCallback(GetLeaderboardResult result) { GetLeaderboardCallback(result.Leaderboard, FriendsLeaderboardEntries, LeaderboardRequestType.FriendsFull); Debug.LogError($"Friends Leaderboards All entry count: {result.Leaderboard.Count}"); }
private void GetGlobalLeaderBoard(int version = -1) { var request = new GetLeaderboardRequest { StatisticName = STATISTIC_NAME, MaxResultsCount = MAX_TOP_ENTRIES_COUNT, ProfileConstraints = PROFILE_CONSTRAINS }; PlayFabClientAPI.GetLeaderboard(request, GetGlobalLeaderboardsCallback, ErrorCallback); }
private void GetGlobalLeaderboardsCallback(GetLeaderboardResult result) { GetLeaderboardCallback(result.Leaderboard, GlobalLeaderboardEntries, LeaderboardRequestType.GlobalFull); Debug.LogError($"Global Leaderboards TOP entry count: {result.Leaderboard.Count}"); }