Server Battle API Reference
Battle session is the foundation of battle service. Battle session instances can be created through services such as Lobby / Matchmaking / World or via the PGOS HTTP API, and placed in online or local DS via the DS Hosting service. The battle session also manages data such as the players in the game and the DS access information.
API List
| API | Description |
|---|---|
| UpdateBattleRecord | Now, there is no need to manually establish the association between battle session id and player ids, as PGOS will automatically complete this task. |
| SetBattleTags | Set tags for a battle session record. |
| UpdateBattleData | Update the data of battle |
| UpdateBattleBrief | Update the brief of battle |
| UpdateBattleDetail | Update the detail of battle. |
| DeleteBattleData | Delete the data of the specified key of battle |
API Details
UpdateBattleRecord
Now, there is no need to manually establish the association between battle session id and player ids, as PGOS will automatically complete this task.
Deprecated, use SetBattleTags instead.
/**
* Now, there is no need to manually establish the association between battle session id and player ids, as PGOS will automatically complete this task.
* [DEPRECATED!!!] UpdateBattleRecord was declared deprecated, consider using SetBattleTags instead.
*
* @param BattleSessionId The id of battle session.
* @param PlayerIds IDs of all players in the battle, array cannot be empty.
* @param Tags The tags of battle.
* @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 UpdateBattleRecord(
const FString& BattleSessionId,
const TArray<FString>& PlayerIds,
const TArray<FString>& Tags,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| BattleSessionId | const FString& | The id of battle session. |
| PlayerIds | const TArray<FString>& | IDs of all players in the battle, array cannot be empty. |
| Tags | const TArray<FString>& | The tags of battle. |
| 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
SetBattleTags
Set tags for a battle session record.
/**
* Set tags for a battle session record.
*
* @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 SetBattleTags(
const FPgosServerSetBattleTagsParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosServerSetBattleTagsParams& | |
| 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
UpdateBattleData
Update the data of battle
/**
* Update the data of battle
*
* @param BattleSessionId The id of battle session.
* @param RecordData The data of battle.
* @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 UpdateBattleData(
const FString& BattleSessionId,
const TMap<FString, FString>& RecordData,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| BattleSessionId | const FString& | The id of battle session. |
| RecordData | const TMap<FString, FString>& | The data of battle. |
| 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
UpdateBattleBrief
Update the brief of battle
/**
* Update the brief of battle
*
* @param BattleSessionId The id of battle session.
* @param Brief The data of battle.
* @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 UpdateBattleBrief(
const FString& BattleSessionId,
const FString& Brief,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| BattleSessionId | const FString& | The id of battle session. |
| Brief | const FString& | The data of battle. |
| 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
UpdateBattleDetail
Update the detail of battle.
/**
* Update the detail of battle.
*
* @param BattleSessionId The id of battle session.
* @param Detail The data of battle.
* @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 UpdateBattleDetail(
const FString& BattleSessionId,
const FString& Detail,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| BattleSessionId | const FString& | The id of battle session. |
| Detail | const FString& | The data of battle. |
| 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
DeleteBattleData
Delete the data of the specified key of battle
/**
* Delete the data of the specified key of battle
*
* @param BattleSessionId The id of battle session.
* @param Keys The specified keys to be deleted, if the keys is empty, nothing will happen.
* @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 DeleteBattleData(
const FString& BattleSessionId,
const TArray<FString>& Keys,
TFunction<void(const FPgosResult& Ret, const FPgosServerDelBattleDataRsp* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| BattleSessionId | const FString& | The id of battle session. |
| Keys | const TArray<FString>& | The specified keys to be deleted, if the keys is empty, nothing will happen. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosServerDelBattleDataRsp* 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