Ejemplo n.º 1
0
        private void ClientDisconnect(ClientHandler client)
        {
            if (client.StatusClient == Status.Playing)
            {
                var opp = games.GetOpponent(client.Name);
                lock (opp)
                {
                    lock (playingPool)
                    {
                        playingPool.Remove(client);
                    }
                    lock (games)
                    {
                        games.StopGame(client.Name);
                        client.StopPlayingDisk();
                    }
                    GetClientByName(opp).StopPlayingDisk();
                }
            }

            lock (verifiedPool)
            {
                verifiedPool.Remove(client);
            }
            lock (onlinePool)
            {
                onlinePool.Remove(client);
            }
            lock (waitingPool)
            {
                waitingPool.Remove(client);
            }
            lock (waitingPool)
            {
                playingPool.Remove(client);
            }
        }