Esempio n. 1
0
        /// <summary>
        /// Executes the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        /// <param name="client">The client.</param>
        /// <returns></returns>
        public string Execute(string[] args, TcpClient client, string closeConnection, string keepOpen)
        {
            string name = args[0];
            Game   game = model.GetGameFromWaitingList(name);

            if (game.GetFirstClient() != client)
            {
                game.Join(client);
                model.JoinToGame(name);
            }
            else
            {
                new Controller.NestedError("you need another client", client);
            }

            //UNLOCK START AND PLAYING!
            model.StartAndPlayingMutexRealese();
            return(keepOpen);
        }