예제 #1
0
        public void GE_GetMailItemResult(GameEvent ge, EventParameter param)
        {
            MsgData_sGetMailItemResult data = param.msgParameter as MsgData_sGetMailItemResult;

            for (int i = 0; i < data.items.Count; i++)
            {
                if (data.items[i].result == -1)
                {
                    continue;
                }
                MailVo item = GetMailVo(data.items[i].id);
                if (item != null)
                {
                    item.item = data.items[i].result;
                }
            }
        }
예제 #2
0
        public MailVo GetMailVo(long id)
        {
            MailVo v = null;

            if (mMail.ContainsKey(id))
            {
                v = mMail[id];
            }
            else
            {
                v           = new MailVo();
                v.id        = id;
                v.read      = 0;
                v.sendTime  = 0;
                v.leftTime  = 0;
                v.mailTxtId = 0;
            }
            return(v);
        }
예제 #3
0
        public List <long> GetMail()
        {
            List <long> list = new List <long>(mMail.Keys);

            list.Sort(delegate(long a, long b)
            {
                MailVo ia = MailDataMgr.Instance.Mail[a];
                MailVo ib = MailDataMgr.Instance.Mail[b];

                if (ia.read == ib.read)
                {
                    return(-ia.sendTime.CompareTo(ib.sendTime));
                }
                else
                {
                    return(ia.read.CompareTo(ib.read));
                }
            });
            return(list);
        }
예제 #4
0
        public bool MainRed()
        {
            if (mMail == null)
            {
                return(false);
            }
            bool bRes = false;

            Dictionary <long, MailVo> .Enumerator iter = mMail.GetEnumerator();
            while (iter.MoveNext())
            {
                MailVo item = iter.Current.Value;
                if (item.item == 1)
                {
                    bRes = true;
                    break;
                }
            }
            return(bRes);
        }
예제 #5
0
        //副本信息
        public void UpdateMailVo(MsgData_sMailVo item)
        {
            MailVo v = new MailVo();

            v.id       = item.id;
            v.item     = item.item;
            v.read     = item.read;
            v.sendTime = item.sendTime;
            v.leftTime = item.leftTime;
            Array.Copy(item.mailtitle, v.mailtitle, v.mailtitle.Length);
            v.mailtitle = item.mailtitle;
            v.mailTxtId = item.mailTxtId;
            if (mMail.ContainsKey(v.id))
            {
                mMail[v.id] = v;
            }
            else
            {
                mMail.Add(v.id, v);
            }
        }
예제 #6
0
        public void GE_OpenMailResult(GameEvent ge, EventParameter param)
        {
            MsgData_sOpenMailResult data = param.msgParameter as MsgData_sOpenMailResult;
            MailVo item = GetMailVo(data.id);

            if (item != null)
            {
                item.openMail = new OpenMailResult();
                item.item     = data.item;
                item.read     = 1;
                Array.Copy(data.contnet, item.openMail.contnet, data.contnet.Length);
                for (int i = 0; i < item.openMail.items.Length; i++)
                {
                    if (data.items[i] != null)
                    {
                        item.openMail.items[i]           = new MailItemVo();
                        item.openMail.items[i].itemid    = data.items[i].itemid;
                        item.openMail.items[i].itemcount = data.items[i].itemcount;
                    }
                }
            }
        }