GameFramework.MailSystem.Tick C# (CSharp) Method

Tick() private method

private Tick ( ) : void
return void
        internal void Tick()
        {
            var ds_thread = UserServer.Instance.DataCacheThread;
            if (ds_thread.DataStoreAvailable) {
                if (!m_IsDataLoaded) {
                    return;
                }
            }
            long curTime = TimeUtility.GetLocalMilliseconds();
            if (m_LastTickTime + c_TickInterval < curTime) {
                m_LastTickTime = curTime;
                //清理过期邮件
                int ct = m_WholeMails.Count;
                for (int index = ct - 1; index >= 0; --index) {
                    MailInfo mailInfo = m_WholeMails[index];
                    if (null != mailInfo) {
                        if (mailInfo.m_ExpiryDate < DateTime.Now) {
                            m_WholeMails.RemoveAt(index);
                        }
                    }
                }
                foreach (KeyValuePair<ulong, List<MailInfo>> pair in m_UserMails) {
                    var mails = pair.Value;
                    int mailCt = mails.Count;
                    for (int index = mailCt - 1; index >= 0; --index) {
                        MailInfo mailInfo = mails[index];
                        if (null != mailInfo) {
                            if (mailInfo.m_ExpiryDate < DateTime.Now) {
                                mails.RemoveAt(index);
                            }
                        }
                    }
                }
            }
        }