public override void Update(double newTime)
 {
     packetController.Update(newTime);
 }
        public override void Update(double newTime)
        {
            double num = newTime - time;

            time = newTime;
            packetController.Update(time);
            if (messageQueue.Count > 0)
            {
                int    num2 = 0;
                ushort num3 = oldestUnacked;
                while (PacketIO.SequenceLessThan(num3, sequence))
                {
                    if (sendBuffer.Exists(num3))
                    {
                        num2++;
                    }
                    num3 = (ushort)(num3 + 1);
                }
                if (num2 < sendBuffer.Size)
                {
                    ByteBuffer byteBuffer = messageQueue.Dequeue();
                    SendMessage(byteBuffer.InternalBuffer, byteBuffer.Length);
                    ObjPool <ByteBuffer> .Return(byteBuffer);
                }
            }
            bool flag = packetController.RTT >= 250f;

            if (flag)
            {
                if (!congestionControl)
                {
                    if (time - lastCongestionSwitchTime < 10.0)
                    {
                        congestionDisableInterval = Math.Min(congestionDisableInterval * 2.0, 60.0);
                    }
                    lastCongestionSwitchTime = time;
                }
                congestionControl      = true;
                congestionDisableTimer = 0.0;
            }
            if (congestionControl && !flag)
            {
                congestionDisableTimer += num;
                if (congestionDisableTimer >= congestionDisableInterval)
                {
                    congestionControl        = false;
                    lastCongestionSwitchTime = time;
                    congestionDisableTimer   = 0.0;
                }
            }
            if (!congestionControl)
            {
                congestionDisableTimer += num;
                if (congestionDisableTimer >= 10.0)
                {
                    congestionDisableInterval = Math.Max(congestionDisableInterval * 0.5, 5.0);
                }
            }
            double num4 = (!congestionControl) ? 0.033 : 0.1;

            if (time - lastBufferFlush >= num4)
            {
                lastBufferFlush = time;
                processSendBuffer();
            }
        }