How to get more than 100 results from leaderbord

0 votes

Hi, I'm using this snippet for fetching results from Leaderbord:

$otherMetaHeaders = array(); 
$otherMetaHeaders['offset'] =1;
$scoreBoardService->setOtherMetaHeaders($otherMetaHeaders);
 
But I still get same 100 results as without it. below you can see my code, probably I put this snippet in wrong place? I made some changes in the core function getTopRankings in library to check the $otherMetaHeaders['offset']. It seems it changes. Without snippet it is -1 with snippet it is 100. But I still get same results in $game->getScoreList()
 
Help me please
My code:
 
            App42API::initialize(API_KEY,SECRET_KEY);
            $scoreBoardService = App42API::buildScoreBoardService();
            $results = [];
 
            $otherMetaHeaders = [];
            $otherMetaHeaders['offset'] = 100;
            $scoreBoardService->setOtherMetaHeaders($otherMetaHeaders);
 
            $game = $scoreBoardService->getTopRankings($gameName);
 
            $results = $game->getScoreList();
 
 
 
            echo "<pre>";
            print_r($results);
            echo "<pre>";

 

asked Nov 22, 2017 in PHP by tomislav (17 points)

1 Answer

+1 vote
Hi Tom,

 

Apologies for getting late back to you. Please use GetTopNrankings method instead of GetTopRankings, it will help you to find records more than 100. Let me know if you still face any issue.

 

Regards.

Himanshu Sharma
answered Nov 27, 2017 by hs00105 (2,005 points)
Thanks, that worked for me
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
...