Ejemplo n.º 1
0
        /// <summary>
        /// Disconnects all players from the server
        /// </summary>
        public void DisconnectAll()
        {
            Log.Info("Disconnecting all users");
            foreach (var player in ConnectedPlayers.Keys)
            {
                player.Disconnect();
                ConnectedPlayers[player].Abort(); //Kill the thread
            }

            ConnectedPlayers.Clear();
        }
Ejemplo n.º 2
0
 private void Cancel()
 {
     IsReady = false;
     try
     {
         lobbyServer.DisconnectFromLobby();
         ClientProxyManager.Instance.RemoveLobby();
     }
     catch (Exception)
     {
         MessageBox.Show("Connection lost.", "Hanksite", MessageBoxButton.OK);
         Application.Current.Shutdown();
         return;
     }
     ConnectedPlayers.Clear();
 }