Meet the team behind ShepHertz Platform
Making a difference in the world together
People whose belief drives us forward
Enterprises & Developers from across the world
Access the ShepHertz Newsroom
800+ APIs. 25+ Modules. 16 SDKs.Real-time Actionable Analytics. 1 Platform.
Acquire. Engage. Retain. Convert.
Comprehensive Solution to Securely Expose Protected Resources as APIs
Real Time & Turn Based MultiplayerGaming Platform With Game Mechanics.
Develop > Deploy > launch > Scale > Monitor
Continuous Integration & Delivery
Customers Want A 360 °Omni-Channel Retail Experience.
Seamless & ConnectedOmni-Channel Experience Delivered.
Plethora of Games are LaunchedEvery Day. Don't Let Yours Die.
Leverage User Data to DeliverPersonalized Content Across Channels
Inspire Wanderlust in theCustomers with Omni-Channel Experience
800+ APIs. 25+ Modules. 16 SDKs. Real-time Actionable Analytics. 1 Platform.
Real Time & Turn Based Multiplayer Gaming Platform With Game Mechanics.
Forum
Hello,
You can easily achieve this by first finding the rank of user in the leader-board by GetUserRanking method. After that you can find the TopNRankers in the game using page offset and max result parameter as described below. Here page offset would be UserRank -N/2, and max result would be N. This will give the rankings of user who are N/2 above user and N/2 below user ranking.
String gameName = "<Enter_your_game_name>"; int max = 10; //Max result in leaderboard // Page offset is from where you need to fetch the records. //Lets say user has rank as 15 and you are looking 5 users above and below from this user. Offset would be in this case 15-10/2=10 (UserRank –N/2) scoreBoardService.setPageOffset(10); scoreBoardService.getTopNRankers(gameName, max, new App42CallBack() { public void onSuccess(Object response) { Game game = (Game)response; System.out.println("Game Name is : "+game.getName()); for(int i = 0;i<game.getScoreList().size();i++) { System.out.println("userName is : " + game.getScoreList().get(i).getUserName()); System.out.println("score is : " + game.getScoreList().get(i).getValue()); System.out.println("Created On is :"+game.getScoreList().get(i).getCreatedOn()); System.out.println("scoreId is : " + game.getScoreList().get(i).getScoreId()); } } public void onException(Exception ex) { System.out.println("Exception Message"+ex.getMessage()); } }); Let us know if it helps. Thanks, Himanshu Sharma
String gameName = "<Enter_your_game_name>";
int max = 10; //Max result in leaderboard
// Page offset is from where you need to fetch the records.
//Lets say user has rank as 15 and you are looking 5 users above and below from this user. Offset would be in this case 15-10/2=10 (UserRank –N/2)
scoreBoardService.setPageOffset(10);
scoreBoardService.getTopNRankers(gameName, max, new App42CallBack() {
public void onSuccess(Object response)
{
Game game = (Game)response;
System.out.println("Game Name is : "+game.getName());
for(int i = 0;i<game.getScoreList().size();i++)
System.out.println("userName is : " + game.getScoreList().get(i).getUserName());
System.out.println("score is : " + game.getScoreList().get(i).getValue());
System.out.println("Created On is :"+game.getScoreList().get(i).getCreatedOn());
System.out.println("scoreId is : " + game.getScoreList().get(i).getScoreId());
}
public void onException(Exception ex)
System.out.println("Exception Message"+ex.getMessage());
});
Let us know if it helps.
Thanks,
Himanshu Sharma