Create a Party
Last updated on
Players can create a party that can be used for matchmaking. A player can only create one party at a time and will become the leader of the party they create.
- Unreal Engine
- Unity
FRegistry::Lobby.SetCreatePartyResponseDelegate(Lobby::FPartyCreateResponse::CreateLambda([](FAccelByteModelsCreatePartyResponse result)
{
UE_LOG(LogAccelByteLobbyTest, Log, TEXT("Create Party Success!"));
if (result.PartyId.IsEmpty())
{
UE_LOG(LogAccelByteLobbyTest, Log, TEXT("Create Party Error!"));
}
}));
FRegistry::Lobby.Connect();
FRegistry::Lobby.SendCreatePartyRequest();
//Create Party
PartyInfo partyInfo;
var lobby = AccelBytePlugin.GetLobby();
lobby.CreateParty(result =>
{
if(result.IsError)
{
Debug.Log("Error. Code: " + result.Error.Code + ", Reason: " + result.Error.Message);
}
else
{
partyInfo = result.Value;
Debug.Log("Successfully create a party");
}
});