Esempio n. 1
0
        public MailInfo GetMail(ModuleMailInfo moduleMailInfo, UserInfo user, bool onlyAttachment)
        {
            DateTime         day   = moduleMailInfo.m_SendTime;
            ArenaPrizeConfig prize = GetDayPrize(user.Guid, day);

            if (prize == null)
            {
                //LogSys.Log(LOG_TYPE.DEBUG, "not find player {0} date {1} prize!", user.Guid, day);
                return(null);
            }
            MailInfo mail = moduleMailInfo.NewDerivedMailInfo();

            if (!onlyAttachment)
            {
                mail.m_Title  = "$1111$";
                mail.m_Text   = "$1112$";
                mail.m_Sender = "$1113$";
            }
            mail.m_Gold  = prize.Gold;
            mail.m_Money = prize.Money;
            foreach (PrizeItemConfig item_config in prize.Items)
            {
                MailItem mail_item = new MailItem();
                mail_item.m_ItemId  = item_config.ItemId;
                mail_item.m_ItemNum = item_config.ItemNum;
                mail.m_Items.Add(mail_item);
            }
            //LogSys.Log(LOG_TYPE.DEBUG, "player {0} got arena day {1} prize {2} isOnlyAttachment {3}", user.Guid, day, prize.Gold, onlyAttachment);
            return(mail);
        }
Esempio n. 2
0
        public MailInfo GetMail(ModuleMailInfo moduleMailInfo, UserInfo user, bool onlyAttachment)
        {
            MailInfo mailInfo = null;

            mailInfo = moduleMailInfo.NewDerivedMailInfo();
            if (!onlyAttachment)
            {
                mailInfo.m_Title  = "$1$";
                mailInfo.m_Text   = "$2$";
                mailInfo.m_Sender = "$3$";
            }
            int      gowElo   = 0;
            DateTime sendDate = mailInfo.m_SendTime.Date;
            DateTime sendTime = new DateTime(sendDate.Year, sendDate.Month, sendDate.Day, m_PrizeTime.m_Hour, m_PrizeTime.m_Minute, m_PrizeTime.m_Second);
            long     key      = sendTime.ToBinary();
            SortedList <long, int> history = user.GowInfo.HistoryGowElos;

            foreach (long key0 in history.Keys)
            {
                if (key >= key0)
                {
                    gowElo = history[key0];
                    break;
                }
            }
            if (gowElo > 0)
            {
                GowPrizeConfig cfg = GowConfigProvider.Instance.FindGowPrizeConfig(user.GowInfo.RankId);
                if (null != cfg)
                {
                    mailInfo.m_Money = cfg.Money;
                    mailInfo.m_Gold  = cfg.Gold;
                    foreach (GowPrizeItem item_config in cfg.Items)
                    {
                        MailItem mail_item = new MailItem();
                        mail_item.m_ItemId  = item_config.ItemId;
                        mail_item.m_ItemNum = item_config.ItemNum;
                        mailInfo.m_Items.Add(mail_item);
                    }
                    return(mailInfo);
                }
            }
            return(null);
        }