void ScoreLoopThread::LoadLeaderboardAroundScore(AppData_t *app, SC_Score_h score, 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 */
	SC_ScoresController_SetMode(app->scoresController, SC_Score_GetMode(score));
	rc = SC_ScoresController_SetSearchList(app->scoresController, searchList);
	if (rc != SC_OK) {
		SC_ScoresController_Release(app->scoresController); /* Cleanup Controller */
		HandleError(app, rc);
		return;
	}

	/* Load the Leaderboard for the given score and count */
	rc = SC_ScoresController_LoadScoresAroundScore(app->scoresController, score, count);
	if (rc != SC_OK) {
		SC_ScoresController_Release(app->scoresController); /* Cleanup Controller */
		HandleError(app, rc);
		return;
	}
	qDebug() << "Loading Leaderboard...";
}
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...";
}
Esempio n. 3
0
CScores::CScores(): CBaseScene()
{
	m_listview = 0;

	// Creating Scoreloop Controllers
	SC_Error_t retCode = SC_Client_CreateScoresController(g_client, &m_scoresController,
														  ScoresControllerCallback, this);
	if (retCode != SC_OK) {
		m_scoresController = NULL;
		s3eDebugAssertShow(S3E_MESSAGE_CONTINUE_STOP, "Failed to create SC_ScoresController");
	}
	SC_Client_CreateScoreController(g_client, &m_scoreController,
											  ScoreControllerCallbackSubmit, this);
	if (retCode != SC_OK) {
		m_scoreController = NULL;
		s3eDebugAssertShow(S3E_MESSAGE_CONTINUE_STOP, "Failed to create SC_ScoreController");
	}

	SC_Client_CreateRankingController(g_client, &m_rankingController,
											  RankingControllerCallback, this);
	if (retCode != SC_OK) {
		m_rankingController = NULL;
		s3eDebugAssertShow(S3E_MESSAGE_CONTINUE_STOP, "Failed to create SC_RankingController");


	}

	SC_Client_CreateUserController(g_client, &m_userController,
											  UserControllerCallback, this);
	if (retCode != SC_OK) {
		m_userController = NULL;
		s3eDebugAssertShow(S3E_MESSAGE_CONTINUE_STOP, "Failed to create SC_UserController");


	}
}
FREObject initScoresController(FREContext ctx, void* functionData, uint32_t argc, FREObject argv[])
{
	SC_Client_CreateScoresController (client, &scores_controller, scoresControllerCallback, NULL);
	return NULL;
}