question

chtfg avatar image
chtfg asked

Getting scores around the user

I am looking for a way to get certain scores so that we can display the leaderboard in our own custom UI. Ideally, I want to be able to show 5 scores with the user in the middle so they can see who are around them (or slightly differently if they are at the top or bottom of the leaderboard). So far I can see a few methods: i) getScores - says it gets the top 100 scores. I could work out the information I want if they are in the top 100, but otherwise this wouldn't work. ii) getPercentileRanks - I am not sure if this is capable of doing what I want. I don't like the description of this method. It's not clear to me what it is doing. Eitherway, if I call this method I get an "UNRECOVERABLE" error with error code 24. There is currently only one score in the leaderboard, so not sure if this could be the cause? I can successfully call getLocalPlayerScore and work out my own rank/score. I just wondered if there was a way to get those around me as well? Thanks for your help.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi, Thank you reaching out. Unfortunately, it's not possible with the current state of the SDK/APs. At most, you can get the rank of the player from Score.getRank() and if its within first 100, you can show the players around the user (in the way you have mentioned). But getting players around the current user having generic rank (> 100) we need either one of below 2 APIs exposed. 1. getPalyesAroundMe() - will return 5 players fall after or before my score 2. getPlayerInformationOf Ranks(int ranks[]) - Will return basic player information along with the scores. Sadly, we do not have anything like this. Sorry for not being able to help you . Thanks.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

chtfg avatar image
chtfg answered
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.