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; } }
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 { //处理重连 } }