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
/**
* Create a new party
*
* @param Params Request struct for create party
* @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 CreateParty(
const FPgosClientCreatePartyParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientPartyInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientCreatePartyParams& | Request struct for create party |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientPartyInfo* 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
GetPartyInfo
Get detailed information of a party
/**
* Get detailed information of a party
*
* @param PartyId The id of party to query
* @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 GetPartyInfo(
const FString& PartyId,
TFunction<void(const FPgosResult& Ret, const FPgosClientPartyInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PartyId | const FString& | The id of party to query |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientPartyInfo* 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
SetPartyStrategy
Change the join/invite strategy of the current party
/**
* Change the join/invite strategy of the current party
*
* @param Params Request struct for changing party strategy
* @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 SetPartyStrategy(
const FPgosClientSetPartyStrategyParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientSetPartyStrategyParams& | Request struct for changing party strategy |
| 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
GetPlayerPartyInfo
Get the player's current party information from server
/**
* Get the player's current party information from server
*
* @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 GetPlayerPartyInfo(
TFunction<void(const FPgosResult& Ret, const FPgosClientPartyInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientPartyInfo* 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
InvitePlayerToParty
Invite other players to join current party
/**
* Invite other players to join current party
*
* @param PartyId The id of party to invite to
* @param InviteePlayerIds List of player id
* @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 InvitePlayerToParty(
const FString& PartyId,
const TArray<FString>& InviteePlayerIds,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PartyId | const FString& | The id of party to invite to |
| InviteePlayerIds | const TArray<FString>& | List of player id |
| 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
JoinParty
Join a party
/**
* Join a party
*
* @param PartyId The id of party to join
* @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 JoinParty(
const FString& PartyId,
TFunction<void(const FPgosResult& Ret, const FPgosClientPartyInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PartyId | const FString& | The id of party to join |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientPartyInfo* 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
LeaveParty
Leave the current party
/**
* Leave the current party
*
* @param PartyId The id of party to leave
* @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 LeaveParty(
const FString& PartyId,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PartyId | const FString& | The id of party to leave |
| 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
DismissParty
Dismiss the current party. Only the leader has right to do this
/**
* Dismiss the current party. Only the leader has right to do this
*
* @param PartyId The id of party to dismiss
* @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 DismissParty(
const FString& PartyId,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PartyId | const FString& | The id of party to dismiss |
| 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
KickPartyMember
Kick out a player in current party. Only the leader has right to do this
/**
* Kick out a player in current party. Only the leader has right to do this
*
* @param PartyId The id of party to kick out member
* @param KickPlayerId The player id of member to kick out
* @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 KickPartyMember(
const FString& PartyId,
const FString& KickPlayerId,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PartyId | const FString& | The id of party to kick out member |
| KickPlayerId | const FString& | The player id of member to kick out |
| 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
TransferPartyLeader
Transfer leader right of current party to another player. Only the leader has right to do this
/**
* Transfer leader right of current party to another player. Only the leader has right to do this
*
* @param PartyId The id of party to transfer leadership
* @param NewLeaderPlayerId The player id of the new leader
* @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 TransferPartyLeader(
const FString& PartyId,
const FString& NewLeaderPlayerId,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PartyId | const FString& | The id of party to transfer leadership |
| NewLeaderPlayerId | const FString& | The player id of the new leader |
| 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
SendPartyChatTextMsg
Send party chat text message. Only enable_chatting in CreatePartyParams is True when the party was created
/**
* Send party chat text message.
* Only enable_chatting in CreatePartyParams is True when the party was created
*
* @param Params Request struct for sending party chat message
* @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 SendPartyChatTextMsg(
const FPgosClientSendPartyChatMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientChatMsgInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientSendPartyChatMsgParams& | Request struct for sending party chat message |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientChatMsgInfo* 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
SendPartyChatCustomMsg
Send party chat custom message. Only enable_chatting in CreatePartyParams is True when the party was created
/**
* Send party chat custom message.
* Only enable_chatting in CreatePartyParams is True when the party was created
*
* @param Params Request struct for sending party chat message
* @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 SendPartyChatCustomMsg(
const FPgosClientSendPartyChatMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientChatMsgInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientSendPartyChatMsgParams& | Request struct for sending party chat message |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientChatMsgInfo* 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
CurrentParty
Get the cached information of the player's current party
/**
* Get the cached information of the player's current party
*
* @param Dst The latest party information detail
* @return false if not in a party, or don't get the detail information of the current party
*/
bool CurrentParty(
FPgosClientPartyInfo& Dst) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Dst | FPgosClientPartyInfo& | 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.
/**
* 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.
*
* @param PartyId Party ID.
* @param GlobalCustomData Global custom data string.
* @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 SetGlobalCustomData(
const FString& PartyId,
const FString& GlobalCustomData,
TFunction<void(const FPgosResult& Ret, const FPgosClientPartyCustomData* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PartyId | const FString& | Party ID. |
| GlobalCustomData | const FString& | Global custom data string. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientPartyCustomData* 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
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.
/**
* 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.
*
* @param PartyId Party ID.
* @param PlayerCustomData Player custom data string.
* @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 SetPlayerCustomData(
const FString& PartyId,
const FString& PlayerCustomData,
TFunction<void(const FPgosResult& Ret, const FPgosClientPartyCustomData* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PartyId | const FString& | Party ID. |
| PlayerCustomData | const FString& | Player custom data string. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientPartyCustomData* 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
Event Details
OnPartyStrategyChanged
The event will be triggered when party strategies changed.
/**
* OnPartyStrategyChanged:
* The event will be triggered when party strategies changed.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnPartyStrategyChanged, const FPgosClientPartyStrategyChangedEvt& /*Event*/);
FOnPartyStrategyChanged& OnPartyStrategyChanged() { return PartyStrategyChangedDelegate; }
Type Reference:
OnPartyMemberJoined
The event will be triggered when new players joined the party.
/**
* OnPartyMemberJoined:
* The event will be triggered when new players joined the party.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnPartyMemberJoined, const FPgosClientPartyMemberJoinedEvt& /*Event*/);
FOnPartyMemberJoined& OnPartyMemberJoined() { return PartyMemberJoinedDelegate; }
Type Reference:
OnPartyMemberLeft
The event will be triggered when players left the party.
/**
* OnPartyMemberLeft:
* The event will be triggered when players left the party.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnPartyMemberLeft, const FPgosClientPartyMemberLeftEvt& /*Event*/);
FOnPartyMemberLeft& OnPartyMemberLeft() { return PartyMemberLeftDelegate; }
Type Reference:
OnPartyDismissed
The event will be triggered when the party was dismissed.
/**
* OnPartyDismissed:
* The event will be triggered when the party was dismissed.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnPartyDismissed, const FPgosClientPartyDismissedEvt& /*Event*/);
FOnPartyDismissed& OnPartyDismissed() { return PartyDismissedDelegate; }
Type Reference:
OnPartyLeaderTransferred
The event will be triggered when the leader status was transferred.
/**
* OnPartyLeaderTransferred:
* The event will be triggered when the leader status was transferred.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnPartyLeaderTransferred, const FPgosClientPartyLeaderTransferredEvt& /*Event*/);
FOnPartyLeaderTransferred& OnPartyLeaderTransferred() { return PartyLeaderTransferredDelegate; }
Type Reference:
OnReceivePartyInvitation
The event will be triggered when receive a party invitation.
/**
* OnReceivePartyInvitation:
* The event will be triggered when receive a party invitation.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnReceivePartyInvitation, const FPgosClientReceivePartyInvitationEvt& /*Event*/);
FOnReceivePartyInvitation& OnReceivePartyInvitation() { return ReceivePartyInvitationDelegate; }
Type Reference:
OnReceivePartyChatMsg
The event will be triggered when party chat message arrived.
/**
* OnReceivePartyChatMsg:
* The event will be triggered when party chat message arrived.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnReceivePartyChatMsg, const FPgosClientReceivePartyChatMsgEvt& /*Event*/);
FOnReceivePartyChatMsg& OnReceivePartyChatMsg() { return ReceivePartyChatMsgDelegate; }
Type Reference:
OnCustomDataChanged
The event will be triggered when party custom data changed.
/**
* OnCustomDataChanged:
* The event will be triggered when party custom data changed.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnCustomDataChanged, const FPgosClientPartyCustomDataChangedEvt& /*Event*/);
FOnCustomDataChanged& OnCustomDataChanged() { return CustomDataChangedDelegate; }
Type Reference:
OnPartyInfoUpdated
The event will be triggered when party info updated.
/**
* OnPartyInfoUpdated:
* The event will be triggered when party info updated.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnPartyInfoUpdated, const FPgosClientPartyInfoUpdatedEvt& /*Event*/);
FOnPartyInfoUpdated& OnPartyInfoUpdated() { return PartyInfoUpdatedDelegate; }
Type Reference: