public void OnPlayerPing(Msg_G2C_PlayerPing msg)
        {
            //PushServerFrames(frames, isNeedDebugCheck);
            var ping = LTime.realtimeSinceStartupMS - msg.sendTimestamp;

            _pings.Add(ping);
            if (ping > _maxPing)
            {
                _maxPing = ping;
            }
            if (ping < _minPing)
            {
                _minPing = ping;
                _guessServerStartTimestamp = (LTime.realtimeSinceStartupMS - msg.timeSinceServerStart) - _minPing / 2;
            }

            //Debug.Log("OnPlayerPing " + ping);
        }
Example #2
0
        public void OnPlayerPing(Msg_G2C_PlayerPing msg)
        {
            long num = LTime.realtimeSinceStartupMS - msg.SendTimestamp;

            this._pings.Add(num);
            bool flag = num > this._maxPing;

            if (flag)
            {
                this._maxPing = num;
            }
            bool flag2 = num < this._minPing;

            if (flag2)
            {
                this._minPing = num;
                this._guessServerStartTimestamp = LTime.realtimeSinceStartupMS - msg.TimeSinceServerStart - this._minPing / 2L;
            }
        }
 public void OnPlayerPing(Msg_G2C_PlayerPing msg)
 {
     this._cmdBuffer.OnPlayerPing(msg);
 }
        private void OnEvent_OnPlayerPing(object param)
        {
            Msg_G2C_PlayerPing msg = param as Msg_G2C_PlayerPing;

            this.OnPlayerPing(msg);
        }
Example #5
0
        protected void G2C_PlayerPing(object reader)
        {
            Msg_G2C_PlayerPing param = reader as Msg_G2C_PlayerPing;

            EventHelper.Trigger(EEvent.OnPlayerPing, param);
        }