跳到主要内容

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 result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetStatPersistentInfo(
const GetStatPersistentInfoParams& params,
PgosDataCallback<StatItem> result_callback);

Parameters:

ParamTypeDescription
paramsconst GetStatPersistentInfoParams&Request structure for querying persistent info.
result_callbackPgosDataCallback<StatItem>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

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 result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchGetStatPersistentInfo(
const BatchGetStatPersistentInfoParams& params,
PgosDataCallback<BatchGetStatPersistentInfoResult> result_callback);

Parameters:

ParamTypeDescription
paramsconst BatchGetStatPersistentInfoParams&Request structure for querying item persistent infos.
result_callbackPgosDataCallback<BatchGetStatPersistentInfoResult>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

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 result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetStatCycleInfo(
const GetStatCycleInfoParams& params,
PgosDataCallback<GetStatCycleInfoResult> result_callback);

Parameters:

ParamTypeDescription
paramsconst GetStatCycleInfoParams&Request structure for querying the cycle info.
result_callbackPgosDataCallback<GetStatCycleInfoResult>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

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 result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchGetStatCycleInfo(
const BatchGetStatCycleInfoParams& params,
PgosDataCallback<BatchGetStatCycleInfoResult> result_callback);

Parameters:

ParamTypeDescription
paramsconst BatchGetStatCycleInfoParams&Request structure for querying item cycle infos.
result_callbackPgosDataCallback<BatchGetStatCycleInfoResult>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

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 result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchGetStatCycleRoundInfo(
const BatchGetStatCycleRoundInfoParams& params,
PgosDataCallback<BatchGetStatCycleRoundInfoResult> result_callback);

Parameters:

ParamTypeDescription
paramsconst BatchGetStatCycleRoundInfoParams&Request structure for querying current round infos.
result_callbackPgosDataCallback<BatchGetStatCycleRoundInfoResult>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void