Skip to main content

Destroying a lobby

When the host of a lobby no longer needs it, they should destroy the lobby.

caution

Destroying a lobby will kick all players from the lobby.

To destroy a lobby, you'll need the ID of the lobby you previously connected to and call DestroyLobby like so:

if (!Lobby->DestroyLobby(
*LocalUserId,
*LobbyId,
FOnLobbyOperationComplete::CreateLambda([](
const FOnlineError & Error,
const FUniqueNetId & UserId)
{
if (Error.WasSuccessful())
{
// The lobby was destroyed successfully.
}
else
{
// Lobby could not be destroyed.
}
})))
{
// Call failed to start.
}