Example #1
0
        public void UpdateThread()
        {
            _network = new VAMLaunchNetwork();
            if (!_network.Init(SERVER_IP, SERVER_LISTEN_PORT, SERVER_SEND_PORT))
            {
                return;
            }

            _running = true;

            Console.WriteLine("SERVER IS ON");

            _timeOfLastLaunchUpdate = DateTime.Now;

            while (_running)
            {
                lock (_inputLock)
                {
                    _userCmd = null;
                }

                ProcessNetworkMessages();
                UpdateMovement();

                if (_running)
                {
                    Thread.Sleep(1000 / NETWORK_POLL_RATE);
                }
            }

            _network.Stop();
        }
Example #2
0
        public void UpdateThread()
        {
            _network = new VAMLaunchNetwork();
            if (!_network.Init(SERVER_IP, SERVER_LISTEN_PORT, SERVER_SEND_PORT))
            {
                return;
            }

            _running = true;

            Console.WriteLine("SERVER IS ON");
            Console.WriteLine("Your Launch device is ready to go when your device shows a solid blue light.");
            Console.WriteLine("Note: You can type the command \"lc\" to attempt to re-establish communication.");

            _timeOfLastLaunchUpdate = DateTime.Now;

            while (_running)
            {
                lock (_inputLock)
                {
                    _userCmd = null;
                }

                ProcessNetworkMessages();
                UpdateMovement();

                if (_running)
                {
                    Thread.Sleep(1000 / NETWORK_POLL_RATE);
                }
            }

            _network.Stop();
        }