Beispiel #1
0
        /// <summary>
        /// Update KCP
        /// </summary>
        public void UpdateKcp()
        {
            if (m_kcp == null)
            {
                return;
            }

            UInt32 current = TimeUtil.timeMsec;

            if (m_updateDirty || current >= m_nextUpdateTime)
            {
                m_kcp.Update(current);
                m_nextUpdateTime = m_kcp.Check(current);
                m_updateDirty    = false;
            }
        }
Beispiel #2
0
        public void UpdateKcp()
        {
            if (m_kcp == null)
            {
                return;
            }

            uint current = TimeUtil.timeMsec;

            if (m_updateDirty || current >= m_nextUpdateTime)
            {
                m_updateDirty = false;
                try
                {
                    m_kcp.Update(current);
                    m_nextUpdateTime = m_kcp.Check(current);
                }
                catch (Exception e)
                {
                    Close(e.Message);
                }
            }
        }