Client PlayerProfile API Reference
Player Info is the core attribute collection used to describe a player.
API List
| API | Description |
|---|---|
| GetMyInfo | Query the current player's profile. |
| SetMyName | Update current player's display name. |
| SetMyAvatar | Update the current player's avatar |
| SetMyLanguage | Update the current player's language |
| SetMyGender | Update the current player's gender |
| GetPlayerInfo | Query a player's 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. |
| GetOneOfMyKVData | Query the specified kvdata of the current player. |
| GetMyKVData | Query certain kvdata of the current player. |
| GetAllOfMyKVData | Query all accessible kvdata of the current player. |
| GetMyPublicKVData | Query all public kvdata of the current player. |
| 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. |
| SetOneOfMyKVData | Update the specified kvdata of the current player. |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| GetPlayerPublicKVData | Query all public kvdata of the specified player. |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| SetMyPresence | Update current player's presence. |
| GetMyPresence | Query current player's presence. |
| GetPlayerPresence | Query a player's presence. |
| BatchGetPlayerPresence | Query multiple players' presence. (max 100 players) |
| GetPlayerProfile | Query a player's profile, including player information, relationship information, etc. |
| BatchOpenIDToPlatformPlayerInfo | Batch transform account openID of external platform to platform playerInfo of PGOS. (max 100 openIDs, and FAS openid is not supported) |
| BatchAccountIDToPlayerID | Batch 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:
| Param | Type | Description |
|---|---|---|
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| display_name | const std::string& | Set the current player's display name. The display name length is limited to 2 to 64 characters. |
| result_callback | PgosCallback | The 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:
| Param | Type | Description |
|---|---|---|
| avatar_uri | const std::string& | The new URI of the player avatar. |
| result_callback | PgosCallback | The 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:
| Param | Type | Description |
|---|---|---|
| language | const std::string& | The new gender. |
| result_callback | PgosCallback | The 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:
| Param | Type | Description |
|---|---|---|
| gender | const std::string& | The new language. |
| result_callback | PgosCallback | The 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:
| Param | Type | Description |
|---|---|---|
| player_id | const std::string& | The player id to query. |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| player_ids | const std::vector<std::string>& | The player_ids to query. |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| query_key | const std::string& | 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
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:
| Param | Type | Description |
|---|---|---|
| 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
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:
| Param | Type | Description |
|---|---|---|
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| 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
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:
| Param | Type | Description |
|---|---|---|
| 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
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:
| Param | Type | Description |
|---|---|---|
| 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
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:
| Param | Type | Description |
|---|---|---|
| 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
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:
| Param | Type | Description |
|---|---|---|
| increments | const std::map<std::string, KVDataValue>& | Increments to update, key: kvdata key, value: increment of the value. |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| params | const IncrMyKVDataIdempotentParams& | Params of IncrMyKVDataIdempotent. |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| player_id | const std::string& | Player to query. |
| query_key | const std::string& | 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 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& | 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
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:
| Param | Type | Description |
|---|---|---|
| player_id | const std::string& | Player to query. |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| player_ids | const std::vector<std::string>& | Players to query. |
| result_callback | PgosDataCallback<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:
| 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). 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:
| 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
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:
| Param | Type | Description |
|---|---|---|
| query_keys | const std::vector<std::string>& | Keys to query. |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| data | const KVDataGroupWithVer& | Versioned kvdata items that need to update. Please set the 'version' field to the latest value you got for the player. |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| presence | const std::string& | The new presence, its maximum length is 128 characters. |
| result_callback | PgosCallback | The 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:
| Param | Type | Description |
|---|---|---|
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| player_id | const std::string& | The player id to query |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| player_ids | const std::vector<std::string>& | A list containing player ID |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| player_id | const std::string& | The player id to query |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| account_open_ids | const std::vector<std::string>& | Account openIDs of external platform such as Steam. |
| result_callback | PgosDataCallback<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:
| Param | Type | Description |
|---|---|---|
| account_ids | const std::vector<std::string>& | Account IDs of external platform such as PS5. |
| result_callback | PgosDataCallback<BatchAccountIDToPlayerIDResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void