Skip to main content

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

APIDescription
UpdateBattleRecordNow, there is no need to manually establish the association between battle session id and player ids, as PGOS will automatically complete this task.
SetBattleTagsSet tags for a battle session record.
UpdateBattleDataUpdate the data of battle
UpdateBattleBriefUpdate the brief of battle
UpdateBattleDetailUpdate the detail of battle.
DeleteBattleDataDelete 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.

/// <summary>Now, there is no need to manually establish the association between battle session id and player ids, as PGOS will automatically complete this task.</summary>
/// <param name="battle_session_id">The id of battle session.</param>
/// <param name="player_ids">IDs of all players in the battle, array cannot be empty.</param>
/// <param name="tags">The tags of battle.</param>
public void UpdateBattleRecord(string battle_session_id, List<string> player_ids, List<string> tags, BattleDelegate0 callback);

Parameters:

ParamTypeDescription
battle_session_idstringThe id of battle session.
player_idsList<string>IDs of all players in the battle, array cannot be empty.
tagsList<string>The tags of battle.
callbackBattleDelegate0

Return: void

SetBattleTags

Set tags for a battle session record.

/// <summary>Set tags for a battle session record.</summary>
public void SetBattleTags(SetBattleTagsParams pgos_params, BattleDelegate0 callback);

Parameters:

ParamTypeDescription
pgos_paramsSetBattleTagsParams
callbackBattleDelegate0

Return: void

UpdateBattleData

Update the data of battle

/// <summary>Update the data of battle</summary>
/// <param name="battle_session_id">The id of battle session.</param>
/// <param name="record_data">The data of battle.</param>
public void UpdateBattleData(string battle_session_id, Dictionary<string, string> record_data, BattleDelegate0 callback);

Parameters:

ParamTypeDescription
battle_session_idstringThe id of battle session.
record_dataDictionary<string, string>The data of battle.
callbackBattleDelegate0

Return: void

UpdateBattleBrief

Update the brief of battle

/// <summary>Update the brief of battle</summary>
/// <param name="battle_session_id">The id of battle session.</param>
/// <param name="brief">The data of battle.</param>
public void UpdateBattleBrief(string battle_session_id, string brief, BattleDelegate0 callback);

Parameters:

ParamTypeDescription
battle_session_idstringThe id of battle session.
briefstringThe data of battle.
callbackBattleDelegate0

Return: void

UpdateBattleDetail

Update the detail of battle.

/// <summary>Update the detail of battle.</summary>
/// <param name="battle_session_id">The id of battle session.</param>
/// <param name="detail">The data of battle.</param>
public void UpdateBattleDetail(string battle_session_id, string detail, BattleDelegate0 callback);

Parameters:

ParamTypeDescription
battle_session_idstringThe id of battle session.
detailstringThe data of battle.
callbackBattleDelegate0

Return: void

DeleteBattleData

Delete the data of the specified key of battle

/// <summary>Delete the data of the specified key of battle</summary>
/// <param name="battle_session_id">The id of battle session.</param>
/// <param name="keys">The specified keys to be deleted, if the keys is empty, nothing will happen.</param>
public void DeleteBattleData(string battle_session_id, List<string> keys, BattleDelegate1 callback);

Parameters:

ParamTypeDescription
battle_session_idstringThe id of battle session.
keysList<string>The specified keys to be deleted, if the keys is empty, nothing will happen.
callbackBattleDelegate1

Return: void

All Delegates

public delegate void BattleDelegate0(PgosResult a0);
public delegate void BattleDelegate1(PgosResult a0, DelBattleDataRsp a1);

Type Reference: