Thank you!
chs123123
Recent community posts
Hi Dan. Please help me! I purchased your premium leaderboard, but I don't know how to use it. It seems to be the same as the free version.
In addition, when I tested the leaderboard, I found that when my rank is after about 100, I will not be able to get my rank alone
My code is:
public static void RequestSelfRank(string key, string userName, Action<bool, int> callback)
{
if (!CheckValid())
{
callback?.Invoke(false, 0);
return;
}
var query = LeaderboardSearchQuery.ByUsername(userName);
LeaderboardCreator. GetLeaderboard(key, false, query, (rankData)=>
{
var success = true;
if (rankData == null || rankData. Length == 0)
{
success = false;
}
var selfRank = 0;
if (success)
{
var self = rankData[0];
selfRank = self.Rank;
}
if (selfRank <= 0)
{
success = false;
}
callback?.Invoke(success, selfRank);
});
}