Skip to main content
Multiplayer

Parties

warning

Requires EOSCore 2.2.0 and later.

The Online Subsystem implements IOnlinePartySystem on top of EOS Lobbies. Use it to keep a group of friends together between matches, with invites, party data, presence and a voice room.

This is a C++ interface, get it with GetPartyInterface(). There are no Blueprint nodes for it. In Blueprint, use the EOSCore > Lobby functions, see Lobby.

Requirements​

  • The player is logged in to the EOSCore Online Subsystem with a Product User ID.
  • Lobbies are enabled for your product, and the client policy allows the lobby actions.
  • For invites through the EOS overlay and for presence, the player also needs an Epic Account login.

How parties use lobbies​

  • A party is a lobby in the bucket EOSCoreParty:<PartyTypeId>. Session lobbies and party lobbies never show up in each other's searches.
  • One party per party type and local player. CreateParty fails with AlreadyInPartyOfSpecifiedType when the player is already in a party of that type.
  • MaxMembers of the party configuration is the lobby size, 4 when it is not set, and at most the EOS lobby limit.
  • PresencePermissions set to Noone or Leader makes the lobby invite only. Other values allow joining through presence.
  • InvitePermissions set to Noone turns invites off.
  • The party configuration is stored in the lobby attribute EOSCORE_PARTYCONFIG, so every member reads the same configuration.

Functions​

AreaFunctions
PartiesCreateParty, JoinParty, LeaveParty, UpdateParty, GetJoinedParties, GetParty, CleanupParties
MembersGetPartyMembers, GetPartyMember, GetPartyMemberCount, IsMemberLeader, KickMember, PromoteMember
InvitesSendInvitation, RejectInvitation, ClearInvitations, GetPendingInvites, GetPendingInvitedUsers, RestoreInvites
DataUpdatePartyData, UpdatePartyMemberData, GetPartyData, GetPartyMemberData
Join infoMakeJoinInfo, MakeJoinInfoJson, MakeJoinInfoFromJson, MakeTokenFromJoinInfo, MakeJoinInfoFromToken, QueryPartyJoinability
  • Invites are EOS lobby invites. RestoreInvites downloads the pending invites with EOS_Lobby_QueryInvites. Accepting an invite or using Join in the EOS overlay joins the party, and leaves a party of the same type first.
  • Party data and member data are stored as lobby and lobby member attributes, one attribute per key, named <Namespace>:<Key>. Only the party leader can call UpdatePartyData. Each member updates its own member data.
  • The member display name is stored in the member attribute EOSCORE_DISPLAYNAME.
  • Join info works with the lobby id. A token from MakeTokenFromJoinInfo can be sent to a friend another way, and MakeJoinInfoFromToken turns it back into join info for JoinParty.

Delegates​

DelegateCalled when
OnPartyJoined, OnPartyExitedThe local player joins or leaves a party
OnPartyStateChangedThe state of a party changes, for example while it is created or left
OnPartyMemberJoined, OnPartyMemberExited, OnPartyMemberPromotedA member joins, leaves or becomes the leader
OnPartyConfigChangedThe party configuration changes
OnPartyDataReceived, OnPartyMemberDataReceivedParty data or member data changes
OnPartyInviteReceivedEx, OnPartyInviteRemovedEx, OnPartyInvitesChangedAn invite is received or removed

Presence and voice​

  • With Enable Party Presence (on by default), the party lobby is created and joined with presence, so friends see the party in EOS presence. With the Steam Integrated Platform it is shown in Steam too. EOS allows only one lobby with presence: when another lobby already has presence, the party is created or joined without it.
  • With Enable Party Voice Chat (on by default) and bChatEnabled in the party configuration, the lobby gets an RTC voice room that joins automatically. The IVoiceChat interface adds it as a channel named after the lobby id. Enable RTC must be on in your EOS configuration.

See Project Settings.

Example​

#include "OnlineSubsystem.h"
#include "OnlineSubsystemUtils.h"
#include "Interfaces/OnlinePartyInterface.h"
#include "Interfaces/OnlineIdentityInterface.h"

void AMyPlayerController::CreatePartyAndInvite(FUniqueNetIdRef FriendId)
{
IOnlineSubsystem* Subsystem = Online::GetSubsystem(GetWorld(), TEXT("EOSCore"));
IOnlinePartyPtr Party = Subsystem ? Subsystem->GetPartyInterface() : nullptr;
FUniqueNetIdPtr LocalUserId = Subsystem ? Subsystem->GetIdentityInterface()->GetUniquePlayerId(0) : nullptr;
if (!Party.IsValid() || !LocalUserId.IsValid())
{
return;
}

FPartyConfiguration Config;
Config.MaxMembers = 4;
Config.bChatEnabled = true;
Config.PresencePermissions = PartySystemPermissions::EPermissionType::Friends;
Config.InvitePermissions = PartySystemPermissions::EPermissionType::Anyone;

Party->CreateParty(*LocalUserId, IOnlinePartySystem::GetPrimaryPartyTypeId(), Config, FOnCreatePartyComplete::CreateLambda([Party, FriendId](const FUniqueNetId& LocalUserId, const TSharedPtr<const FOnlinePartyId>& PartyId, const ECreatePartyCompletionResult Result)
{
if (Result == ECreatePartyCompletionResult::Succeeded && PartyId.IsValid())
{
Party->SendInvitation(LocalUserId, *PartyId, FPartyInvitationRecipient(*FriendId));
}
}));
}

On the friend's side, bind OnPartyInviteReceivedEx and call JoinParty with the invite, or let the player accept the invite in the EOS overlay.

Not supported​

EOS lobbies have no join requests and invites can't be cancelled. These functions do nothing, return an empty result or fail through their delegate:

  • Join requests: ApproveJoinRequest, GetPendingJoinRequests and RespondToQueryJoinability.
  • Request to join: RequestToJoinParty fails, GetPendingRequestsToJoin returns an empty list and ClearRequestToJoinParty does nothing.
  • Join in progress (JIPFromWithinParty, ApproveJIPRequest) on engine versions that still have it.
  • CancelInvitation, GetAdvertisedParty and ConsumePendingCommandLineInvite.
  • RestoreParties succeeds without restoring anything.