跳到主要内容

Client Statistics API Reference

Statistics is a service that helps you to store and track player or global statistics. By default, Statistics is also a major data source of the Leaderboard service.

API List

APIDescription
GetStatPersistentInfoQuery the persistent info of the specified stat item.
BatchGetStatPersistentInfoQuery item persistent infos with specified stat names and keys in batches. (max 100 stats) For example: stat_names=["s1", "s2"], keys=["k1", "k2"], then you will get a batch of items:[("s1", "k1"), ("s1", "k2"), "s2", "k1"), ("s2", "k2")] It will ignore non-existing (stat_name + key) combination items.
GetStatCycleInfoQuery the cycle info of the specified stat item for the current cycle round.
BatchGetStatCycleInfoQuery cycle infos with specified stat names and keys for the current cycle round in batches. (max 100 stats) For example: stat_names=["s1", "s2"], keys=["k1", "k2"], then you will get a batch of items:[("s1", "k1"), ("s1", "k2"), "s2", "k1"), ("s2", "k2")] It will ignore non-existing (stat_name + key) combination items.
BatchGetStatCycleRoundInfoQuery the current round infos of cycles in batches. (max 100 cycles)

API Details

GetStatPersistentInfo

Query the persistent info of the specified stat item.

/**
* Query the persistent info of the specified stat item.
*
* @param Params Request structure for querying persistent info.
* @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 GetStatPersistentInfo(
const FPgosGetStatPersistentInfoParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosStatItem* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
Paramsconst FPgosGetStatPersistentInfoParams&Request structure for querying persistent info.
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosStatItem* 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

BatchGetStatPersistentInfo

Query item persistent infos with specified stat names and keys in batches. (max 100 stats) For example: stat_names=["s1", "s2"], keys=["k1", "k2"], then you will get a batch of items:[("s1", "k1"), ("s1", "k2"), "s2", "k1"), ("s2", "k2")] It will ignore non-existing (stat_name + key) combination items.

/**
* Query item persistent infos with specified stat names and keys in batches. (max 100 stats)
* For example: stat_names=["s1", "s2"], keys=["k1", "k2"],
* then you will get a batch of items:[("s1", "k1"), ("s1", "k2"), "s2", "k1"), ("s2", "k2")]
* It will ignore non-existing (stat_name + key) combination items.
*
* @param Params Request structure for querying item persistent infos.
* @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 BatchGetStatPersistentInfo(
const FPgosBatchGetStatPersistentInfoParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosBatchGetStatPersistentInfoResult* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
Paramsconst FPgosBatchGetStatPersistentInfoParams&Request structure for querying item persistent infos.
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosBatchGetStatPersistentInfoResult* 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

GetStatCycleInfo

Query the cycle info of the specified stat item for the current cycle round.

/**
* Query the cycle info of the specified stat item for the current cycle round.
*
* @param Params Request structure for querying the cycle info.
* @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 GetStatCycleInfo(
const FPgosGetStatCycleInfoParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosGetStatCycleInfoResult* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
Paramsconst FPgosGetStatCycleInfoParams&Request structure for querying the cycle info.
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosGetStatCycleInfoResult* 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

BatchGetStatCycleInfo

Query cycle infos with specified stat names and keys for the current cycle round in batches. (max 100 stats) For example: stat_names=["s1", "s2"], keys=["k1", "k2"], then you will get a batch of items:[("s1", "k1"), ("s1", "k2"), "s2", "k1"), ("s2", "k2")] It will ignore non-existing (stat_name + key) combination items.

/**
* Query cycle infos with specified stat names and keys for the current cycle round in batches. (max 100 stats)
* For example: stat_names=["s1", "s2"], keys=["k1", "k2"],
* then you will get a batch of items:[("s1", "k1"), ("s1", "k2"), "s2", "k1"), ("s2", "k2")]
* It will ignore non-existing (stat_name + key) combination items.
*
* @param Params Request structure for querying item cycle infos.
* @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 BatchGetStatCycleInfo(
const FPgosBatchGetStatCycleInfoParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosBatchGetStatCycleInfoResult* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
Paramsconst FPgosBatchGetStatCycleInfoParams&Request structure for querying item cycle infos.
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosBatchGetStatCycleInfoResult* 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

BatchGetStatCycleRoundInfo

Query the current round infos of cycles in batches. (max 100 cycles)

/**
* Query the current round infos of cycles in batches. (max 100 cycles)
*
* @param Params Request structure for querying current round infos.
* @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 BatchGetStatCycleRoundInfo(
const FPgosBatchGetStatCycleRoundInfoParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosBatchGetStatCycleRoundInfoResult* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
Paramsconst FPgosBatchGetStatCycleRoundInfoParams&Request structure for querying current round infos.
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosBatchGetStatCycleRoundInfoResult* 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