void AGameSession::ReturnToMainMenuHost()
{
	FString RemoteReturnReason = NSLOCTEXT("NetworkErrors", "HostHasLeft", "Host has left the game.").ToString();
	FString LocalReturnReason(TEXT(""));

	APlayerController* Controller = NULL;
	FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator();
	for(; Iterator; ++Iterator)
	{
		Controller = *Iterator;
		if (Controller && !Controller->IsLocalPlayerController() && Controller->IsPrimaryPlayer())
		{
			// Clients
			Controller->ClientReturnToMainMenu(RemoteReturnReason);
		}
	}

	Iterator.Reset();
	for(; Iterator; ++Iterator)
	{
		Controller = *Iterator;
		if (Controller && Controller->IsLocalPlayerController() && Controller->IsPrimaryPlayer())
		{
			Controller->ClientReturnToMainMenu(LocalReturnReason);
			break;
		}
	}
}
void FPlatformerIngameMenu::ReturnToMainMenu()
{	
	APlatformerPlayerController * PlatformPC = (PCOwner.IsValid())? Cast<APlatformerPlayerController>(PCOwner.Get()) : NULL;
	FString RemoteReturnReason = NSLOCTEXT("NetworkErrors", "HostHasLeft", "Host has left the game.").ToString();
	FString LocalReturnReason(TEXT(""));

	if ( PlatformPC )
	{
		if (PlatformPC->GetNetMode() < NM_Client)
		{
			for(auto Iterator = PlatformPC->GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
			{
				APlayerController* Controller = *Iterator;
				if (Controller && Controller->IsPrimaryPlayer() && Controller != PlatformPC) 
				{
					Controller->ClientReturnToMainMenu(RemoteReturnReason);
				}
			}
			PlatformPC->ClientReturnToMainMenu(LocalReturnReason);
		}
		else
		{
			PlatformPC->ClientReturnToMainMenu(LocalReturnReason);
		}
	}
	DestroyRootMenu();

}