Server PlayerProfile API Reference
Player Info is the core attribute collection used to describe a player.
API List
| API | Description |
|---|---|
| GetPlayerInfo | Query a player's detail info. |
| BatchGetPlayerInfo | Perform a batch query of player info for multiple players (max 100 players). If all player operations are successful, the callback result is success. If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data. If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data. |
| GetOneOfPlayerKVData | Query the specified kvdata of the specified player. |
| GetPlayerKVData | Query certain kvdata of the specified player. |
| BatchGetPlayerKVData | Perform a batch query of KVData for multiple players (max 100 players). If all player operations are successful, the callback result is success. If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data. If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data. |
| GetPlayerGroupKVData | Query the specified group kvdata of the specified player. |
| BatchGetPlayerGroupKVData | Perform a batch query of the specified group KVData for multiple players (max 100 players). If all player operations are successful, the callback result is success. If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data. If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data. |
| SetOneOfPlayerKVData | Update the specified kvdata of the specified player. |
| SetPlayerKVData | Update kvdata of the specified player. The update operation for a player's KVData will either succeed as a whole or fail as a whole. |
| BatchSetPlayerKVData | Perform a batch update of KVData for multiple players (max 100 players). If all player operations are successful, the callback result is success. If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data. If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data. The update operation for a player's KVData will either succeed as a whole or fail as a whole. |
| IncrOneOfPlayerKVData | Perform atomic increment operation on a specified kvdata item for a specified player. [Only works on Integer/Float type keys] If the operation is successful, the callback will return the updated data. |
| BatchIncrOneOfPlayerKVData | Perform a batch atomic increment operation on a specified kvdata item for multiple players (max 100 players). [Only works on Integer/Float type keys] If all player operations are successful, the callback result is success. If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data. If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data. For the players whose operations are successful, the callback data will contain the new value of their updated kvdata item. The update operation for a player's KVData will either succeed as a whole or fail as a whole. |
| IncrPlayerKVData | Perform atomic increment operation on multiple kvdata items for a specified player. [Only works on Integer/Float type keys] If the operation is successful, the callback will return the updated data. |
| BatchIncrPlayerKVData | Perform a batch atomic increment operation on multiple kvdata items for multiple players (max 100 players). [Only works on Integer/Float type keys] If all player operations are successful, the callback result is success. If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data. If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data. For the players whose operations are successful, the callback data will contain the new value of their updated kvdata item. The update operation for a player's KVData will either succeed as a whole or fail as a whole. |
| BatchIncrPlayerKVDataIdempotent | Idempotent version of BatchIncrPlayerKVData. Idempotency token could be set for each player. |
| GetPlayerVersionedKVData | Query certain versioned kvdata of the specified player. The keys to be queried must contain at least one versioned key. Call 'GetMyKVData' or 'GetPlayerKVData' instead if you don't need to get the 'version' field, which is only needed when updating versioned KVData. |
| BatchGetPlayerVersionedKVData | Perform a batch query of versioned KVData for multiple players (max 100 players). The keys to be queried must contain at least one versioned key. Call 'BatchGetPlayerKVData' instead if you don't need to get 'version', which is only needed when updating versioned KVData. |
| SetPlayerVersionedKVData | Update versioned kvdata for the specified player. The KVData of the player to be updated must contain at least one versioned key. The 'version' needs to pass in can be obtained from the 'GetPlayerVersionedKVData' or 'BatchGetPlayerVersionedKVData' API call. If the 'version' passed in is the latest, the callback will return success along with the updated data. If the 'version' passed in is not the latest, the callback will return failure(err_code=11108, kBackendKVDataVersionMismatched (11108)) along with the current latest data, you may try again with the latest version. For other errors, please refer to the error message and the developer manual on the portal, and the callback data is invalid. |
| BatchSetPlayerVersionedKVData | Perform a batch update of versioned KVData for multiple players (max 100 players). The KVData of the player to be updated must contain at least one versioned key. The 'version' needs to pass in can be obtained from the 'GetPlayerVersionedKVData' or 'BatchGetPlayerVersionedKVData' API call. If all player operations are successful, the callback result is success. If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data. If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data. The update operation for a player's KVData will either succeed as a whole or fail as a whole. |
| BatchOpenIDToPlayerID | Batch transform playerID of PGOS to account openID of external platform. (max 100 OpenIDs) |
API Details
GetPlayerInfo
Query a player's detail info.
/**
* Query a player's detail info.
*
* @param player_id The player to query.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetPlayerInfo(
const pgos::pstring& player_id,
PgosDataCallback<PlayerDetail> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_id | const std::string& | The player to query. |
| result_callback | PgosDataCallback<PlayerDetail> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchGetPlayerInfo
Perform a batch query of player info for multiple players (max 100 players). If all player operations are successful, the callback result is success. If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data. If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data.
/**
* Perform a batch query of player info for multiple players (max 100 players).
* If all player operations are successful, the callback result is success.
* If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data.
* If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data.
*
* @param player_ids The players to query.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchGetPlayerInfo(
const pgos::pvector<pgos::pstring>& player_ids,
PgosDataCallback<BatchGetPlayerInfoSvrRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_ids | const std::vector<std::string>& | The players to query. |
| result_callback | PgosDataCallback<BatchGetPlayerInfoSvrRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
GetOneOfPlayerKVData
Query the specified kvdata of the specified player.
/**
* Query the specified kvdata of the specified player.
*
* @param player_id The player to query.
* @param query_key The key to query.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetOneOfPlayerKVData(
const pgos::pstring& player_id,
const pgos::pstring& query_key,
PgosDataCallback<OnePlayerKVData> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_id | const std::string& | The player to query. |
| query_key | const std::string& | The key to query. |
| result_callback | PgosDataCallback<OnePlayerKVData> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
GetPlayerKVData
Query certain kvdata of the specified player.
/**
* Query certain kvdata of the specified player.
*
* @param player_id The player to query.
* @param query_keys Keys to query.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetPlayerKVData(
const pgos::pstring& player_id,
const pgos::pvector<pgos::pstring>& query_keys,
PgosDataCallback<PlayerKVDataGroupWithFails> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_id | const std::string& | The player to query. |
| query_keys | const std::vector<std::string>& | Keys to query. |
| result_callback | PgosDataCallback<PlayerKVDataGroupWithFails> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchGetPlayerKVData
Perform a batch query of KVData for multiple players (max 100 players). If all player operations are successful, the callback result is success. If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data. If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data.
/**
* Perform a batch query of KVData for multiple players (max 100 players).
* If all player operations are successful, the callback result is success.
* If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data.
* If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data.
*
* @param player_ids Players to query.
* @param query_keys Keys to query.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchGetPlayerKVData(
const pgos::pvector<pgos::pstring>& player_ids,
const pgos::pvector<pgos::pstring>& query_keys,
PgosDataCallback<BatchPlayerKVDataGroupWithFails> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_ids | const std::vector<std::string>& | Players to query. |
| query_keys | const std::vector<std::string>& | Keys to query. |
| result_callback | PgosDataCallback<BatchPlayerKVDataGroupWithFails> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
GetPlayerGroupKVData
Query the specified group kvdata of the specified player.
/**
* Query the specified group kvdata of the specified player.
*
* @param player_id Player to query.
* @param group_name Name of the specified group.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetPlayerGroupKVData(
const pgos::pstring& player_id,
const pgos::pstring& group_name,
PgosDataCallback<PlayerKVDataGroup> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_id | const std::string& | Player to query. |
| group_name | const std::string& | Name of the specified group. |
| result_callback | PgosDataCallback<PlayerKVDataGroup> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchGetPlayerGroupKVData
Perform a batch query of the specified group KVData for multiple players (max 100 players). If all player operations are successful, the callback result is success. If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data. If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data.
/**
* Perform a batch query of the specified group KVData for multiple players (max 100 players).
* If all player operations are successful, the callback result is success.
* If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data.
* If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data.
*
* @param player_ids Players to query.
* @param group_name Name of the specified group.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchGetPlayerGroupKVData(
const pgos::pvector<pgos::pstring>& player_ids,
const pgos::pstring& group_name,
PgosDataCallback<BatchPlayerKVDataGroup> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_ids | const std::vector<std::string>& | Players to query. |
| group_name | const std::string& | Name of the specified group. |
| result_callback | PgosDataCallback<BatchPlayerKVDataGroup> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SetOneOfPlayerKVData
Update the specified kvdata of the specified player.
/**
* Update the specified kvdata of the specified player.
*
* @param player_id Player to query.
* @param key Key to update
* @param value The new value can be set to string/int32/int64/float/double.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetOneOfPlayerKVData(
const pgos::pstring& player_id,
const pgos::pstring& key,
const KVDataValue& value,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_id | const std::string& | Player to query. |
| key | const std::string& | Key to update |
| value | const KVDataValue& | The new value can be set to string/int32/int64/float/double. |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SetPlayerKVData
Update kvdata of the specified player. The update operation for a player's KVData will either succeed as a whole or fail as a whole.
/**
* Update kvdata of the specified player.
* The update operation for a player's KVData will either succeed as a whole or fail as a whole.
*
* @param player_id Player to update kvdata.
* @param kvdata KVData to update.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetPlayerKVData(
const pgos::pstring& player_id,
const pgos::pmap<pgos::pstring, KVDataValue>& kvdata,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_id | const std::string& | Player to update kvdata. |
| kvdata | const std::map<std::string, KVDataValue>& | KVData to update. |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchSetPlayerKVData
Perform a batch update of KVData for multiple players (max 100 players). If all player operations are successful, the callback result is success. If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data. If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data. The update operation for a player's KVData will either succeed as a whole or fail as a whole.
/**
* Perform a batch update of KVData for multiple players (max 100 players).
* If all player operations are successful, the callback result is success.
* If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data.
* If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data.
* The update operation for a player's KVData will either succeed as a whole or fail as a whole.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchSetPlayerKVData(
const pgos::pvector<PlayerKVDataGroup>& kvdatas,
PgosDataCallback<BatchPlayerOperationResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| kvdatas | const std::vector<PlayerKVDataGroup>& | |
| result_callback | PgosDataCallback<BatchPlayerOperationResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
IncrOneOfPlayerKVData
Perform atomic increment operation on a specified kvdata item for a specified player. [Only works on Integer/Float type keys] If the operation is successful, the callback will return the updated data.
/**
* Perform atomic increment operation on a specified kvdata item for a specified player. [Only works on Integer/Float type keys]
* If the operation is successful, the callback will return the updated data.
*
* @param player_id Player to operate.
* @param key Key to operate.
* @param increment The increment value can be set to int32/int64/float/double.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void IncrOneOfPlayerKVData(
const pgos::pstring& player_id,
const pgos::pstring& key,
const KVDataValue& increment,
PgosDataCallback<OnePlayerKVData> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_id | const std::string& | Player to operate. |
| key | const std::string& | Key to operate. |
| increment | const KVDataValue& | The increment value can be set to int32/int64/float/double. |
| result_callback | PgosDataCallback<OnePlayerKVData> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchIncrOneOfPlayerKVData
Perform a batch atomic increment operation on a specified kvdata item for multiple players (max 100 players). [Only works on Integer/Float type keys] If all player operations are successful, the callback result is success. If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data. If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data. For the players whose operations are successful, the callback data will contain the new value of their updated kvdata item. The update operation for a player's KVData will either succeed as a whole or fail as a whole.
/**
* Perform a batch atomic increment operation on a specified kvdata item for multiple players (max 100 players). [Only works on Integer/Float type keys]
* If all player operations are successful, the callback result is success.
* If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data.
* If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data.
* For the players whose operations are successful, the callback data will contain the new value of their updated kvdata item.
* The update operation for a player's KVData will either succeed as a whole or fail as a whole.
*
* @param player_ids Players to operate.
* @param key Key to operate.
* @param increment The increment value can be set to int32/int64/float/double.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchIncrOneOfPlayerKVData(
const pgos::pvector<pgos::pstring>& player_ids,
const pgos::pstring& key,
const KVDataValue& increment,
PgosDataCallback<BatchIncrOneOfPlayerKVDataRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_ids | const std::vector<std::string>& | Players to operate. |
| key | const std::string& | Key to operate. |
| increment | const KVDataValue& | The increment value can be set to int32/int64/float/double. |
| result_callback | PgosDataCallback<BatchIncrOneOfPlayerKVDataRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
IncrPlayerKVData
Perform atomic increment operation on multiple kvdata items for a specified player. [Only works on Integer/Float type keys] If the operation is successful, the callback will return the updated data.
/**
* Perform atomic increment operation on multiple kvdata items for a specified player. [Only works on Integer/Float type keys]
* If the operation is successful, the callback will return the updated data.
*
* @param player_id Player to operate.
* @param increments Increments to update, key: kvdata key, value: increment of the value.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void IncrPlayerKVData(
const pgos::pstring& player_id,
const pgos::pmap<pgos::pstring, KVDataValue>& increments,
PgosDataCallback<PlayerKVDataGroup> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_id | const std::string& | Player to operate. |
| increments | const std::map<std::string, KVDataValue>& | Increments to update, key: kvdata key, value: increment of the value. |
| result_callback | PgosDataCallback<PlayerKVDataGroup> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchIncrPlayerKVData
Perform a batch atomic increment operation on multiple kvdata items for multiple players (max 100 players). [Only works on Integer/Float type keys] If all player operations are successful, the callback result is success. If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data. If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data. For the players whose operations are successful, the callback data will contain the new value of their updated kvdata item. The update operation for a player's KVData will either succeed as a whole or fail as a whole.
/**
* Perform a batch atomic increment operation on multiple kvdata items for multiple players (max 100 players). [Only works on Integer/Float type keys]
* If all player operations are successful, the callback result is success.
* If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data.
* If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data.
* For the players whose operations are successful, the callback data will contain the new value of their updated kvdata item.
* The update operation for a player's KVData will either succeed as a whole or fail as a whole.
*
* @param increments Player kvdata increments list.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchIncrPlayerKVData(
const pgos::pvector<PlayerKVDataGroup>& increments,
PgosDataCallback<BatchPlayerKVDataGroup> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| increments | const std::vector<PlayerKVDataGroup>& | Player kvdata increments list. |
| result_callback | PgosDataCallback<BatchPlayerKVDataGroup> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchIncrPlayerKVDataIdempotent
Idempotent version of BatchIncrPlayerKVData. Idempotency token could be set for each player.
/**
* Idempotent version of BatchIncrPlayerKVData. Idempotency token could be set for each player.
*
* @param params Params of BatchIncrPlayerKVDataIdempotent.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchIncrPlayerKVDataIdempotent(
const BatchIncrPlayerKVDataIdempotentParams& params,
PgosDataCallback<BatchIncrPlayerKVDataIdempotentResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const BatchIncrPlayerKVDataIdempotentParams& | Params of BatchIncrPlayerKVDataIdempotent. |
| result_callback | PgosDataCallback<BatchIncrPlayerKVDataIdempotentResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
GetPlayerVersionedKVData
Query certain versioned kvdata of the specified player. The keys to be queried must contain at least one versioned key. Call 'GetMyKVData' or 'GetPlayerKVData' instead if you don't need to get the 'version' field, which is only needed when updating versioned KVData.
/**
* Query certain versioned kvdata of the specified player.
* The keys to be queried must contain at least one versioned key.
* Call 'GetMyKVData' or 'GetPlayerKVData' instead if you don't need to get the 'version' field, which is only needed when updating versioned KVData.
*
* @param player_id The player to query.
* @param query_keys Keys to query.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetPlayerVersionedKVData(
const pgos::pstring& player_id,
const pgos::pvector<pgos::pstring>& query_keys,
PgosDataCallback<PlayerKVDataGroupWithVerAndFails> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_id | const std::string& | The player to query. |
| query_keys | const std::vector<std::string>& | Keys to query. |
| result_callback | PgosDataCallback<PlayerKVDataGroupWithVerAndFails> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchGetPlayerVersionedKVData
Perform a batch query of versioned KVData for multiple players (max 100 players). The keys to be queried must contain at least one versioned key. Call 'BatchGetPlayerKVData' instead if you don't need to get 'version', which is only needed when updating versioned KVData.
/**
* Perform a batch query of versioned KVData for multiple players (max 100 players).
* The keys to be queried must contain at least one versioned key.
* Call 'BatchGetPlayerKVData' instead if you don't need to get 'version', which is only needed when updating versioned KVData.
*
* @param player_ids Players to query.
* @param query_keys Keys to query.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchGetPlayerVersionedKVData(
const pgos::pvector<pgos::pstring>& player_ids,
const pgos::pvector<pgos::pstring>& query_keys,
PgosDataCallback<BatchPlayerKVDataGroupWithVerAndFails> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_ids | const std::vector<std::string>& | Players to query. |
| query_keys | const std::vector<std::string>& | Keys to query. |
| result_callback | PgosDataCallback<BatchPlayerKVDataGroupWithVerAndFails> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SetPlayerVersionedKVData
Update versioned kvdata for the specified player. The KVData of the player to be updated must contain at least one versioned key. The 'version' needs to pass in can be obtained from the 'GetPlayerVersionedKVData' or 'BatchGetPlayerVersionedKVData' API call. If the 'version' passed in is the latest, the callback will return success along with the updated data. If the 'version' passed in is not the latest, the callback will return failure(err_code=11108, kBackendKVDataVersionMismatched (11108)) along with the current latest data, you may try again with the latest version. For other errors, please refer to the error message and the developer manual on the portal, and the callback data is invalid.
/**
* Update versioned kvdata for the specified player.
* The KVData of the player to be updated must contain at least one versioned key.
* The 'version' needs to pass in can be obtained from the 'GetPlayerVersionedKVData' or 'BatchGetPlayerVersionedKVData' API call.
* If the 'version' passed in is the latest, the callback will return success along with the updated data.
* If the 'version' passed in is not the latest, the callback will return failure(err_code=11108, kBackendKVDataVersionMismatched (11108)) along with the current latest data, you may try again with the latest version.
* For other errors, please refer to the error message and the developer manual on the portal, and the callback data is invalid.
*
* @param data Versioned kvdata items that need to update. Please set version to the latest value you got for the player.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetPlayerVersionedKVData(
const PlayerKVDataGroupWithVer& data,
PgosDataCallback<PlayerKVDataGroupWithVer> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| data | const PlayerKVDataGroupWithVer& | Versioned kvdata items that need to update. Please set version to the latest value you got for the player. |
| result_callback | PgosDataCallback<PlayerKVDataGroupWithVer> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchSetPlayerVersionedKVData
Perform a batch update of versioned KVData for multiple players (max 100 players). The KVData of the player to be updated must contain at least one versioned key. The 'version' needs to pass in can be obtained from the 'GetPlayerVersionedKVData' or 'BatchGetPlayerVersionedKVData' API call. If all player operations are successful, the callback result is success. If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data. If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data. The update operation for a player's KVData will either succeed as a whole or fail as a whole.
/**
* Perform a batch update of versioned KVData for multiple players (max 100 players).
* The KVData of the player to be updated must contain at least one versioned key.
* The 'version' needs to pass in can be obtained from the 'GetPlayerVersionedKVData' or 'BatchGetPlayerVersionedKVData' API call.
* If all player operations are successful, the callback result is success.
* If some player operations succeed while others fail, the callback result is success, and the reasons for the failed players can be obtained from the callback data.
* If all player operations fail, the callback result is failure (kBackendAllFailed (14)), and the reasons for the failed players can be obtained from the callback data.
* The update operation for a player's KVData will either succeed as a whole or fail as a whole.
*
* @param data Versioned kvdata items that need to update. Please set version to the latest value you got for the player.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchSetPlayerVersionedKVData(
const pgos::pvector<PlayerKVDataGroupWithVer>& data,
PgosDataCallback<BatchSetPlayerVersionedKVDataRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| data | const std::vector<PlayerKVDataGroupWithVer>& | Versioned kvdata items that need to update. Please set version to the latest value you got for the player. |
| result_callback | PgosDataCallback<BatchSetPlayerVersionedKVDataRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchOpenIDToPlayerID
Batch transform playerID of PGOS to account openID of external platform. (max 100 OpenIDs)
/**
* Batch transform playerID of PGOS to account openID of external platform. (max 100 OpenIDs)
*
* @param account_provider Account service provider: 0 means FAS, 1 means INTL, 2 means MSDK, 3 means WeGame.
* @param account_open_ids Account openIDs of external platform.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchOpenIDToPlayerID(
int32_t account_provider,
const pgos::pvector<pgos::pstring>& account_open_ids,
PgosDataCallback<BatchOpenIDToPlayerIDRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| account_provider | int32_t | Account service provider: 0 means FAS, 1 means INTL, 2 means MSDK, 3 means WeGame. |
| account_open_ids | const std::vector<std::string>& | Account openIDs of external platform. |
| result_callback | PgosDataCallback<BatchOpenIDToPlayerIDRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void