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
| API | Description |
|---|---|
| GetRankingList | Query the current ranking list of the specified leaderboard. |
| GetRankingItemPos | Query the current ranking list item with neighbor items of the specified leaderboard. |
| GetFriendsRankingList | Query 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:
| Param | Type | Description |
|---|---|---|
| params | const GetRankingListParams& | Request structure for querying the current ranking list. |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| params | const GetRankingItemPosParams& | Request structure for querying the current ranking list item with neighbor items. |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| params | const GetFriendsRankingListParams& | Request structure for querying the current friends ranking list. |
| result_callback | PgosDataCallback<LBFriendsRankingListResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void