跳到主要内容

Client PlayerProfile API Reference

Player Info is the core attribute collection used to describe a player.

API List

APIDescription
GetMyInfoQuery the current player's profile.
SetMyNameUpdate current player's display name.
SetMyAvatarUpdate the current player's avatar
SetMyLanguageUpdate the current player's language
SetMyGenderUpdate the current player's gender
GetPlayerInfoQuery a player's info
BatchGetPlayerInfoPerform 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.
GetOneOfMyKVDataQuery the specified kvdata of the current player.
GetMyKVDataQuery certain kvdata of the current player.
GetAllOfMyKVDataQuery all accessible kvdata of the current player.
GetMyPublicKVDataQuery all public kvdata of the current player.
GetMyGroupKVDataQuery the specified group kvdata of the current player. Keys in the group that are not accessible to the current player will be ignored.
SetOneOfMyKVDataUpdate the specified kvdata of the current player.
SetMyKVDataUpdate kvdata of the current player. The update operation for a player's KVData will either succeed as a whole or fail as a whole.
IncrOneOfMyKVDataPerform atomic increment operation on a specific kvdata item for the current player. [Only works on Integer/Float type keys] If the operation is successful, the callback will return the updated data.
IncrMyKVDataPerform atomic increment operation on multiple kvdata items for the current player. [Only works on Integer/Float type keys] If the operation is successful, the callback will return the updated data.
IncrMyKVDataIdempotentPerform atomic increment operation on multiple kvdata items for the current player. [Only works on Integer/Float type keys] If the operation is successful, the callback will return the updated data.
GetOneOfPlayerKVDataQuery the specified kvdata of the specified player.
GetPlayerKVDataQuery certain kvdata of the specified player.
BatchGetPlayerKVDataPerform 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.
GetPlayerPublicKVDataQuery all public kvdata of the specified player.
BatchGetPlayerPublicKVDataPerform a batch query of public 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.
GetPlayerGroupKVDataQuery the specified group kvdata of the specified player. Keys in the group that are not accessible to the current player will be ignored.
BatchGetPlayerGroupKVDataPerform a batch query of the specified group KVData for multiple players (max 100 players). Keys in the group that are not accessible to the current player will be ignored. 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.
GetMyVersionedKVDataQuery certain versioned kvdata of the current 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.
SetMyVersionedKVDataUpdate versioned kvdata for the current 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 'GetMyVersionedKVData' 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.
SetMyPresenceUpdate current player's presence.
GetMyPresenceQuery current player's presence.
GetPlayerPresenceQuery a player's presence.
BatchGetPlayerPresenceQuery multiple players' presence. (max 100 players)
GetPlayerProfileQuery a player's profile, including player information, relationship information, etc.
BatchOpenIDToPlatformPlayerInfoBatch transform account openID of external platform to platform playerInfo of PGOS. (max 100 openIDs, and FAS openid is not supported)
BatchAccountIDToPlayerIDBatch transform account ID of external platform to player ID of PGOS. (max 2000 account IDs)

API Details

GetMyInfo

Query the current player's profile.

/**
* Query the current player's profile.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetMyInfo(
PgosDataCallback<PlayerDetail> result_callback);

Parameters:

ParamTypeDescription
result_callbackPgosDataCallback<PlayerDetail>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

SetMyName

Update current player's display name.

/**
* Update current player's display name.
*
* @param display_name Set the current player's display name. The display name length is limited to 2 to 64 characters.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetMyName(
const pgos::pstring& display_name,
PgosCallback result_callback);

Parameters:

ParamTypeDescription
display_nameconst std::string&Set the current player's display name. The display name length is limited to 2 to 64 characters.
result_callbackPgosCallbackThe result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

SetMyAvatar

Update the current player's avatar

/**
* Update the current player's avatar
*
* @param avatar_uri The new URI of the player avatar.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetMyAvatar(
const pgos::pstring& avatar_uri,
PgosCallback result_callback);

Parameters:

ParamTypeDescription
avatar_uriconst std::string&The new URI of the player avatar.
result_callbackPgosCallbackThe result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

SetMyLanguage

Update the current player's language

/**
* Update the current player's language
*
* @param language The new gender.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetMyLanguage(
const pgos::pstring& language,
PgosCallback result_callback);

Parameters:

ParamTypeDescription
languageconst std::string&The new gender.
result_callbackPgosCallbackThe result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

SetMyGender

Update the current player's gender

/**
* Update the current player's gender
*
* @param gender The new language.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetMyGender(
const pgos::pstring& gender,
PgosCallback result_callback);

Parameters:

ParamTypeDescription
genderconst std::string&The new language.
result_callbackPgosCallbackThe result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetPlayerInfo

Query a player's info

/**
* Query a player's info
*
* @param player_id The player id 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<PlayerInfo> result_callback);

Parameters:

ParamTypeDescription
player_idconst std::string&The player id to query.
result_callbackPgosDataCallback<PlayerInfo>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 player_ids 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<BatchGetPlayerInfoCltRsp> result_callback);

Parameters:

ParamTypeDescription
player_idsconst std::vector<std::string>&The player_ids to query.
result_callbackPgosDataCallback<BatchGetPlayerInfoCltRsp>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetOneOfMyKVData

Query the specified kvdata of the current player.

/**
* Query the specified kvdata of the current player.
*
* @param query_key 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 GetOneOfMyKVData(
const pgos::pstring& query_key,
PgosDataCallback<OnePlayerKVData> result_callback);

Parameters:

ParamTypeDescription
query_keyconst std::string&Key to query
result_callbackPgosDataCallback<OnePlayerKVData>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetMyKVData

Query certain kvdata of the current player.

/**
* Query certain kvdata of the current player.
*
* @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 GetMyKVData(
const pgos::pvector<pgos::pstring>& query_keys,
PgosDataCallback<PlayerKVDataGroupWithFails> result_callback);

Parameters:

ParamTypeDescription
query_keysconst std::vector<std::string>&Keys to query
result_callbackPgosDataCallback<PlayerKVDataGroupWithFails>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetAllOfMyKVData

Query all accessible kvdata of the current player.

/**
* Query all accessible kvdata of the current player.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetAllOfMyKVData(
PgosDataCallback<PlayerKVDataGroup> result_callback);

Parameters:

ParamTypeDescription
result_callbackPgosDataCallback<PlayerKVDataGroup>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetMyPublicKVData

Query all public kvdata of the current player.

/**
* Query all public kvdata of the current player.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetMyPublicKVData(
PgosDataCallback<PlayerKVDataGroup> result_callback);

Parameters:

ParamTypeDescription
result_callbackPgosDataCallback<PlayerKVDataGroup>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetMyGroupKVData

Query the specified group kvdata of the current player. Keys in the group that are not accessible to the current player will be ignored.

/**
* Query the specified group kvdata of the current player.
* Keys in the group that are not accessible to the current player will be ignored.
*
* @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 GetMyGroupKVData(
const pgos::pstring& group_name,
PgosDataCallback<PlayerKVDataGroup> result_callback);

Parameters:

ParamTypeDescription
group_nameconst std::string&Name of the specified group.
result_callbackPgosDataCallback<PlayerKVDataGroup>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

SetOneOfMyKVData

Update the specified kvdata of the current player.

/**
* Update the specified kvdata of the current player.
*
* @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 SetOneOfMyKVData(
const pgos::pstring& key,
const KVDataValue& value,
PgosCallback result_callback);

Parameters:

ParamTypeDescription
keyconst std::string&Key to update
valueconst KVDataValue&The new value can be set to string/int32/int64/float/double.
result_callbackPgosCallbackThe result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

SetMyKVData

Update kvdata of the current player. The update operation for a player's KVData will either succeed as a whole or fail as a whole.

/**
* Update kvdata of the current player.
* The update operation for a player's KVData will either succeed as a whole or fail as a whole.
*
* @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 SetMyKVData(
const pgos::pmap<pgos::pstring, KVDataValue>& kvdata,
PgosCallback result_callback);

Parameters:

ParamTypeDescription
kvdataconst std::map<std::string, KVDataValue>&KVData to update.
result_callbackPgosCallbackThe result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

IncrOneOfMyKVData

Perform atomic increment operation on a specific kvdata item for the current 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 specific kvdata item for the current player. [Only works on Integer/Float type keys]
* If the operation is successful, the callback will return the updated data.
*
* @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 IncrOneOfMyKVData(
const pgos::pstring& key,
const KVDataValue& increment,
PgosDataCallback<OnePlayerKVData> result_callback);

Parameters:

ParamTypeDescription
keyconst std::string&Key to operate.
incrementconst KVDataValue&The increment value can be set to int32/int64/float/double.
result_callbackPgosDataCallback<OnePlayerKVData>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

IncrMyKVData

Perform atomic increment operation on multiple kvdata items for the current 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 the current player. [Only works on Integer/Float type keys]
* If the operation is successful, the callback will return the updated data.
*
* @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 IncrMyKVData(
const pgos::pmap<pgos::pstring, KVDataValue>& increments,
PgosDataCallback<KVDataGroup> result_callback);

Parameters:

ParamTypeDescription
incrementsconst std::map<std::string, KVDataValue>&Increments to update, key: kvdata key, value: increment of the value.
result_callbackPgosDataCallback<KVDataGroup>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

IncrMyKVDataIdempotent

Perform atomic increment operation on multiple kvdata items for the current 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 the current player. [Only works on Integer/Float type keys]
* If the operation is successful, the callback will return the updated data.
*
* @param params Params of IncrMyKVDataIdempotent.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void IncrMyKVDataIdempotent(
const IncrMyKVDataIdempotentParams& params,
PgosDataCallback<IncrMyKVDataIdempotentResult> result_callback);

Parameters:

ParamTypeDescription
paramsconst IncrMyKVDataIdempotentParams&Params of IncrMyKVDataIdempotent.
result_callbackPgosDataCallback<IncrMyKVDataIdempotentResult>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 Player to query.
* @param query_key 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:

ParamTypeDescription
player_idconst std::string&Player to query.
query_keyconst std::string&Key to query.
result_callbackPgosDataCallback<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 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:

ParamTypeDescription
player_idconst std::string&Player to query.
query_keysconst std::vector<std::string>&Keys to query.
result_callbackPgosDataCallback<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:

ParamTypeDescription
player_idsconst std::vector<std::string>&Players to query.
query_keysconst std::vector<std::string>&Keys to query.
result_callbackPgosDataCallback<BatchPlayerKVDataGroupWithFails>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetPlayerPublicKVData

Query all public kvdata of the specified player.

/**
* Query all public kvdata of the specified player.
*
* @param player_id 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 GetPlayerPublicKVData(
const pgos::pstring& player_id,
PgosDataCallback<PlayerKVDataGroup> result_callback);

Parameters:

ParamTypeDescription
player_idconst std::string&Player to query.
result_callbackPgosDataCallback<PlayerKVDataGroup>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

BatchGetPlayerPublicKVData

Perform a batch query of public 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 public 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 result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchGetPlayerPublicKVData(
const pgos::pvector<pgos::pstring>& player_ids,
PgosDataCallback<BatchPlayerKVDataGroup> result_callback);

Parameters:

ParamTypeDescription
player_idsconst std::vector<std::string>&Players to query.
result_callbackPgosDataCallback<BatchPlayerKVDataGroup>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. Keys in the group that are not accessible to the current player will be ignored.

/**
* Query the specified group kvdata of the specified player.
* Keys in the group that are not accessible to the current player will be ignored.
*
* @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:

ParamTypeDescription
player_idconst std::string&Player to query.
group_nameconst std::string&Name of the specified group.
result_callbackPgosDataCallback<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). Keys in the group that are not accessible to the current player will be ignored. 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).
* Keys in the group that are not accessible to the current player will be ignored.
* 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:

ParamTypeDescription
player_idsconst std::vector<std::string>&Players to query.
group_nameconst std::string&Name of the specified group.
result_callbackPgosDataCallback<BatchPlayerKVDataGroup>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetMyVersionedKVData

Query certain versioned kvdata of the current 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 current 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 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 GetMyVersionedKVData(
const pgos::pvector<pgos::pstring>& query_keys,
PgosDataCallback<KVDataGroupWithVerAndFails> result_callback);

Parameters:

ParamTypeDescription
query_keysconst std::vector<std::string>&Keys to query.
result_callbackPgosDataCallback<KVDataGroupWithVerAndFails>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

SetMyVersionedKVData

Update versioned kvdata for the current 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 'GetMyVersionedKVData' 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 current 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 'GetMyVersionedKVData' 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 the 'version' field 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 SetMyVersionedKVData(
const KVDataGroupWithVer& data,
PgosDataCallback<KVDataGroupWithVer> result_callback);

Parameters:

ParamTypeDescription
dataconst KVDataGroupWithVer&Versioned kvdata items that need to update. Please set the 'version' field to the latest value you got for the player.
result_callbackPgosDataCallback<KVDataGroupWithVer>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

SetMyPresence

Update current player's presence.

/**
* Update current player's presence.
*
* @param presence The new presence, its maximum length is 128 characters.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetMyPresence(
const pgos::pstring& presence,
PgosCallback result_callback);

Parameters:

ParamTypeDescription
presenceconst std::string&The new presence, its maximum length is 128 characters.
result_callbackPgosCallbackThe result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetMyPresence

Query current player's presence.

/**
* Query current player's presence.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetMyPresence(
PgosDataCallback<PlayerPresence> result_callback);

Parameters:

ParamTypeDescription
result_callbackPgosDataCallback<PlayerPresence>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetPlayerPresence

Query a player's presence.

/**
* Query a player's presence.
*
* @param player_id The player id to query
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetPlayerPresence(
const pgos::pstring& player_id,
PgosDataCallback<PlayerPresence> result_callback);

Parameters:

ParamTypeDescription
player_idconst std::string&The player id to query
result_callbackPgosDataCallback<PlayerPresence>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

BatchGetPlayerPresence

Query multiple players' presence. (max 100 players)

/**
* Query multiple players' presence. (max 100 players)
*
* @param player_ids A list containing player ID
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchGetPlayerPresence(
const pgos::pvector<pgos::pstring>& player_ids,
PgosDataCallback<BatchGetPlayerPresenceRsp> result_callback);

Parameters:

ParamTypeDescription
player_idsconst std::vector<std::string>&A list containing player ID
result_callbackPgosDataCallback<BatchGetPlayerPresenceRsp>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetPlayerProfile

Query a player's profile, including player information, relationship information, etc.

/**
* Query a player's profile, including player information, relationship information, etc.
*
* @param player_id The player id to query
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetPlayerProfile(
const pgos::pstring& player_id,
PgosDataCallback<GetPlayerProfileResult> result_callback);

Parameters:

ParamTypeDescription
player_idconst std::string&The player id to query
result_callbackPgosDataCallback<GetPlayerProfileResult>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

BatchOpenIDToPlatformPlayerInfo

Batch transform account openID of external platform to platform playerInfo of PGOS. (max 100 openIDs, and FAS openid is not supported)

/**
* Batch transform account openID of external platform to platform playerInfo of PGOS. (max 100 openIDs, and FAS openid is not supported)
*
* @param account_open_ids Account openIDs of external platform such as Steam.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchOpenIDToPlatformPlayerInfo(
const pgos::pvector<pgos::pstring>& account_open_ids,
PgosDataCallback<PlatformPlayerInfoMap> result_callback);

Parameters:

ParamTypeDescription
account_open_idsconst std::vector<std::string>&Account openIDs of external platform such as Steam.
result_callbackPgosDataCallback<PlatformPlayerInfoMap>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

BatchAccountIDToPlayerID

Batch transform account ID of external platform to player ID of PGOS. (max 2000 account IDs)

/**
* Batch transform account ID of external platform to player ID of PGOS. (max 2000 account IDs)
*
* @param account_ids Account IDs of external platform such as PS5.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchAccountIDToPlayerID(
const pgos::pvector<pgos::pstring>& account_ids,
PgosDataCallback<BatchAccountIDToPlayerIDResult> result_callback);

Parameters:

ParamTypeDescription
account_idsconst std::vector<std::string>&Account IDs of external platform such as PS5.
result_callbackPgosDataCallback<BatchAccountIDToPlayerIDResult>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void