Ejemplo n.º 1
0
void APlayerState::UnregisterPlayerWithSession()
{
	if (GetNetMode() == NM_Client && UniqueId.IsValid())
	{
		const APlayerState* PlayerState = GetDefault<APlayerState>();
		if (PlayerState->SessionName != NAME_None)
		{
			IOnlineSessionPtr SessionInt = Online::GetSessionInterface(GetWorld());
			if (SessionInt.IsValid())
			{
				// Remove the player from the session
				SessionInt->UnregisterPlayer(PlayerState->SessionName, *UniqueId);
			}
		}
	}
}