跳到主要内容

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 ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetRankingList(
const FPgosClientGetRankingListParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientLBRankingListResult* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
Paramsconst FPgosClientGetRankingListParams&Request structure for querying the current ranking list.
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientLBRankingListResult* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

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 ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetRankingItemPos(
const FPgosClientGetRankingItemPosParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientLBRankingItemPos* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
Paramsconst FPgosClientGetRankingItemPosParams&Request structure for querying the current ranking list item with neighbor items.
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientLBRankingItemPos* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

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 ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetFriendsRankingList(
const FPgosClientGetFriendsRankingListParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientLBFriendsRankingListResult* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
Paramsconst FPgosClientGetFriendsRankingListParams&Request structure for querying the current friends ranking list.
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientLBFriendsRankingListResult* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void