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
| API | Description |
|---|---|
| GetStatPersistentInfo | Query the persistent info of the specified stat item. |
| 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. |
| GetStatCycleInfo | Query the cycle info of the specified stat item for the current cycle round. |
| 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. |
| BatchGetStatCycleRoundInfo | Query 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:
| Param | Type | Description |
|---|---|---|
| params | const GetStatPersistentInfoParams& | Request structure for querying persistent info. |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| params | const BatchGetStatPersistentInfoParams& | Request structure for querying item persistent infos. |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| params | const GetStatCycleInfoParams& | Request structure for querying the cycle info. |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| params | const BatchGetStatCycleInfoParams& | Request structure for querying item cycle infos. |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| params | const BatchGetStatCycleRoundInfoParams& | Request structure for querying current round infos. |
| result_callback | PgosDataCallback<BatchGetStatCycleRoundInfoResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void