예제 #1
0
        public bool getGiftCardData()
        {
            List <GiftCardData> giftCards = HttpAppMgr.instance.getGiftCards();

            this.giftCardDataDic.Clear();
            bool flag  = false;
            bool flag2 = giftCards.Count == 0;
            bool result;

            if (flag2)
            {
                result = flag;
            }
            else
            {
                foreach (GiftCardData current in giftCards)
                {
                    bool flag3 = current.cardType.functp == 4;
                    if (flag3)
                    {
                        mailData mailData = new mailData();
                        mailData.type    = 1;
                        mailData.code    = current.code;
                        mailData.acttm   = (float)current.cardType.acttm;
                        mailData.money   = current.cardType.money;
                        mailData.yb      = current.cardType.golden;
                        mailData.yinpiao = current.cardType.yinpiao;
                        mailData.msg     = current.cardType.desc;
                        debug.Log(mailData.msg);
                        bool flag4 = mailData.msg == "";
                        if (flag4)
                        {
                            mailData.msg = current.cardType.name;
                            debug.Log(mailData.msg + "名字");
                        }
                        mailData.seconds = current.cardType.acttm;
                        mailData.time    = BaseProxy <E_mailProxy> .getInstance().getTime(mailData.seconds.ToString());

                        bool flag5 = current.cardType.lItem != null;
                        if (flag5)
                        {
                            foreach (BaseItemData current2 in current.cardType.lItem)
                            {
                                mailItemData item = default(mailItemData);
                                item.id    = int.Parse(current2.id);
                                item.count = current2.num;
                                item.type  = 1;
                                mailData.items.Add(item);
                            }
                        }
                        this.systemMailDic.Add(mailData);
                        this.giftCardDataDic.Add(mailData, current);
                        flag = true;
                    }
                }
                result = flag;
            }
            return(result);
        }
예제 #2
0
        private void loadMailItems(Variant mail, mailData dta)
        {
            bool flag = mail.ContainsKey("itm");

            if (flag)
            {
                bool flag2 = mail["itm"].ContainsKey("money");
                if (flag2)
                {
                    dta.money = mail["itm"]["money"];
                }
                bool flag3 = mail["itm"].ContainsKey("yb");
                if (flag3)
                {
                    dta.yb = mail["itm"]["yb"];
                }
                bool flag4 = mail["itm"].ContainsKey("itm");
                if (flag4)
                {
                    bool flag5 = mail["itm"]["itm"]._arr.Count != 0;
                    if (flag5)
                    {
                        foreach (Variant current in mail["itm"]["itm"]._arr)
                        {
                            mailItemData item = default(mailItemData);
                            item.id    = current["item_id"];
                            item.count = current["cnt"];
                            item.type  = 1;
                            dta.items.Add(item);
                        }
                    }
                }
                bool flag6 = mail["itm"].ContainsKey("dress");
                if (flag6)
                {
                    bool flag7 = mail["itm"]["dress"]._arr.Count != 0;
                    if (flag7)
                    {
                        foreach (Variant current2 in mail["itm"]["dress"]._arr)
                        {
                            mailItemData item2 = default(mailItemData);
                            item2.id    = current2["id"];
                            item2.count = current2["cnt"];
                            item2.type  = 2;
                            dta.items.Add(item2);
                        }
                    }
                }
            }
        }
예제 #3
0
        public bool getGiftCardData()
        {
            List <GiftCardData> gifdta = HttpAppMgr.instance.getGiftCards();

            giftCardDataDic.Clear();
            bool ishaveCard = false;

            if (gifdta.Count == 0)
            {
                return(ishaveCard);
            }
            foreach (GiftCardData dta in gifdta)
            {
                if (dta.cardType.functp == 4)
                {
                    mailData maildta = new mailData();
                    maildta.type    = 1;
                    maildta.code    = dta.code;
                    maildta.acttm   = dta.cardType.acttm;
                    maildta.money   = dta.cardType.money;
                    maildta.yb      = dta.cardType.golden;
                    maildta.yinpiao = dta.cardType.yinpiao;
                    maildta.msg     = dta.cardType.desc;
                    debug.Log(maildta.msg);
                    if (maildta.msg == "")
                    {
                        maildta.msg = dta.cardType.name;
                        //debug.Log(maildta.msg + "名字");
                    }
                    maildta.seconds = dta.cardType.acttm;
                    maildta.time    = E_mailProxy.getInstance().getTime(maildta.seconds.ToString());
                    if (dta.cardType.lItem != null)
                    {
                        foreach (BaseItemData item in dta.cardType.lItem)
                        {
                            mailItemData d = new mailItemData();
                            d.id    = int.Parse(item.id);
                            d.count = item.num;
                            d.type  = 1;
                            maildta.items.Add(d);
                        }
                    }
                    systemMailDic.Add(maildta);
                    giftCardDataDic.Add(maildta, dta);
                    ishaveCard = true;
                }
            }
            return(ishaveCard);
        }
예제 #4
0
        void loadMailItems(Variant mail, mailData dta)
        {
            if (mail.ContainsKey("itm"))
            {
                if (mail["itm"].ContainsKey("money"))
                {
                    dta.money = mail["itm"]["money"];
                }
                if (mail["itm"].ContainsKey("yb"))
                {
                    dta.yb = mail["itm"]["yb"];
                }
                if (mail["itm"].ContainsKey("itm"))
                {
                    if (mail["itm"]["itm"]._arr.Count != 0)
                    {
                        foreach (Variant item in mail["itm"]["itm"]._arr)
                        {
                            mailItemData md = new mailItemData();
                            md.id    = item["item_id"];
                            md.count = item["cnt"];
                            md.type  = 1;
                            dta.items.Add(md);
                        }
                    }
                }

                if (mail["itm"].ContainsKey("dress"))
                {
                    if (mail["itm"]["dress"]._arr.Count != 0)
                    {
                        foreach (Variant item in mail["itm"]["dress"]._arr)
                        {
                            mailItemData md = new mailItemData();
                            md.id    = item["id"];
                            md.count = item["cnt"];
                            md.type  = 2;
                            dta.items.Add(md);
                        }
                    }
                }
            }
        }