void ScoreLoopThread::LoadLeaderboard(AppData_t *app, SC_ScoresSearchList_t searchList, unsigned int count) { /* Create a ScoresController */ SC_Error_t rc = SC_Client_CreateScoresController(app->client, &app->scoresController, LoadLeaderboardCompletionCallback, app); if (rc != SC_OK) { HandleError(app, rc); return; } /* Configure the Controller */ rc = SC_ScoresController_SetSearchList(app->scoresController, searchList); if (rc != SC_OK) { SC_ScoresController_Release(app->scoresController); /* Cleanup Controller */ HandleError(app, rc); return; } SC_Range_t range; range.offset = 0; range.length = count; /* Load the Leaderboard for the given score and count */ rc = SC_ScoresController_LoadScores(app->scoresController, range); if (rc != SC_OK) { SC_ScoresController_Release(app->scoresController); /* Cleanup Controller */ HandleError(app, rc); return; } qDebug() << "Loading Leaderboard..."; }
FREObject loadScores(FREContext ctx, void* functionData, uint32_t argc, FREObject argv[]) { FREObject start=0,length=0; int aStart=0,aLength=0; FREGetObjectProperty(argv[0],(const uint8_t*)"start",start,NULL); FREGetObjectProperty(argv[0],(const uint8_t*)"length",length,NULL); FREGetObjectAsInt32(start,&aStart); FREGetObjectAsInt32(length,&aLength); #if defined(BB10) SC_Range_t aRange = {aStart,aLength}; SC_ScoresController_LoadScores(scores_controller,aRange); // TODO: This is different in bb10, there is a range object #else SC_ScoresController_LoadRange(scores_controller,aStart,aLength); #endif return NULL; }