예제 #1
0
        private void SendLaunchPosition(byte pos, byte speed)
        {
            SetSimulatorTarget(pos, speed);

            if (_network == null)
            {
                return;
            }

            if (!_pauseLaunchMessages.val)
            {
                _launchData[0] = pos;
                _launchData[1] = speed;

                float dist     = Mathf.Abs(pos - _lastSentLaunchPos);
                float duration = LaunchUtils.PredictMoveDuration(dist, speed);

                var durationData = BitConverter.GetBytes(duration);
                _launchData[2] = durationData[0];
                _launchData[3] = durationData[1];
                _launchData[4] = durationData[2];
                _launchData[5] = durationData[3];

                //SuperController.LogMessage(string.Format("Sending: P:{0}, S:{1}, D:{2}", pos, speed, duration));

                _network.Send(_launchData, _launchData.Length);

                _lastSentLaunchPos = pos;
            }
        }
예제 #2
0
파일: VAMLaunch.cs 프로젝트: qdot/VAMLaunch
        private void SendLaunchPosition(byte pos, byte speed)
        {
            SetSimulatorTarget(pos, speed);

            if (_network == null)
            {
                return;
            }

            if (!_pauseLaunchMessages.val)
            {
                _launchData[0] = pos;
                _launchData[1] = speed;
                _network.Send(_launchData, _launchData.Length);
            }
        }