コード例 #1
0
        private static void GetAttempts(PacketHeader packetheader, Connection connection, int numAttemptsClient)
        {
            _numAttempts = numAttemptsClient;

            //after choosing number of attempts, the secret combination can be created
            if (_mode == 0)
            {
                _secretCombination = _game.ComputerMove(_numColumns, _secretCombination);
                NetworkComms.SendObject("canTakeGuess", _destinationIpAddress1, _destinationPort1, 1);
            }
            else
            {
                //when player has selected number of columns and number of attempts
                //player 2 can chose secret Combination
                if (_connection2 != null)
                {
                    NetworkComms.SendObject("NumColumns", _destinationIpAddress2, _destinationPort2, _numColumns);
                }
            }
        }