Party SDK Reference #
This section provides references for Party methods, classes, and events in the Pragma SDK. For information on Pragma Engine backend classes and plugins, see Party Backend Reference.
Party API #
Developers can use the PartyAPI SDK for Unreal and Unity to implement Party service capabilities, such as assigning a party leader and leaving a party.
The table below contains a list of the SDK methods relevant to the Party service. These methods are available via the Party API for Unreal or Unity.
Call | description |
---|---|
Initialize | Initializes the client’s party API state and synchronizes party state with the platform. Must be called prior to using other functionality on the API. |
ForceSync | Forcibly synchronizes the player client party cache with the party information in the Pragma Engine backend. This includes refreshing received party invite data. |
CreateParty | Creates a new party |
SendPartyInvite | Sends a party invite to a specific player |
CancelPartyInvite | Cancels a sent party invite |
AcceptPartyInvite | Accepts another player’s invite to a party |
DeclinePartyInvite | Declines another player’s invite to a party |
JoinPartyWithInviteCode | Joins a party using an invite code |
JoinPartyWithId | Joins a party using a party ID |
LeaveParty | Leaves a party voluntarily |
AssignPartyLeader | Assigns a party leader |
KickPlayerFromParty | Forcibly removes a player from a party |
UpdatePartyPlayer | Updates custom party player information when in a party |
UpdateParty | Updates custom party information |
SetPartyPlayerReady | Sets the player’s Ready value |
SetPartyPreferredGameServerZones | Updates the GameServerZones value for the party |
SetPartyPlayerGameServerZoneToPing | Updates the GameServerZoneToPing value for the party |
EnterMatchmaking | Enters the party into matchmaking once all players are ready. Only a party leader can enter a party into matchmaking. |
LeaveMatchmaking | Removes a party from matchmaking |
GetMatchmakingInfo | Gets matchmaking queue information |
GetPartyCache | Gets the player’s party cache |
GetReceivedPartyInvites | Gets a list of received party invites for the player |
GetReceivedPartyInviteByInviteId | Gets party invite object by party invite ID |
GetReceivedPartyInviteByInviterId | Gets party invite object for invite sent by a specified player to the current player |
The Party Tasks explains how to use these calls to invoke Party Plugin methods and customize party functionality.
Unreal classes #
The SDK for Unreal makes use of Pragma-defined Unreal classes. The following sections list methods available on each class:
FPragmaParty #
method | returns |
---|---|
GetId() | party ID |
GetInviteCode() | party invite code |
GetPreferredGameServerZones() | Array of preferred game server zones |
GetPlayers() | List of FPragmaPartyPlayers |
GetInvites() | List of FPragmaPartyInvites |
GetExt() | FPragma_Party_ExtBroadcastParty |
GetExtPrivatePlayer() | FPragma_Party_ExtPrivatePlayer |
GetPlayer | FPragmaPartyPlayer |
GetLeader() | FPragmaPartyPlayer for party leader |
GetAllLeaders() | FPragmaPartyPlayer for each party leader |
IsLeader(const FString& PlayerId) | true/false |
GetNumPlayers() | number of players in the party |
AreAllPlayersReady() | true/false |
IPragmaPartyCache #
method | returns |
---|---|
IsInParty() | true/false |
Party | FPragmaParty |
LocalPartyPlayer | FPragmaPartyPlayer |
FPragmaPartyInvite #
method | returns |
---|---|
GetInviteId() | invite ID |
GetInviterId() | inviter ID |
GetInviteeId() | invitee ID |
FPragmaPartyPlayer #
method | returns |
---|---|
GetPlayerId() | player ID |
GetSocialId() | social ID |
GetDisplayName() | Pragma account display name |
IsReady() | true/false |
IsLeader() | true/false |
GetExt() | FPragma_Party_ExtBroadcastPlayer |
Events #
There are several party-related events that player clients can listen to. The following table contains bindable events relevant to the Party service, along with associated descriptions of when the event is triggered.
The following events are defined in the Party API for Unreal and Unity.
Event | Trigger | Data returned |
---|---|---|
OnJoinedParty | A player joins a party | FPragmaParty |
OnPartyUpdated | Party information changes, including creation and destruction Note: All other applicable On* events fire in addition to this one, so developers will need to account for handling multiple events at once. | FPragmaParty |
OnPartyInviteCodeChanged | A new invite code is made for the party | invite code |
OnExtBroadcastPartyChanged | The public ext party selections change | ExtBroadcastParty |
OnPartyPreferredGameServerZonesChanged | A party’s preferred game server zones change | Array of preferred game server zones |
OnLeftParty | Your player leaves the party voluntarily | N/A |
OnRemovedFromParty | Your player leaves a party for reasons outside of your control | Removal reason (REMOVAL_REASON_UNSPECIFIED , KICKED , LEFT , DISCONNECTED , or EXPIRED ) |
OnPartyPlayersChanged | One or more players join or leave the party | List of FPragmaPartyPlayers |
OnPlayerJoinedParty | A new player joins the party. All players in the party can handle this event | FPragmaPartyPlayer for the player that joined the party |
OnPlayerLeftParty | A player leaves the party | FPragmaPartyPlayer for the player that left the party |
OnPartyPlayerDataChanged | Any player information changes | FPragmaPartyPlayer for the player whose data changed |
OnExtPrivatePlayerChanged | A player’s private selections changes | ExtPrivatePlayer |
OnReceivedPartyInvitesChanged | A received party invite changes | List of FPragmaPartyInvites |
OnPartyInviteReceived | A party invite is received from another player | FPragmaPartyInvite |
OnReceivedPartyInvitesCancelled | A received party invite is canceled by the inviter | FPragmaPartyInvite |
OnPartyInviteRevoked | A received party invite is removes because a new invite from the same player is received | invite ID |
OnPartyInviteSent | Any player in the party sends an invite. Fires for all players in the party. | FPragmaPartyInvite |
OnPartyInviteAccepted | An invitee joins the party. Fires for all players in the party. | FPragmaPartyInvite |
OnPartyInviteDeclined | An invitee declines the invite. Fires for all players in the party. | FPragmaPartyInvite |
OnPartyInviteCancelled | An inviter or party leader cancels a sent party invite. Fires for all players in the party. | FPragmaPartyInvite |
OnGameClientVersionUpdateRequired | The player client needs to update their GameClientVersion | N/A |
OnPartyClientVersionMismatch | Cannot find a game server version that is compatible with every player in the party | N/A |
OnEnteredMatchmaking | Party enters matchmaking | N/A |
OnLeftMatchmaking | Party leaves matchmaking | N/A |
OnMatchmakingFailed | There is a failure in matchmaking | Failure reason (UNSPECIFIED or GAME_SERVER_VERSION_NO_LONGER_COMPATIBLE ) |