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 PlayerId The player to query.
* @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 GetPlayerInfo(
const FString& PlayerId,
TFunction<void(const FPgosResult& Ret, const FPgosPlayerDetail* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerId | const FString& | The player to query. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosPlayerDetail* 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
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 PlayerIds The players to query.
* @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 BatchGetPlayerInfo(
const TArray<FString>& PlayerIds,
TFunction<void(const FPgosResult& Ret, const FPgosServerBatchGetPlayerInfoSvrRsp* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerIds | const TArray<FString>& | The players to query. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosServerBatchGetPlayerInfoSvrRsp* 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
GetOneOfPlayerKVData
Query the specified kvdata of the specified player.
/**
* Query the specified kvdata of the specified player.
*
* @param PlayerId The player to query.
* @param QueryKey The key to query.
* @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 GetOneOfPlayerKVData(
const FString& PlayerId,
const FString& QueryKey,
TFunction<void(const FPgosResult& Ret, const FPgosOnePlayerKVData* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerId | const FString& | The player to query. |
| QueryKey | const FString& | The key to query. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosOnePlayerKVData* 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
GetPlayerKVData
Query certain kvdata of the specified player.
/**
* Query certain kvdata of the specified player.
*
* @param PlayerId The player to query.
* @param QueryKeys Keys to query.
* @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 GetPlayerKVData(
const FString& PlayerId,
const TArray<FString>& QueryKeys,
TFunction<void(const FPgosResult& Ret, const FPgosPlayerKVDataGroupWithFails* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerId | const FString& | The player to query. |
| QueryKeys | const TArray<FString>& | Keys to query. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosPlayerKVDataGroupWithFails* 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
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 PlayerIds Players to query.
* @param QueryKeys Keys to query.
* @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 BatchGetPlayerKVData(
const TArray<FString>& PlayerIds,
const TArray<FString>& QueryKeys,
TFunction<void(const FPgosResult& Ret, const FPgosBatchPlayerKVDataGroupWithFails* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerIds | const TArray<FString>& | Players to query. |
| QueryKeys | const TArray<FString>& | Keys to query. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosBatchPlayerKVDataGroupWithFails* 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
GetPlayerGroupKVData
Query the specified group kvdata of the specified player.
/**
* Query the specified group kvdata of the specified player.
*
* @param PlayerId Player to query.
* @param GroupName Name of the specified group.
* @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 GetPlayerGroupKVData(
const FString& PlayerId,
const FString& GroupName,
TFunction<void(const FPgosResult& Ret, const FPgosPlayerKVDataGroup* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerId | const FString& | Player to query. |
| GroupName | const FString& | Name of the specified group. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosPlayerKVDataGroup* 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
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 PlayerIds Players to query.
* @param GroupName Name of the specified group.
* @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 BatchGetPlayerGroupKVData(
const TArray<FString>& PlayerIds,
const FString& GroupName,
TFunction<void(const FPgosResult& Ret, const FPgosBatchPlayerKVDataGroup* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerIds | const TArray<FString>& | Players to query. |
| GroupName | const FString& | Name of the specified group. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosBatchPlayerKVDataGroup* 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
SetOneOfPlayerKVData
Update the specified kvdata of the specified player.
/**
* Update the specified kvdata of the specified player.
*
* @param PlayerId Player to query.
* @param Key Key to update
* @param Value The new value can be set to string/int32/int64/float/double.
* @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 SetOneOfPlayerKVData(
const FString& PlayerId,
const FString& Key,
const FPgosKVDataValue& Value,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerId | const FString& | Player to query. |
| Key | const FString& | Key to update |
| Value | const FPgosKVDataValue& | The new value can be set to string/int32/int64/float/double. |
| ResultCallback | TFunction<void(const FPgosResult& Ret)> | 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
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 PlayerId Player to update kvdata.
* @param Kvdata KVData to update.
* @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 SetPlayerKVData(
const FString& PlayerId,
const TMap<FString, FPgosKVDataValue>& Kvdata,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerId | const FString& | Player to update kvdata. |
| Kvdata | const TMap<FString, FPgosKVDataValue>& | KVData to update. |
| ResultCallback | TFunction<void(const FPgosResult& Ret)> | 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
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 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 BatchSetPlayerKVData(
const TArray<FPgosPlayerKVDataGroup>& Kvdatas,
TFunction<void(const FPgosResult& Ret, const FPgosBatchPlayerOperationResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Kvdatas | const TArray<FPgosPlayerKVDataGroup>& | |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosBatchPlayerOperationResult* 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
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 PlayerId Player to operate.
* @param Key Key to operate.
* @param Increment The increment value can be set to int32/int64/float/double.
* @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 IncrOneOfPlayerKVData(
const FString& PlayerId,
const FString& Key,
const FPgosKVDataValue& Increment,
TFunction<void(const FPgosResult& Ret, const FPgosOnePlayerKVData* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerId | const FString& | Player to operate. |
| Key | const FString& | Key to operate. |
| Increment | const FPgosKVDataValue& | The increment value can be set to int32/int64/float/double. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosOnePlayerKVData* 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
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 PlayerIds Players to operate.
* @param Key Key to operate.
* @param Increment The increment value can be set to int32/int64/float/double.
* @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 BatchIncrOneOfPlayerKVData(
const TArray<FString>& PlayerIds,
const FString& Key,
const FPgosKVDataValue& Increment,
TFunction<void(const FPgosResult& Ret, const FPgosServerBatchIncrOneOfPlayerKVDataRsp* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerIds | const TArray<FString>& | Players to operate. |
| Key | const FString& | Key to operate. |
| Increment | const FPgosKVDataValue& | The increment value can be set to int32/int64/float/double. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosServerBatchIncrOneOfPlayerKVDataRsp* 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
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 PlayerId Player to operate.
* @param Increments Increments to update, key: kvdata key, value: increment of the value.
* @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 IncrPlayerKVData(
const FString& PlayerId,
const TMap<FString, FPgosKVDataValue>& Increments,
TFunction<void(const FPgosResult& Ret, const FPgosPlayerKVDataGroup* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerId | const FString& | Player to operate. |
| Increments | const TMap<FString, FPgosKVDataValue>& | Increments to update, key: kvdata key, value: increment of the value. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosPlayerKVDataGroup* 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
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 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 BatchIncrPlayerKVData(
const TArray<FPgosPlayerKVDataGroup>& Increments,
TFunction<void(const FPgosResult& Ret, const FPgosBatchPlayerKVDataGroup* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Increments | const TArray<FPgosPlayerKVDataGroup>& | Player kvdata increments list. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosBatchPlayerKVDataGroup* 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
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 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 BatchIncrPlayerKVDataIdempotent(
const FPgosServerBatchIncrPlayerKVDataIdempotentParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosServerBatchIncrPlayerKVDataIdempotentResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosServerBatchIncrPlayerKVDataIdempotentParams& | Params of BatchIncrPlayerKVDataIdempotent. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosServerBatchIncrPlayerKVDataIdempotentResult* 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
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 PlayerId The player to query.
* @param QueryKeys Keys to query.
* @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 GetPlayerVersionedKVData(
const FString& PlayerId,
const TArray<FString>& QueryKeys,
TFunction<void(const FPgosResult& Ret, const FPgosPlayerKVDataGroupWithVerAndFails* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerId | const FString& | The player to query. |
| QueryKeys | const TArray<FString>& | Keys to query. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosPlayerKVDataGroupWithVerAndFails* 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
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 PlayerIds Players to query.
* @param QueryKeys Keys to query.
* @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 BatchGetPlayerVersionedKVData(
const TArray<FString>& PlayerIds,
const TArray<FString>& QueryKeys,
TFunction<void(const FPgosResult& Ret, const FPgosBatchPlayerKVDataGroupWithVerAndFails* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerIds | const TArray<FString>& | Players to query. |
| QueryKeys | const TArray<FString>& | Keys to query. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosBatchPlayerKVDataGroupWithVerAndFails* 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
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 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 SetPlayerVersionedKVData(
const FPgosPlayerKVDataGroupWithVer& Data,
TFunction<void(const FPgosResult& Ret, const FPgosPlayerKVDataGroupWithVer* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Data | const FPgosPlayerKVDataGroupWithVer& | Versioned kvdata items that need to update. Please set version to the latest value you got for the player. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosPlayerKVDataGroupWithVer* 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
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 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 BatchSetPlayerVersionedKVData(
const TArray<FPgosPlayerKVDataGroupWithVer>& Data,
TFunction<void(const FPgosResult& Ret, const FPgosServerBatchSetPlayerVersionedKVDataRsp* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Data | const TArray<FPgosPlayerKVDataGroupWithVer>& | Versioned kvdata items that need to update. Please set version to the latest value you got for the player. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosServerBatchSetPlayerVersionedKVDataRsp* 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
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 AccountProvider Account service provider: 0 means FAS, 1 means INTL, 2 means MSDK, 3 means WeGame.
* @param AccountOpenIds Account openIDs of external platform.
* @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 BatchOpenIDToPlayerID(
int32 AccountProvider,
const TArray<FString>& AccountOpenIds,
TFunction<void(const FPgosResult& Ret, const FPgosServerBatchOpenIDToPlayerIDRsp* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| AccountProvider | int32 | Account service provider: 0 means FAS, 1 means INTL, 2 means MSDK, 3 means WeGame. |
| AccountOpenIds | const TArray<FString>& | Account openIDs of external platform. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosServerBatchOpenIDToPlayerIDRsp* 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