Exemplo n.º 1
0
        /// <summary>
        /// Remove a client from all of the data in the connector.
        /// </summary>
        /// <param name="client">
        /// The client that we wish to remove.
        /// </param>
        public void RemoveClient(IClient client)
        {
            Player      p    = connector.GetPlayer(client);
            ISearchGame game = connector.GetGame(p);

            // remove the clients player from his current game
            game?.RemovePlayer(p);
            // delete the clients player from the server
            connector.DeleteClient(client);
            // delete the game if the forfeit of the player made it end
            if (!ReferenceEquals(game, null) && game.HasEnded())
            {
                connector.DeleteGame(game);
            }
        }