Exemplo n.º 1
0
        private void RecieveClientCommands()
        {
            byte[] bytes       = ReadData(sizeof(int), _networkStream);
            int    numCommands = BitConverter.ToInt32(bytes, 0);

            _mapPlayer.AttemptedMove = false;

            for (int i = 0; i < numCommands; i++)
            {
                bytes = ReadData(sizeof(int), _networkStream);
                int commandSize = BitConverter.ToInt32(bytes, 0);

                bytes = ReadData(commandSize, _networkStream);
                ClientCommand command = ClientCommand.FromBytes(bytes);
                _mapPlayer.RecieveClientCommand(command);
            }
        }