Using Leaderboard with Buddy service

0 votes
I need to display top rankers among friends. I am using the BuddyService for friends management.

GetTopRankersFromBuddyGroup requires a group name and owner name, but I don't use groups, I just do FriendRequests and Accept/Reject.

Is there a way to use GetTopRankersFromBuddyGroup for the whole list of friends a user has?

Seperate question: after querying the user rank (call it UserRank), I would lke to query the leaderboard for users ranking in a range, like [UserRank-10,UserRank+10]. Is this feasible.

Tks
asked Oct 6, 2015 in App42 Cloud API-BaaS by dujardin (10 points)

1 Answer

0 votes

Hello,

Greetings for the day!!!

You can use getTopNRankersByGroup method takes userList as a parameter in which you can add your user and his friends. This will give you the top rankings in this group. Please see the documentation for this at this link.
For your second question, can you please share the platform/language you are working with so that we can provide you with the code snippet.

Regards,
Nishant

answered Oct 6, 2015 by NishantAShephertz (30 points)
Thanks for the reply. Regarding my second question, I answered it myself searching in the forum. For the record for other users, I'm using Unity and queried the ranking then set the page ossfet on the service before querying top rankers.
Great! Let me know if you any other help with the integration. We are here to help you.

Regards,
Nishant
All right, I tried to unit test getTopNRankersByGroup, but I'm having problems.
Here is my code (Unity), it's very simple and actually pretty much a copy of your documentation:
...
string game="DGCphRYbEN";
ScoreBoardService s = App42API.BuildScoreBoardService();
List<string> l = new List<string>();
l.Add("nexus");
s.GetTopNRankersByGroup(game, l, new UnityCallback());

The game exists and the user has a score in it (it works just fine when I call GetTopNRankers, for instance), but for some reason GetTopNRankersByGroup generates either a server error or a gateway_timeout.

Is there anything specifi I should look at, something that I might have overlooked?
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...