Skip to main content

Client Leaderboard API Reference

Nowadays, the leaderboard is almost an essential feature for online games. By displaying the Leaderboard and player ranking details, you can create a great competitive atmosphere for the players.

API List

APIDescription
GetRankingListQuery the current ranking list of the specified leaderboard.
GetRankingItemPosQuery the current ranking list item with neighbor items of the specified leaderboard.
GetFriendsRankingListQuery the current friends ranking list of the specified leaderboard. The leaderboard's stat item key should be filled with player id.

API Details

GetRankingList

Query the current ranking list of the specified leaderboard.

/**
* Query the current ranking list of the specified leaderboard.
*
* @param params Request structure for querying the current ranking list.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetRankingList(
const GetRankingListParams& params,
PgosDataCallback<LBRankingListResult> result_callback);

Parameters:

ParamTypeDescription
paramsconst GetRankingListParams&Request structure for querying the current ranking list.
result_callbackPgosDataCallback<LBRankingListResult>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetRankingItemPos

Query the current ranking list item with neighbor items of the specified leaderboard.

/**
* Query the current ranking list item with neighbor items of the specified leaderboard.
*
* @param params Request structure for querying the current ranking list item with neighbor items.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetRankingItemPos(
const GetRankingItemPosParams& params,
PgosDataCallback<LBRankingItemPos> result_callback);

Parameters:

ParamTypeDescription
paramsconst GetRankingItemPosParams&Request structure for querying the current ranking list item with neighbor items.
result_callbackPgosDataCallback<LBRankingItemPos>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetFriendsRankingList

Query the current friends ranking list of the specified leaderboard. The leaderboard's stat item key should be filled with player id.

/**
* Query the current friends ranking list of the specified leaderboard. The leaderboard's stat item key should be filled with player id.
*
* @param params Request structure for querying the current friends ranking list.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetFriendsRankingList(
const GetFriendsRankingListParams& params,
PgosDataCallback<LBFriendsRankingListResult> result_callback);

Parameters:

ParamTypeDescription
paramsconst GetFriendsRankingListParams&Request structure for querying the current friends ranking list.
result_callbackPgosDataCallback<LBFriendsRankingListResult>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void