跳到主要内容

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

APIDescription
CreatePartyCreate a new party
GetPartyInfoGet detailed information of a party
SetPartyStrategyChange the join/invite strategy of the current party
GetPlayerPartyInfoGet the player's current party information from server
InvitePlayerToPartyInvite other players to join current party
JoinPartyJoin a party
LeavePartyLeave the current party
DismissPartyDismiss the current party. Only the leader has right to do this
KickPartyMemberKick out a player in current party. Only the leader has right to do this
TransferPartyLeaderTransfer leader right of current party to another player. Only the leader has right to do this
SendPartyChatTextMsgSend party chat text message. Only enable_chatting in CreatePartyParams is True when the party was created
SendPartyChatCustomMsgSend party chat custom message. Only enable_chatting in CreatePartyParams is True when the party was created
CurrentPartyGet the cached information of the player's current party
SetGlobalCustomDataSet 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.
SetPlayerCustomDataSet 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

EventDescription
OnPartyStrategyChangedThe event will be triggered when party strategies changed.
OnPartyMemberJoinedThe event will be triggered when new players joined the party.
OnPartyMemberLeftThe event will be triggered when players left the party.
OnPartyDismissedThe event will be triggered when the party was dismissed.
OnPartyLeaderTransferredThe event will be triggered when the leader status was transferred.
OnReceivePartyInvitationThe event will be triggered when receive a party invitation.
OnReceivePartyChatMsgThe event will be triggered when party chat message arrived.
OnCustomDataChangedThe event will be triggered when party custom data changed.
OnPartyInfoUpdatedThe 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:

ParamTypeDescription
pgos_paramsCreatePartyParamsRequest struct for create party
callbackPartyDelegate0

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:

ParamTypeDescription
party_idstringThe id of party to query
callbackPartyDelegate0

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:

ParamTypeDescription
pgos_paramsSetPartyStrategyParamsRequest struct for changing party strategy
callbackPartyDelegate1

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:

ParamTypeDescription
callbackPartyDelegate0

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:

ParamTypeDescription
party_idstringThe id of party to invite to
invitee_player_idsList<string>List of player id
callbackPartyDelegate1

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:

ParamTypeDescription
party_idstringThe id of party to join
callbackPartyDelegate0

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:

ParamTypeDescription
party_idstringThe id of party to leave
callbackPartyDelegate1

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:

ParamTypeDescription
party_idstringThe id of party to dismiss
callbackPartyDelegate1

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:

ParamTypeDescription
party_idstringThe id of party to kick out member
kick_player_idstringThe player id of member to kick out
callbackPartyDelegate1

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:

ParamTypeDescription
party_idstringThe id of party to transfer leadership
new_leader_player_idstringThe player id of the new leader
callbackPartyDelegate1

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:

ParamTypeDescription
pgos_paramsSendPartyChatMsgParamsRequest struct for sending party chat message
callbackPartyDelegate2

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:

ParamTypeDescription
pgos_paramsSendPartyChatMsgParamsRequest struct for sending party chat message
callbackPartyDelegate2

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:

ParamTypeDescription
dstref PartyInfoThe 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:

ParamTypeDescription
party_idstringParty ID.
global_custom_datastringGlobal custom data string.
callbackPartyDelegate3

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:

ParamTypeDescription
party_idstringParty ID.
player_custom_datastringPlayer custom data string.
callbackPartyDelegate3

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: