Client Party API Reference
Party is a service for creating an instant team for players. The player can use it to build a "temporary virtual team" and then fire a battle.
API List
| API | Description |
|---|---|
| CreateParty | Create a new party |
| GetPartyInfo | Get detailed information of a party |
| SetPartyStrategy | Change the join/invite strategy of the current party |
| GetPlayerPartyInfo | Get the player's current party information from server |
| InvitePlayerToParty | Invite other players to join current party |
| JoinParty | Join a party |
| LeaveParty | Leave the current party |
| DismissParty | Dismiss the current party. Only the leader has right to do this |
| KickPartyMember | Kick out a player in current party. Only the leader has right to do this |
| TransferPartyLeader | Transfer leader right of current party to another player. Only the leader has right to do this |
| SendPartyChatTextMsg | Send party chat text message. Only enable_chatting in CreatePartyParams is True when the party was created |
| SendPartyChatCustomMsg | Send party chat custom message. Only enable_chatting in CreatePartyParams is True when the party was created |
| CurrentParty | Get the cached information of the player's current party |
| SetGlobalCustomData | Set global custom data for party. Only Leader has permission to do it. The maximum length for custom data in a narrow-character string is 4096 bytes, If it is a wide-character string, it should be converted to a utf-8 narrow-character string before calculating its length. |
| SetPlayerCustomData | Set the player owned custom data. The maximum length for custom data in a narrow-character string is 4096 bytes, If it is a wide-character string, it should be converted to a utf-8 narrow-character string before calculating its length. |
Event List
| Event | Description |
|---|---|
| OnPartyStrategyChanged | The event will be triggered when party strategies changed. |
| OnPartyMemberJoined | The event will be triggered when new players joined the party. |
| OnPartyMemberLeft | The event will be triggered when players left the party. |
| OnPartyDismissed | The event will be triggered when the party was dismissed. |
| OnPartyLeaderTransferred | The event will be triggered when the leader status was transferred. |
| OnReceivePartyInvitation | The event will be triggered when receive a party invitation. |
| OnReceivePartyChatMsg | The event will be triggered when party chat message arrived. |
| OnCustomDataChanged | The event will be triggered when party custom data changed. |
| OnPartyInfoUpdated | The event will be triggered when party info updated. |
API Details
CreateParty
Create a new party
/// <summary>Create a new party</summary>
/// <param name="pgos_params">Request struct for create party</param>
public void CreateParty(CreatePartyParams pgos_params, PartyDelegate0 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | CreatePartyParams | Request struct for create party |
| callback | PartyDelegate0 |
Return: void
GetPartyInfo
Get detailed information of a party
/// <summary>Get detailed information of a party</summary>
/// <param name="party_id">The id of party to query</param>
public void GetPartyInfo(string party_id, PartyDelegate0 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| party_id | string | The id of party to query |
| callback | PartyDelegate0 |
Return: void
SetPartyStrategy
Change the join/invite strategy of the current party
/// <summary>Change the join/invite strategy of the current party</summary>
/// <param name="pgos_params">Request struct for changing party strategy</param>
public void SetPartyStrategy(SetPartyStrategyParams pgos_params, PartyDelegate1 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | SetPartyStrategyParams | Request struct for changing party strategy |
| callback | PartyDelegate1 |
Return: void
GetPlayerPartyInfo
Get the player's current party information from server
/// <summary>Get the player's current party information from server</summary>
public void GetPlayerPartyInfo(PartyDelegate0 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| callback | PartyDelegate0 |
Return: void
InvitePlayerToParty
Invite other players to join current party
/// <summary>Invite other players to join current party</summary>
/// <param name="party_id">The id of party to invite to</param>
/// <param name="invitee_player_ids">List of player id</param>
public void InvitePlayerToParty(string party_id, List<string> invitee_player_ids, PartyDelegate1 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| party_id | string | The id of party to invite to |
| invitee_player_ids | List<string> | List of player id |
| callback | PartyDelegate1 |
Return: void
JoinParty
Join a party
/// <summary>Join a party</summary>
/// <param name="party_id">The id of party to join</param>
public void JoinParty(string party_id, PartyDelegate0 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| party_id | string | The id of party to join |
| callback | PartyDelegate0 |
Return: void
LeaveParty
Leave the current party
/// <summary>Leave the current party</summary>
/// <param name="party_id">The id of party to leave</param>
public void LeaveParty(string party_id, PartyDelegate1 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| party_id | string | The id of party to leave |
| callback | PartyDelegate1 |
Return: void
DismissParty
Dismiss the current party. Only the leader has right to do this
/// <summary>Dismiss the current party. Only the leader has right to do this</summary>
/// <param name="party_id">The id of party to dismiss</param>
public void DismissParty(string party_id, PartyDelegate1 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| party_id | string | The id of party to dismiss |
| callback | PartyDelegate1 |
Return: void
KickPartyMember
Kick out a player in current party. Only the leader has right to do this
/// <summary>Kick out a player in current party. Only the leader has right to do this</summary>
/// <param name="party_id">The id of party to kick out member</param>
/// <param name="kick_player_id">The player id of member to kick out</param>
public void KickPartyMember(string party_id, string kick_player_id, PartyDelegate1 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| party_id | string | The id of party to kick out member |
| kick_player_id | string | The player id of member to kick out |
| callback | PartyDelegate1 |
Return: void
TransferPartyLeader
Transfer leader right of current party to another player. Only the leader has right to do this
/// <summary>Transfer leader right of current party to another player. Only the leader has right to do this</summary>
/// <param name="party_id">The id of party to transfer leadership</param>
/// <param name="new_leader_player_id">The player id of the new leader</param>
public void TransferPartyLeader(string party_id, string new_leader_player_id, PartyDelegate1 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| party_id | string | The id of party to transfer leadership |
| new_leader_player_id | string | The player id of the new leader |
| callback | PartyDelegate1 |
Return: void
SendPartyChatTextMsg
Send party chat text message. Only enable_chatting in CreatePartyParams is True when the party was created
/// <summary>
/// Send party chat text message.
/// Only enable_chatting in CreatePartyParams is True when the party was created
/// </summary>
/// <param name="pgos_params">Request struct for sending party chat message</param>
public void SendPartyChatTextMsg(SendPartyChatMsgParams pgos_params, PartyDelegate2 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | SendPartyChatMsgParams | Request struct for sending party chat message |
| callback | PartyDelegate2 |
Return: void
SendPartyChatCustomMsg
Send party chat custom message. Only enable_chatting in CreatePartyParams is True when the party was created
/// <summary>
/// Send party chat custom message.
/// Only enable_chatting in CreatePartyParams is True when the party was created
/// </summary>
/// <param name="pgos_params">Request struct for sending party chat message</param>
public void SendPartyChatCustomMsg(SendPartyChatMsgParams pgos_params, PartyDelegate2 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | SendPartyChatMsgParams | Request struct for sending party chat message |
| callback | PartyDelegate2 |
Return: void
CurrentParty
Get the cached information of the player's current party
/// <summary>Get the cached information of the player's current party</summary>
/// <param name="dst">The latest party information detail</param>
public bool CurrentParty(ref PartyInfo dst);
Parameters:
| Param | Type | Description |
|---|---|---|
| dst | ref PartyInfo | The latest party information detail |
Return: bool
false if not in a party, or don't get the detail information of the current party
SetGlobalCustomData
Set global custom data for party. Only Leader has permission to do it. The maximum length for custom data in a narrow-character string is 4096 bytes, If it is a wide-character string, it should be converted to a utf-8 narrow-character string before calculating its length.
/// <summary>
/// Set global custom data for party. Only Leader has permission to do it.
/// The maximum length for custom data in a narrow-character string is 4096 bytes,
/// If it is a wide-character string, it should be converted to a utf-8 narrow-character string before calculating its length.
/// </summary>
/// <param name="party_id">Party ID.</param>
/// <param name="global_custom_data">Global custom data string.</param>
public void SetGlobalCustomData(string party_id, string global_custom_data, PartyDelegate3 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| party_id | string | Party ID. |
| global_custom_data | string | Global custom data string. |
| callback | PartyDelegate3 |
Return: void
SetPlayerCustomData
Set the player owned custom data. The maximum length for custom data in a narrow-character string is 4096 bytes, If it is a wide-character string, it should be converted to a utf-8 narrow-character string before calculating its length.
/// <summary>
/// Set the player owned custom data.
/// The maximum length for custom data in a narrow-character string is 4096 bytes,
/// If it is a wide-character string, it should be converted to a utf-8 narrow-character string before calculating its length.
/// </summary>
/// <param name="party_id">Party ID.</param>
/// <param name="player_custom_data">Player custom data string.</param>
public void SetPlayerCustomData(string party_id, string player_custom_data, PartyDelegate3 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| party_id | string | Party ID. |
| player_custom_data | string | Player custom data string. |
| callback | PartyDelegate3 |
Return: void
Event Details
OnPartyStrategyChanged
The event will be triggered when party strategies changed.
/// <summary>The event will be triggered when party strategies changed.</summary>
public event PartyDelegate4 OnPartyStrategyChanged;
Type Reference:
OnPartyMemberJoined
The event will be triggered when new players joined the party.
/// <summary>The event will be triggered when new players joined the party.</summary>
public event PartyDelegate5 OnPartyMemberJoined;
Type Reference:
OnPartyMemberLeft
The event will be triggered when players left the party.
/// <summary>The event will be triggered when players left the party.</summary>
public event PartyDelegate6 OnPartyMemberLeft;
Type Reference:
OnPartyDismissed
The event will be triggered when the party was dismissed.
/// <summary>The event will be triggered when the party was dismissed.</summary>
public event PartyDelegate7 OnPartyDismissed;
Type Reference:
OnPartyLeaderTransferred
The event will be triggered when the leader status was transferred.
/// <summary>The event will be triggered when the leader status was transferred.</summary>
public event PartyDelegate8 OnPartyLeaderTransferred;
Type Reference:
OnReceivePartyInvitation
The event will be triggered when receive a party invitation.
/// <summary>The event will be triggered when receive a party invitation.</summary>
public event PartyDelegate9 OnReceivePartyInvitation;
Type Reference:
OnReceivePartyChatMsg
The event will be triggered when party chat message arrived.
/// <summary>The event will be triggered when party chat message arrived.</summary>
public event PartyDelegate10 OnReceivePartyChatMsg;
Type Reference:
OnCustomDataChanged
The event will be triggered when party custom data changed.
/// <summary>The event will be triggered when party custom data changed.</summary>
public event PartyDelegate11 OnCustomDataChanged;
Type Reference:
OnPartyInfoUpdated
The event will be triggered when party info updated.
/// <summary>The event will be triggered when party info updated.</summary>
public event PartyDelegate12 OnPartyInfoUpdated;
Type Reference:
All Delegates
public delegate void PartyDelegate0(PgosResult a0, PartyInfo a1);
public delegate void PartyDelegate1(PgosResult a0);
public delegate void PartyDelegate2(PgosResult a0, ChatMsgInfo a1);
public delegate void PartyDelegate3(PgosResult a0, PartyCustomData a1);
public delegate void PartyDelegate4(PartyStrategyChangedEvt a0);
public delegate void PartyDelegate5(PartyMemberJoinedEvt a0);
public delegate void PartyDelegate6(PartyMemberLeftEvt a0);
public delegate void PartyDelegate7(PartyDismissedEvt a0);
public delegate void PartyDelegate8(PartyLeaderTransferredEvt a0);
public delegate void PartyDelegate9(ReceivePartyInvitationEvt a0);
public delegate void PartyDelegate10(ReceivePartyChatMsgEvt a0);
public delegate void PartyDelegate11(PartyCustomDataChangedEvt a0);
public delegate void PartyDelegate12(PartyInfoUpdatedEvt a0);
Type Reference: