Join a Party
Last updated on
Players that are invited to a party can accept the invitation and join the party. Party invitees will receive a notification that they've joined the party and current party members will also receive a notification that someone is joining the party.
- Unreal Engine
- Unity
FRegistry::Lobby.Connect();
FRegistry::Lobby.SetInvitePartyJoinResponseDelegate(AccelByte::Api::Lobby::FPartyJoinResponse::CreateLambda([](const FAccelByteModelsPartyJoinReponse& Result)
{
if (Result.Code == "0")
{
// Do something if InvitePartyJoinResponseDelegate has been successful
}
else
{
// Do something if InvitePartyJoinResponseDelegate has an error
}
}));
FString PartyId = FString("SomePartyId");
FString InvitationToken = FString("SomeInvitationToken");
FRegistry::Lobby.SendAcceptInvitationRequest(PartyId, InvitationToken);
string partyId = "SomePartyId";
string invitationToken = "SomeActivationToken";
AccelBytePlugin.GetLobby().Connect();
AccelBytePlugin.GetLobby().JoinParty(partyId, invitationToken, result =>
{
if (result.IsError)
{
// Do something if JoinParty has an error
Debug.Log($"Error Join Party, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if JoinParty has been successful
}
});