Exemplo n.º 1
0
        public void Tick(uint currentTimeMS)
        {
            DoReceiveInMain();

            uint current = currentTimeMS;

            if (m_NeedKcpUpdateFlag || current >= m_NextKcpUpdateTime)
            {
                m_Kcp.Update(current);
                m_NextKcpUpdateTime = m_Kcp.Check(current);
                m_NeedKcpUpdateFlag = false;
            }
        }
Exemplo n.º 2
0
        public void Tick()
        {
            if (Connected)
            {
                DoReceiveInMain();

                uint current = (uint)TimeUtils.GetTotalMillisecondsSince1970();

                if (m_NeedKcpUpdateFlag || current >= m_NextKcpUpdateTime)
                {
                    m_Kcp.Update(current);
                    m_NextKcpUpdateTime = m_Kcp.Check(current);
                    m_NeedKcpUpdateFlag = false;
                }
            }
            else
            {
                //处理重连
            }
        }