Example #1
0
 public CMail(COM_MAIL_TYPE mailType, ref CSDT_GETMAIL_RES pkg)
 {
     this.mailType  = mailType;
     this.subType   = pkg.bMailType;
     this.mailIndex = pkg.iMailIndex;
     this.mailState = pkg.bMailState;
     this.autoDel   = (pkg.bAutoDel > 0);
     this.from      = Utility.UTF8Convert(pkg.szFrom);
     this.sendTime  = pkg.dwSendTime;
     this.subject   = Utility.UTF8Convert(pkg.szSubject, (int)pkg.bSubjectLen);
 }
Example #2
0
 public CMail(COM_MAIL_TYPE mailType, ref CSDT_GETMAIL_RES pkg)
 {
     this.accessUseable = new ListView <CUseable>();
     this.mailType      = mailType;
     this.subType       = pkg.bMailType;
     this.mailIndex     = pkg.iMailIndex;
     this.mailState     = (COM_MAIL_STATE)pkg.bMailState;
     this.autoDel       = pkg.bAutoDel > 0;
     this.from          = Utility.UTF8Convert(pkg.szFrom);
     this.sendTime      = pkg.dwSendTime;
     this.subject       = Utility.UTF8Convert(pkg.szSubject, pkg.bSubjectLen);
 }
Example #3
0
        public CMail(CustomMailType mailType, ref CSDT_ASKFORREQ_DETAIL pkg)
        {
            this.mailType  = mailType;
            this.subType   = (byte)mailType;
            this.mailIndex = pkg.iReqIndex;
            this.mailState = ((pkg.bIsRead > 0) ? COM_MAIL_STATE.COM_MAIL_HAVEREAD : COM_MAIL_STATE.COM_MAIL_UNREAD);
            this.autoDel   = false;
            this.from      = Utility.UTF8Convert(pkg.stReqInfo.szAcntName);
            this.sendTime  = pkg.stReqInfo.dwReqTime;
            COM_ITEM_TYPE wItemType = (COM_ITEM_TYPE)pkg.stReqInfo.stReqItem.wItemType;
            uint          dwItemID  = pkg.stReqInfo.stReqItem.dwItemID;
            int           dwItemCnt = (int)pkg.stReqInfo.stReqItem.dwItemCnt;
            CUseable      cUseable  = CUseableManager.CreateUseable(wItemType, dwItemID, dwItemCnt);

            if (cUseable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN)
            {
                this.subject = string.Format(Singleton <CTextManager> .GetInstance().GetText("HeroSkinBuy_Ask_For_Mail_Title_Skin"), cUseable.m_name);
            }
            else
            {
                this.subject = string.Format(Singleton <CTextManager> .GetInstance().GetText("HeroSkinBuy_Ask_For_Mail_Title_Hero"), cUseable.m_name);
            }
            if (pkg.stReqInfo.stMsgInfo.bMsgType == 1)
            {
                this.mailContent = StringHelper.UTF8BytesToString(ref pkg.stReqInfo.stMsgInfo.stMsgInfo.stMsgString.szContentStr);
                if (string.IsNullOrEmpty(this.mailContent))
                {
                    this.mailContent = string.Format(Singleton <CTextManager> .GetInstance().GetText("HeroSKinBuy_Ask_For_Default_Msg"), cUseable.m_name);
                }
            }
            else
            {
                uint  dwMsgID = pkg.stReqInfo.stMsgInfo.stMsgInfo.stMsgIDInfo.dwMsgID;
                ulong num     = Convert.ToUInt64(dwMsgID);
                num <<= 32;
                int              num2      = Convert.ToInt32(wItemType);
                long             key       = (long)(num + (ulong)((long)num2));
                ResAskforTemplet dataByKey = GameDataMgr.askForTemplateDatabin.GetDataByKey(key);
                if (dataByKey == null)
                {
                    this.mailContent = string.Format(Singleton <CTextManager> .GetInstance().GetText("HeroSKinBuy_Ask_For_Default_Msg"), cUseable.m_name);
                }
                else
                {
                    this.mailContent = string.Format(dataByKey.szContent, cUseable.m_name);
                }
            }
            this.accessUseableGeted = 0;
            this.accessUseable.Clear();
            this.accessUseable.Add(cUseable);
        }
Example #4
0
 public void Read(CSDT_MAILOPTRES_READMAIL pkg)
 {
     this.isReceive = true;
     this.accessUseable.Clear();
     this.mailState = (COM_MAIL_STATE)pkg.bMailState;
     this.ParseContentAndHyperlink(pkg.szContent, pkg.wContentLen, ref this.mailContent, ref this.mailHyperlink);
     this.accessUseableGeted = 0;
     this.accessUseable      = CMailSys.StAccessToUseable(pkg.astAccess, null, pkg.bAccessCnt);
     for (int i = 0; i < this.accessUseable.Count; i++)
     {
         if (pkg.astAccess[i].bGeted == 1)
         {
             this.accessUseableGeted |= ((int)1) << i;
         }
     }
 }
Example #5
0
 public CMail(CustomMailType mailType, ref CSDT_GETMAIL_RES pkg)
 {
     this.mailType           = mailType;
     this.subType            = pkg.bMailType;
     this.mailIndex          = pkg.iMailIndex;
     this.mailState          = (COM_MAIL_STATE)pkg.bMailState;
     this.autoDel            = (pkg.bAutoDel > 0);
     this.from               = Utility.UTF8Convert(pkg.szFrom);
     this.sendTime           = pkg.dwSendTime;
     this.subject            = Utility.UTF8Convert(pkg.szSubject, (int)pkg.bSubjectLen);
     this.accessUseableGeted = 0;
     this.accessUseable.Clear();
     this.accessUseable = CMailSys.StAccessToUseable(pkg.astAccess, null, (int)pkg.bAccessCnt);
     for (int i = 0; i < this.accessUseable.Count; i++)
     {
         if (pkg.astAccess[i].bGeted == 1)
         {
             this.accessUseableGeted |= 1 << i;
         }
     }
 }
Example #6
0
 public void Read()
 {
     this.isReceive = true;
     this.mailState = COM_MAIL_STATE.COM_MAIL_HAVEREAD;
 }
Example #7
0
 public void Read(CSDT_MAILOPTRES_READMAIL pkg)
 {
     this.isReceive = true;
     this.mailState = (COM_MAIL_STATE)pkg.bMailState;
     this.ParseContentAndHyperlink(pkg.szContent, (int)pkg.wContentLen, ref this.mailContent, ref this.mailHyperlink);
 }