public void Deserialize(GachaParam param)
 {
     if (param == null)
     {
         throw new InvalidCastException();
     }
     this.iname        = param.iname;
     this.category     = param.category;
     this.startat      = param.startat;
     this.endat        = param.endat;
     this.coin         = param.coin;
     this.gold         = param.gold;
     this.coin_p       = param.coin_p;
     this.units        = param.units;
     this.num          = param.num;
     this.ticket_iname = param.ticket_iname;
     this.ticket_num   = param.ticket_num;
     this.step         = param.step;
     this.step_num     = param.step_num;
     this.step_index   = param.step_index;
     this.limit        = param.limit;
     this.limit_num    = param.limit_num;
     this.limit_stock  = param.limit_stock;
     this.type         = string.Empty;
     this.asset_title  = param.asset_title;
     this.asset_bg     = param.asset_bg;
     this.group        = param.group;
     this.btext        = param.btext;
     this.confirm      = param.confirm;
     this.bonus_items  = param.bonus_items;
     this.artifacts    = param.artifacts;
     this.detail_url   = param.detail_url;
     this.reset_at     = param.reset_at;
     this.disabled     = param.disabled;
 }
Exemple #2
0
 private GachaTopParam2 Deserialize(GachaParam param)
 {
     if (param == null)
     {
         return((GachaTopParam2)null);
     }
     return(new GachaTopParam2()
     {
         iname = param.iname,
         category = param.category,
         coin = param.coin,
         coin_p = param.coin_p,
         gold = param.gold,
         num = param.num,
         ticket = param.ticket_iname,
         ticket_num = param.ticket_num,
         units = param.units,
         step = param.step,
         step_index = param.step_index,
         step_num = param.step_num,
         limit = param.limit,
         limit_num = param.limit_num,
         limit_stock = param.limit_stock,
         type = string.Empty,
         asset_bg = param.asset_bg,
         asset_title = param.asset_title,
         group = param.group,
         btext = param.btext,
         confirm = param.confirm
     });
 }
Exemple #3
0
        public void Reflesh()
        {
            bool flag = false;
            List <GachaParam> gachaParamList = (List <GachaParam>)null;

            switch (this.GachaType)
            {
            case GachaTypes.Normal:
                gachaParamList = MonoSingleton <GameManager> .Instance.GetGachaList("gold");

                break;

            case GachaTypes.Rare:
                gachaParamList = MonoSingleton <GameManager> .Instance.GetGachaList("coin");

                break;
            }
            if (gachaParamList == null || gachaParamList.Count == 0)
            {
                return;
            }
            GachaParam data1 = gachaParamList.Find((Predicate <GachaParam>)(p => p.num == 1));

            if (data1 != null)
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.FreeGacha, (UnityEngine.Object)null))
                {
                    DataSource.Bind <GachaParam>(this.FreeGacha, data1);
                    flag = true;
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SingularGacha, (UnityEngine.Object)null))
                {
                    DataSource.Bind <GachaParam>(this.SingularGacha, data1);
                    flag = true;
                }
            }
            GachaParam data2 = gachaParamList.Find((Predicate <GachaParam>)(p => p.num > 1));

            if (data2 != null && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.MultipleGacha, (UnityEngine.Object)null))
            {
                DataSource.Bind <GachaParam>(this.MultipleGacha, data2);
                flag = true;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.GachaButtonParent, (UnityEngine.Object)null))
            {
                this.GachaButtonParent.SetActive(flag);
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Exemple #4
0
 public void Deserialize(GachaParam param)
 {
     if (param == null)
     {
         throw new InvalidCastException();
     }
     this.iname            = param.iname;
     this.category         = param.category;
     this.startat          = param.startat;
     this.endat            = param.endat;
     this.coin             = param.coin;
     this.gold             = param.gold;
     this.coin_p           = param.coin_p;
     this.units            = param.units;
     this.num              = param.num;
     this.ticket_iname     = param.ticket_iname;
     this.ticket_num       = param.ticket_num;
     this.step             = param.step;
     this.step_num         = param.step_num;
     this.step_index       = param.step_index;
     this.limit            = param.limit;
     this.limit_num        = param.limit_num;
     this.limit_stock      = param.limit_stock;
     this.limit_cnt        = param.limit_cnt;
     this.limit_cnt_rest   = param.limit_cnt_rest;
     this.limit_cnt_num    = param.limit_cnt_num;
     this.type             = string.Empty;
     this.asset_title      = param.asset_title;
     this.asset_bg         = param.asset_bg;
     this.group            = param.group;
     this.btext            = param.btext;
     this.confirm          = param.confirm;
     this.bonus_items      = param.bonus_items;
     this.artifacts        = param.artifacts;
     this.detail_url       = param.detail_url;
     this.reset_at         = param.reset_at;
     this.disabled         = param.disabled;
     this.bonus_msg        = param.bonus_msg;
     this.appeal_type      = param.appeal_type;
     this.appeal_message   = param.appeal_message;
     this.is_stepupui_hide = param.is_hide;
     this.is_stepup_loop   = param.is_loop;
     this.is_free_pause    = param.is_free_pause;
     this.redraw           = param.redraw;
     this.redraw_rest      = param.redraw_rest;
     this.redraw_num       = param.redraw_num;
 }
Exemple #5
0
        private BannerParam[] makeValidBannerParams()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            BannerParam[] banners = instance.MasterParam.Banners;
            if (banners == null)
            {
                return(new BannerParam[0]);
            }
            List <BannerParam> bannerParamList = new List <BannerParam>();

            GachaParam[] gachas          = instance.Gachas;
            QuestParam[] availableQuests = instance.Player.AvailableQuests;
            QuestParam   questParam1     = (QuestParam)null;
            QuestParam   lastStoryQuest  = instance.Player.FindLastStoryQuest();
            long         serverTime      = Network.GetServerTime();
            DateTime     now             = TimeManager.FromUnixTime(serverTime);

            for (int index = 0; index < banners.Length; ++index)
            {
                BannerParam banner = banners[index];
                if (!string.IsNullOrEmpty(banner.banner) && bannerParamList.FindIndex((Predicate <BannerParam>)(p => p.iname == banner.iname)) == -1 && banner.IsHomeBanner)
                {
                    if (banner.type == BannerType.shop)
                    {
                        if (instance.IsLimitedShopOpen)
                        {
                            if (instance.LimitedShopList != null && !string.IsNullOrEmpty(banner.sval))
                            {
                                JSON_ShopListArray.Shops shops = Array.Find <JSON_ShopListArray.Shops>(instance.LimitedShopList, (Predicate <JSON_ShopListArray.Shops>)(p => p.gname == banner.sval));
                                if (shops != null)
                                {
                                    banner.begin_at = TimeManager.FromUnixTime(shops.start).ToString();
                                    banner.end_at   = TimeManager.FromUnixTime(shops.end).ToString();
                                    if (!banner.IsAvailablePeriod(now))
                                    {
                                        continue;
                                    }
                                }
                                else
                                {
                                    continue;
                                }
                            }
                            else if (!banner.IsAvailablePeriod(now))
                            {
                                continue;
                            }
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.storyQuest)
                    {
                        if (lastStoryQuest != null)
                        {
                            if (string.IsNullOrEmpty(banner.sval))
                            {
                                questParam1 = lastStoryQuest;
                                if (!banner.IsAvailablePeriod(now))
                                {
                                    continue;
                                }
                            }
                            else
                            {
                                QuestParam questParam2 = Array.Find <QuestParam>(availableQuests, (Predicate <QuestParam>)(p => p.iname == banner.sval));
                                if (questParam2 == null || questParam2.iname != lastStoryQuest.iname && questParam2.state == QuestStates.New)
                                {
                                    questParam2 = lastStoryQuest;
                                }
                                if (!questParam2.IsDateUnlock(serverTime))
                                {
                                    continue;
                                }
                            }
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.eventQuest || banner.type == BannerType.multiQuest)
                    {
                        if (!string.IsNullOrEmpty(banner.sval))
                        {
                            QuestParam questParam2 = Array.Find <QuestParam>(availableQuests, (Predicate <QuestParam>)(p => p.iname == banner.sval));
                            if (questParam2 == null || !questParam2.IsDateUnlock(serverTime))
                            {
                                continue;
                            }
                        }
                        else if (!banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.gacha)
                    {
                        if (!string.IsNullOrEmpty(banner.sval))
                        {
                            GachaParam gachaParam = Array.Find <GachaParam>(gachas, (Predicate <GachaParam>)(p => p.iname == banner.sval));
                            if (gachaParam != null)
                            {
                                banner.begin_at = TimeManager.FromUnixTime(gachaParam.startat).ToString();
                                banner.end_at   = TimeManager.FromUnixTime(gachaParam.endat).ToString();
                                if (!banner.IsAvailablePeriod(now))
                                {
                                    continue;
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }
                        else if (!banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.url)
                    {
                        if (string.IsNullOrEmpty(banner.sval) || !banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.towerQuest)
                    {
                        if (!banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.arena)
                    {
                        if (!banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.pvp)
                    {
                        if (!banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    else if (banner.type == BannerType.ordealQuest)
                    {
                        if (!string.IsNullOrEmpty(banner.sval))
                        {
                            QuestParam questParam2 = Array.Find <QuestParam>(availableQuests, (Predicate <QuestParam>)(p => p.iname == banner.sval));
                            if (questParam2 == null || !questParam2.IsDateUnlock(serverTime))
                            {
                                continue;
                            }
                        }
                        else if (!banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    bannerParamList.Add(banner);
                }
            }
            for (int index1 = 0; index1 < bannerParamList.Count - 1; ++index1)
            {
                for (int index2 = index1 + 1; index2 < bannerParamList.Count; ++index2)
                {
                    if (bannerParamList[index1].priority > bannerParamList[index2].priority)
                    {
                        BannerParam bannerParam = bannerParamList[index1];
                        bannerParamList[index1] = bannerParamList[index2];
                        bannerParamList[index2] = bannerParam;
                    }
                }
            }
            return(bannerParamList.ToArray());
        }
        private BannerParam[] makeValidBannerParams()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            BannerParam[] banners = instance.MasterParam.Banners;
            if (banners == null)
            {
                return(new BannerParam[0]);
            }
            List <BannerParam> bannerParamList = new List <BannerParam>();

            GachaParam[] gachas          = instance.Gachas;
            QuestParam[] availableQuests = instance.Player.AvailableQuests;
            QuestParam   questParam1     = (QuestParam)null;
            QuestParam   lastStoryQuest  = instance.Player.FindLastStoryQuest();
            long         serverTime      = Network.GetServerTime();
            DateTime     now             = TimeManager.FromUnixTime(serverTime);

            for (int index = 0; index < banners.Length; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                EventBannerScroll.\u003CmakeValidBannerParams\u003Ec__AnonStorey326 paramsCAnonStorey326 = new EventBannerScroll.\u003CmakeValidBannerParams\u003Ec__AnonStorey326();
                // ISSUE: reference to a compiler-generated field
                paramsCAnonStorey326.banner = banners[index];
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated method
                if (!string.IsNullOrEmpty(paramsCAnonStorey326.banner.banner) && bannerParamList.FindIndex(new Predicate <BannerParam>(paramsCAnonStorey326.\u003C\u003Em__35B)) == -1)
                {
                    // ISSUE: reference to a compiler-generated field
                    if (paramsCAnonStorey326.banner.type == BannerType.shop)
                    {
                        if (instance.IsLimitedShopOpen)
                        {
                            // ISSUE: reference to a compiler-generated field
                            if (instance.LimitedShopList != null && !string.IsNullOrEmpty(paramsCAnonStorey326.banner.sval))
                            {
                                // ISSUE: reference to a compiler-generated method
                                Array.Find <JSON_ShopListArray.Shops>(instance.LimitedShopList, new Predicate <JSON_ShopListArray.Shops>(paramsCAnonStorey326.\u003C\u003Em__35C));
                            }
                            else
                            {
                                // ISSUE: reference to a compiler-generated field
                                if (!paramsCAnonStorey326.banner.IsAvailablePeriod(now))
                                {
                                    continue;
                                }
                            }
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else
                    {
                        // ISSUE: reference to a compiler-generated field
                        if (paramsCAnonStorey326.banner.type == BannerType.storyQuest)
                        {
                            if (lastStoryQuest != null)
                            {
                                // ISSUE: reference to a compiler-generated field
                                if (string.IsNullOrEmpty(paramsCAnonStorey326.banner.sval))
                                {
                                    questParam1 = lastStoryQuest;
                                    // ISSUE: reference to a compiler-generated field
                                    if (!paramsCAnonStorey326.banner.IsAvailablePeriod(now))
                                    {
                                        continue;
                                    }
                                }
                                else
                                {
                                    // ISSUE: reference to a compiler-generated method
                                    QuestParam questParam2 = Array.Find <QuestParam>(availableQuests, new Predicate <QuestParam>(paramsCAnonStorey326.\u003C\u003Em__35D));
                                    if (questParam2 == null || questParam2.iname != lastStoryQuest.iname && questParam2.state == QuestStates.New)
                                    {
                                        questParam2 = lastStoryQuest;
                                    }
                                    if (!questParam2.IsDateUnlock(serverTime))
                                    {
                                        continue;
                                    }
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }
                        else
                        {
                            // ISSUE: reference to a compiler-generated field
                            // ISSUE: reference to a compiler-generated field
                            if (paramsCAnonStorey326.banner.type == BannerType.eventQuest || paramsCAnonStorey326.banner.type == BannerType.multiQuest)
                            {
                                // ISSUE: reference to a compiler-generated field
                                if (!string.IsNullOrEmpty(paramsCAnonStorey326.banner.sval))
                                {
                                    // ISSUE: reference to a compiler-generated method
                                    QuestParam questParam2 = Array.Find <QuestParam>(availableQuests, new Predicate <QuestParam>(paramsCAnonStorey326.\u003C\u003Em__35E));
                                    if (questParam2 == null || !questParam2.IsDateUnlock(serverTime))
                                    {
                                        continue;
                                    }
                                }
                                else
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    if (!paramsCAnonStorey326.banner.IsAvailablePeriod(now))
                                    {
                                        continue;
                                    }
                                }
                            }
                            else
                            {
                                // ISSUE: reference to a compiler-generated field
                                if (paramsCAnonStorey326.banner.type == BannerType.gacha)
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    if (!string.IsNullOrEmpty(paramsCAnonStorey326.banner.sval))
                                    {
                                        // ISSUE: reference to a compiler-generated method
                                        GachaParam gachaParam = Array.Find <GachaParam>(gachas, new Predicate <GachaParam>(paramsCAnonStorey326.\u003C\u003Em__35F));
                                        if (gachaParam != null)
                                        {
                                            // ISSUE: reference to a compiler-generated field
                                            paramsCAnonStorey326.banner.begin_at = TimeManager.FromUnixTime(gachaParam.startat).ToString();
                                            // ISSUE: reference to a compiler-generated field
                                            paramsCAnonStorey326.banner.end_at = TimeManager.FromUnixTime(gachaParam.endat).ToString();
                                            // ISSUE: reference to a compiler-generated field
                                            if (!paramsCAnonStorey326.banner.IsAvailablePeriod(now))
                                            {
                                                continue;
                                            }
                                        }
                                        else
                                        {
                                            continue;
                                        }
                                    }
                                    else
                                    {
                                        // ISSUE: reference to a compiler-generated field
                                        if (!paramsCAnonStorey326.banner.IsAvailablePeriod(now))
                                        {
                                            continue;
                                        }
                                    }
                                }
                                else
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    if (paramsCAnonStorey326.banner.type == BannerType.url)
                                    {
                                        // ISSUE: reference to a compiler-generated field
                                        // ISSUE: reference to a compiler-generated field
                                        if (string.IsNullOrEmpty(paramsCAnonStorey326.banner.sval) || !paramsCAnonStorey326.banner.IsAvailablePeriod(now))
                                        {
                                            continue;
                                        }
                                    }
                                    else
                                    {
                                        // ISSUE: reference to a compiler-generated field
                                        // ISSUE: reference to a compiler-generated field
                                        if (paramsCAnonStorey326.banner.type == BannerType.towerQuest && !paramsCAnonStorey326.banner.IsAvailablePeriod(now))
                                        {
                                            continue;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    // ISSUE: reference to a compiler-generated field
                    bannerParamList.Add(paramsCAnonStorey326.banner);
                }
            }
            for (int index1 = 0; index1 < bannerParamList.Count - 1; ++index1)
            {
                for (int index2 = index1 + 1; index2 < bannerParamList.Count; ++index2)
                {
                    if (bannerParamList[index1].priority > bannerParamList[index2].priority)
                    {
                        BannerParam bannerParam = bannerParamList[index1];
                        bannerParamList[index1] = bannerParamList[index2];
                        bannerParamList[index2] = bannerParam;
                    }
                }
            }
            return(bannerParamList.ToArray());
        }