private void ExitLobby() { if (IsHosted) { TcpAsyncServer.StopInterfaceListening(); _udpServer.StopListen(); TcpAsyncServer.SafeCloseAllSockets(); } else { _client.Client.Socket.Close(); } Game.SceneManager.ActiveState = GameState.MainMenu; }
public override void Update(GameTime gameTime) { if (GMouse.IsButtonPressed(MouseButton.Left)) { if (Client.ReceiverGameData.WinPlayer != null) { Thread.Sleep(400); TcpAsyncServer.SafeCloseAllSockets(); Game.SceneManager.ActiveState = GameState.MainMenu; foreach (var label in PlayerLabels) { label.Clear(); } } SendShootData(); } foreach (var label in PlayerLabels) { label.Update(gameTime); } }