Exemple #1
0
        /// <summary>
        /// 邮件列表
        /// </summary>
        private void OnMailList(PacketBase packet)
        {
            c2ss.MailList msg    = packet as c2ss.MailList;
            Player        player = UnitManager.Instance.GetPlayerByClientUID(msg.client_uid);

            if (player == null)
            {
                Log.Debug("OnMailList 未找到unit:" + msg.client_uid.srv_uid + ", " + msg.client_uid.conn_idx);
                return;
            }
            Mailbox mail_box = MailboxManager.Instance.GetMailBox(player.char_idx);

            if (mail_box != null)
            {
                mail_box.HandleReqList();
            }
        }
        public void Tick()
        {
            //存盘
            int     update_count = 0;
            Mailbox mail_box     = null;

            foreach (var obj in m_mailboxs)
            {
                mail_box = obj.Value as Mailbox;
                if (mail_box != null && mail_box.NeedSave())
                {
                    mail_box.Save();
                    if (++update_count > 60)
                    {
                        break;                     //当次循环最大保存数量
                    }
                }
            }
        }