Leave a Party
Last updated on
Party members can choose to leave their party. If the party leader leaves the party, party leadership will be passed to another party member automatically. Party members that leave the party will receive a notification that they've left the party and current party members will also receive a notification that someone is leaving the party.
- Unreal Engine
- Unity
FRegistry::Lobby.Connect();
FRegistry::Lobby.SetLeavePartyResponseDelegate(AccelByte::Api::Lobby::FPartyLeaveResponse::CreateLambda([](const FAccelByteModelsLeavePartyResponse& Result)
{
if (Result.Code == "0")
{
// Do something if LeavePartyResponseDelegate has been successful
}
else
{
// Do something if LeavePartyResponseDelegate has an error
}
}));
FRegistry::Lobby.SendLeavePartyRequest();
AccelBytePlugin.GetLobby().Connect();
AccelBytePlugin.GetLobby().LeaveParty(result =>
{
if (result.IsError)
{
// Do something if LeaveParty has an error
Debug.Log($"Error LeaveParty, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if LeaveParty has been successful
}
});