Example #1
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.RankingQuestMaintenance:
                case Network.EErrCode.RankingQuest_OutOfPeriod:
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(102);
                    break;

                case Network.EErrCode.RankingQuest_NotNewScore:
                case Network.EErrCode.RankingQuest_AlreadyEntry:
                    this.OnFailed();
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <FlowNode_ReqQuestRankingParty.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqQuestRankingParty.Json> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    GlobalVars.UserSelectionPartyData  selectionPartyData = new GlobalVars.UserSelectionPartyData();
                    FlowNode_ReqQuestRankingParty.Json body = jsonObject.body;
                    if (body.party != null)
                    {
                        UnitData[] unitDataArray = new UnitData[((IEnumerable <Json_Unit>)body.party).Count <Json_Unit>((Func <Json_Unit, bool>)(j => j != null))];
                        for (int index = 0; index < unitDataArray.Length; ++index)
                        {
                            if (string.IsNullOrEmpty(body.party[index].iname))
                            {
                                unitDataArray[index] = (UnitData)null;
                            }
                            else
                            {
                                unitDataArray[index] = new UnitData();
                                unitDataArray[index].Deserialize(body.party[index]);
                            }
                        }
                        selectionPartyData.unitData = unitDataArray;
                    }
                    if (body.items != null)
                    {
                        ItemData[] itemDataArray = new ItemData[body.items.Length];
                        for (int index = 0; index < itemDataArray.Length; ++index)
                        {
                            itemDataArray[index] = new ItemData();
                            itemDataArray[index].Setup(0L, body.items[index].iname, body.items[index].num);
                        }
                        selectionPartyData.usedItems = itemDataArray;
                    }
                    if (body.help != null)
                    {
                        SupportData supportData = new SupportData();
                        supportData.Deserialize(body.help);
                        selectionPartyData.supportData = supportData;
                    }
                    selectionPartyData.achievements       = new int[0];
                    GlobalVars.UserSelectionPartyDataInfo = selectionPartyData;
                    this.Success();
                }
            }
        }
        public ReqMultiAreaRoomMake(string iname, string comment, string passCode, bool isPrivate, bool limit, int unitlv, bool clear, Vector2 location, Network.ResponseCallback response)
        {
            this.name = "btl/room/areaquest/make";
            this.body = string.Empty;
            ReqMultiAreaRoomMake multiAreaRoomMake1 = this;

            multiAreaRoomMake1.body = multiAreaRoomMake1.body + "\"iname\":\"" + JsonEscape.Escape(iname) + "\"";
            ReqMultiAreaRoomMake multiAreaRoomMake2 = this;

            multiAreaRoomMake2.body = multiAreaRoomMake2.body + ",\"comment\":\"" + JsonEscape.Escape(comment) + "\"";
            ReqMultiAreaRoomMake multiAreaRoomMake3 = this;

            multiAreaRoomMake3.body = multiAreaRoomMake3.body + ",\"pwd\":\"" + JsonEscape.Escape(passCode) + "\"";
            ReqMultiAreaRoomMake multiAreaRoomMake4 = this;

            multiAreaRoomMake4.body = multiAreaRoomMake4.body + ",\"private\":" + (object)(!isPrivate ? 0 : 1);
            ReqMultiAreaRoomMake multiAreaRoomMake5 = this;

            multiAreaRoomMake5.body = multiAreaRoomMake5.body + ",\"req_at\":" + (object)Network.GetServerTime();
            ReqMultiAreaRoomMake multiAreaRoomMake6 = this;

            multiAreaRoomMake6.body = multiAreaRoomMake6.body + ",\"limit\":" + (object)(!limit ? 0 : 1);
            ReqMultiAreaRoomMake multiAreaRoomMake7 = this;

            multiAreaRoomMake7.body = multiAreaRoomMake7.body + ",\"unitlv\":" + (object)unitlv;
            ReqMultiAreaRoomMake multiAreaRoomMake8 = this;

            multiAreaRoomMake8.body = multiAreaRoomMake8.body + ",\"clear\":" + (object)(!clear ? 0 : 1);
            this.body += ",\"location\":{";
            ReqMultiAreaRoomMake multiAreaRoomMake9 = this;

            multiAreaRoomMake9.body = multiAreaRoomMake9.body + "\"lat\":" + (object)(float)location.x + ",";
            ReqMultiAreaRoomMake multiAreaRoomMake10 = this;

            multiAreaRoomMake10.body = multiAreaRoomMake10.body + "\"lng\":" + (object)(float)location.y + "}";
            this.body     = WebAPI.GetRequestString(this.body);
            this.callback = response;
        }
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                this.OnRetry();
            }
            else
            {
                if (this.mode == FlowNode_ReqCoinShop.Mode.GetShopList)
                {
                    WebAPI.JSON_BodyResponse <JSON_ShopListArray> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_ShopListArray> >(www.text);
                    Network.RemoveAPI();
                    if (jsonObject.body.shops != null && jsonObject.body.shops.Length > 0)
                    {
                        for (int index = 0; index < jsonObject.body.shops.Length; ++index)
                        {
                            if (jsonObject.body.shops[index] == null)
                            {
                                this.OnRetry();
                                return;
                            }
                        }
                        foreach (JSON_ShopListArray.Shops shop in jsonObject.body.shops)
                        {
                            if (shop.gname.Split('-')[0] == "EventSummon2")
                            {
                                MonoSingleton <GameManager> .Instance.Player.UpdateEventCoin();

                                EventShopInfo eventShopInfo = new EventShopInfo();
                                eventShopInfo.shops = shop;
                                Json_ShopMsgResponse msg = EventShopList.ParseMsg(shop);
                                if (msg != null)
                                {
                                    eventShopInfo.banner_sprite   = msg.banner;
                                    eventShopInfo.shop_cost_iname = msg.costiname;
                                    if (msg.update != null)
                                    {
                                        eventShopInfo.btn_update = msg.update.Equals("on");
                                    }
                                    GlobalVars.EventShopItem = eventShopInfo;
                                    GlobalVars.ShopType      = EShopType.Event;
                                    this.mode = FlowNode_ReqCoinShop.Mode.GetCoinNum;
                                    this.ExecRequest((WebAPI) new ReqGetCoinNum(new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                                    return;
                                }
                            }
                        }
                    }
                }
                else if (this.mode == FlowNode_ReqCoinShop.Mode.GetCoinNum)
                {
                    WebAPI.JSON_BodyResponse <FlowNode_ReqCoinShop.JSON_CoinNum> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqCoinShop.JSON_CoinNum> >(www.text);
                    Network.RemoveAPI();
                    if (jsonObject.body != null && jsonObject.body.item != null && jsonObject.body.item.Length > 0)
                    {
                        MonoSingleton <GameManager> .Instance.Player.Deserialize(jsonObject.body.item);
                    }
                    if (jsonObject.body != null && jsonObject.body.newcoin != null)
                    {
                        GlobalVars.NewSummonCoinInfo = new GlobalVars.SummonCoinInfo()
                        {
                            Period = jsonObject.body.newcoin.period
                        }
                    }
                    ;
                    this.ActivateOutputLinks(1);
                    return;
                }
                this.ActivateOutputLinks(2);
            }
        }
Example #4
0
 public void ExecRequest(WebAPI api)
 {
     Network.RequestAPI(api, false);
     this.mStateMachine = new StateMachine <FlowNode_Network>(this);
     this.mStateMachine.GotoState <FlowNode_Network.State_WaitForConnect>();
 }
Example #5
0
 public static void IllegalParam()
 {
     Network.RequestResult = Network.RequestResults.IllegalParam;
     Network.RemoveAPI();
     Network.ResetError();
 }
Example #6
0
 public void AddNum(int num = 1)
 {
     this._numMonghly = this.numMonthly + num;
     this.at          = Network.GetServerTime();
 }
Example #7
0
        public override void UpdateValue()
        {
            KeyItem dataOfClass1 = DataSource.FindDataOfClass <KeyItem>(((Component)this).get_gameObject(), (KeyItem)null);

            if (dataOfClass1 != null)
            {
                ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(dataOfClass1.iname);

                if (itemParam != null)
                {
                    ItemData itemDataByItemParam = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemParam(itemParam);

                    int num = itemDataByItemParam == null ? 0 : itemDataByItemParam.Num;
                    if (Object.op_Inequality((Object)this.Icon, (Object)null))
                    {
                        MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, AssetPath.ItemIcon(itemParam));
                    }
                    if (Object.op_Inequality((Object)this.Frame, (Object)null))
                    {
                        this.Frame.set_sprite(GameSettings.Instance.GetItemFrame(itemParam));
                    }
                    if (Object.op_Inequality((Object)this.UseNum, (Object)null))
                    {
                        this.UseNum.set_text(dataOfClass1.num.ToString());
                    }
                    if (Object.op_Inequality((Object)this.Amount, (Object)null))
                    {
                        this.Amount.set_text(num.ToString());
                    }
                    if (Object.op_Inequality((Object)this.Locked, (Object)null))
                    {
                        ChapterParam dataOfClass2 = DataSource.FindDataOfClass <ChapterParam>(((Component)this).get_gameObject(), (ChapterParam)null);
                        this.Locked.SetActive(dataOfClass2 == null || !dataOfClass2.IsKeyQuest() || !dataOfClass2.IsKeyUnlock(Network.GetServerTime()));
                    }
                }
            }
            if (Object.op_Inequality((Object)this.QuestTimer, (Object)null))
            {
                this.QuestTimer.UpdateValue();
            }
            if (!Object.op_Inequality((Object)this.IconRoot, (Object)null) || !Object.op_Inequality((Object)this.Locked, (Object)null))
            {
                return;
            }
            this.IconRoot.SetActive(this.Locked.get_activeSelf());
        }
Example #8
0
 public PaymentInfo(string productId_, int numMonthly_)
 {
     this.productId   = productId_;
     this._numMonghly = numMonthly_;
     this.at          = Network.GetServerTime();
 }
Example #9
0
        public override void OnSuccess(WWWResult www)
        {
            DebugUtility.Log(nameof(OnSuccess));
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.MultiMaintenance:
                case Network.EErrCode.VsMaintenance:
                    Network.RemoveAPI();
                    Network.ResetError();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(6000);
                    break;

                case Network.EErrCode.MultiVersionMismatch:
                    Network.RemoveAPI();
                    Network.ResetError();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(5000);
                    break;

                case Network.EErrCode.RoomNoRoom:
                case Network.EErrCode.VS_NoRoom:
                    Network.RemoveAPI();
                    Network.ResetError();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(7000);
                    break;

                default:
                    this.OnFailed();
                    break;
                }
            }
            else
            {
                if (this.mType == FlowNode_MultiPlayResume.RESUME_TYPE.MULTI)
                {
                    WebAPI.JSON_BodyResponse <ReqMultiPlayResume.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqMultiPlayResume.Response> >(www.text);
                    DebugUtility.Assert(jsonObject != null, "res == null");
                    if (jsonObject.body == null)
                    {
                        this.OnFailed();
                        return;
                    }
                    GlobalVars.SelectedQuestID = jsonObject.body.quest.iname;
                    GlobalVars.SelectedMultiPlayPhotonAppID = jsonObject.body.app_id;
                    GlobalVars.SelectedMultiPlayRoomName    = jsonObject.body.token;
                    GlobalVars.ResumeMultiplayPlayerID      = int.Parse(jsonObject.body.btlinfo.plid);
                    GlobalVars.ResumeMultiplaySeatID        = int.Parse(jsonObject.body.btlinfo.seat);
                    FlowNode_MultiPlayResume.BtlInfo        = jsonObject.body.btlinfo;
                }
                else if (this.mType == FlowNode_MultiPlayResume.RESUME_TYPE.VERSUS)
                {
                    WebAPI.JSON_BodyResponse <ReqVersusResume.Response> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqVersusResume.Response> >(www.text);
                    DebugUtility.Assert(jsonObject != null, "res == null");
                    if (jsonObject.body == null)
                    {
                        this.OnFailed();
                        return;
                    }
                    GlobalVars.SelectedQuestID = jsonObject.body.quest.iname;
                    GlobalVars.SelectedMultiPlayPhotonAppID = jsonObject.body.app_id;
                    GlobalVars.SelectedMultiPlayRoomName    = jsonObject.body.token;
                    GlobalVars.ResumeMultiplayPlayerID      = int.Parse(jsonObject.body.btlinfo.plid);
                    GlobalVars.ResumeMultiplaySeatID        = int.Parse(jsonObject.body.btlinfo.seat);
                    if (string.Compare(jsonObject.body.type, VERSUS_TYPE.Free.ToString().ToLower()) == 0)
                    {
                        GlobalVars.SelectedMultiPlayVersusType = VERSUS_TYPE.Free;
                    }
                    else if (string.Compare(jsonObject.body.type, VERSUS_TYPE.Tower.ToString().ToLower()) == 0)
                    {
                        MonoSingleton <GameManager> .Instance.VersusTowerMatchBegin = true;
                        GlobalVars.SelectedMultiPlayVersusType = VERSUS_TYPE.Tower;
                    }
                    else if (string.Compare(jsonObject.body.type, VERSUS_TYPE.Friend.ToString().ToLower()) == 0)
                    {
                        GlobalVars.SelectedMultiPlayVersusType = VERSUS_TYPE.Friend;
                    }
                    FlowNode_MultiPlayResume.BtlInfo = jsonObject.body.btlinfo;
                }
                Network.RemoveAPI();
                ((Behaviour)this).set_enabled(false);
                this.ActivateOutputLinks(300);
            }
        }
Example #10
0
        private void Refresh()
        {
            GameUtility.DestroyGameObjects <ListItemEvents>(this.mItems);
            if (Object.op_Equality((Object)this.ItemTemplate, (Object)null) || Object.op_Equality((Object)this.ItemContainer, (Object)null))
            {
                return;
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;

            ChapterParam[]      chapters         = instance.Chapters;
            List <ChapterParam> chapterParamList = new List <ChapterParam>((IEnumerable <ChapterParam>)chapters);

            QuestParam[] availableQuests = instance.Player.AvailableQuests;
            long         serverTime      = Network.GetServerTime();
            ChapterParam chapterParam    = (ChapterParam)null;

            for (int index = chapterParamList.Count - 1; index >= 0; --index)
            {
                if ((string)GlobalVars.SelectedSection != chapterParamList[index].section)
                {
                    chapterParamList.RemoveAt(index);
                }
            }
            if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter))
            {
                chapterParam = instance.FindArea((string)GlobalVars.SelectedChapter);
                for (int index = chapterParamList.Count - 1; index >= 0; --index)
                {
                    if (chapterParamList[index].parent == null || chapterParamList[index].parent.iname != (string)GlobalVars.SelectedChapter)
                    {
                        chapterParamList.RemoveAt(index);
                    }
                }
            }
            else
            {
                for (int index = chapterParamList.Count - 1; index >= 0; --index)
                {
                    if (chapterParamList[index].parent != null)
                    {
                        chapterParamList.RemoveAt(index);
                    }
                }
            }
            for (int index = chapterParamList.Count - 1; index >= 0; --index)
            {
                if (!this.ChapterContainsPlayableQuest(chapterParamList[index], chapters, availableQuests, serverTime))
                {
                    chapterParamList.RemoveAt(index);
                }
            }
            List <TowerParam> towerParamList = new List <TowerParam>();

            foreach (TowerParam tower in instance.Towers)
            {
                bool flag = false;
                for (int index = 0; index < availableQuests.Length; ++index)
                {
                    if (availableQuests[index].type == QuestTypes.Tower && availableQuests[index].IsDateUnlock(serverTime))
                    {
                        flag = true;
                        break;
                    }
                }
                if (flag && (string.IsNullOrEmpty((string)GlobalVars.SelectedSection) || "WD_DAILY" == (string)GlobalVars.SelectedSection))
                {
                    towerParamList.Add(tower);
                }
            }
            if (this.Descending)
            {
                chapterParamList.Reverse();
            }
            for (int index = 0; index < towerParamList.Count; ++index)
            {
                TowerParam     data            = towerParamList[index];
                ListItemEvents listItemEvents1 = (ListItemEvents)null;
                if (!string.IsNullOrEmpty(data.prefabPath))
                {
                    StringBuilder stringBuilder = GameUtility.GetStringBuilder();
                    stringBuilder.Append("QuestChapters/");
                    stringBuilder.Append(data.prefabPath);
                    listItemEvents1 = AssetManager.Load <ListItemEvents>(stringBuilder.ToString());
                }
                if (Object.op_Equality((Object)listItemEvents1, (Object)null))
                {
                    listItemEvents1 = this.ItemTemplate;
                }
                QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(data.iname);

                ListItemEvents listItemEvents2 = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)listItemEvents1);
                DataSource.Bind <TowerParam>(((Component)listItemEvents2).get_gameObject(), data);
                DataSource.Bind <QuestParam>(((Component)listItemEvents2).get_gameObject(), quest);
                ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false);
                ((Component)listItemEvents2).get_gameObject().SetActive(true);
                listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnTowerSelect);
                this.mItems.Add(listItemEvents2);
            }
            int num = 0;

            for (int index1 = 0; index1 < chapterParamList.Count; ++index1)
            {
                ChapterParam   data            = chapterParamList[index1];
                ListItemEvents listItemEvents1 = (ListItemEvents)null;
                if (!string.IsNullOrEmpty(data.prefabPath))
                {
                    StringBuilder stringBuilder = GameUtility.GetStringBuilder();
                    stringBuilder.Append("QuestChapters/");
                    stringBuilder.Append(data.prefabPath);
                    listItemEvents1 = AssetManager.Load <ListItemEvents>(stringBuilder.ToString());
                }
                if (Object.op_Equality((Object)listItemEvents1, (Object)null))
                {
                    listItemEvents1 = this.ItemTemplate;
                }
                ListItemEvents listItemEvents2 = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)listItemEvents1);
                DataSource.Bind <ChapterParam>(((Component)listItemEvents2).get_gameObject(), data);
                int total     = 0;
                int completed = 0;
                foreach (QuestParam availableQuest in MonoSingleton <GameManager> .Instance.Player.AvailableQuests)
                {
                    if (!(availableQuest.ChapterID != data.iname) && availableQuest.bonusObjective != null)
                    {
                        if (availableQuest.difficulty == QuestDifficulties.Elite)
                        {
                            ++num;
                        }
                        if (availableQuest.difficulty == GlobalVars.QuestDifficulty)
                        {
                            total += availableQuest.bonusObjective.Length;
                            for (int index2 = 0; index2 < availableQuest.bonusObjective.Length; ++index2)
                            {
                                if (((int)availableQuest.clear_missions & 1 << index2) != 0)
                                {
                                    ++completed;
                                }
                            }
                        }
                    }
                }
                SGChapterItem component = (SGChapterItem)((Component)listItemEvents2).GetComponent <SGChapterItem>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    component.SetProgress(total, completed);
                }
                ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false);
                ((Component)listItemEvents2).get_gameObject().SetActive(true);
                listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnNodeSelect);
                this.mItems.Add(listItemEvents2);
            }
            this.RefreshButtons(GlobalVars.QuestDifficulty);
            if (num == 0)
            {
                ((Selectable)this.BtnNormal.GetComponentInChildren <Button>()).set_interactable(false);
                ((Behaviour)this.BtnNormal.GetComponentInChildren <Button>()).set_enabled(false);
                M0         componentInChildren = this.BtnNormal.GetComponentInChildren <Image>();
                ColorBlock colors = ((Selectable)this.BtnNormal.GetComponentInChildren <Button>()).get_colors();
                // ISSUE: explicit reference operation
                Color normalColor = ((ColorBlock)@colors).get_normalColor();
                ((Graphic)componentInChildren).set_color(normalColor);
            }
            if (Object.op_Inequality((Object)this.BackButton, (Object)null))
            {
                if (chapterParam != null)
                {
                    this.BackButton.SetActive(true);
                }
                else if (!string.IsNullOrEmpty((string)GlobalVars.SelectedSection))
                {
                    this.BackButton.SetActive(!this.IsSectionHidden((string)GlobalVars.SelectedSection));
                }
            }
            FlowNode_GameObject.ActivateOutputLinks((Component)this, 50);
        }
Example #11
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   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__AnonStorey243 paramsCAnonStorey243 = new EventBannerScroll.\u003CmakeValidBannerParams\u003Ec__AnonStorey243();
                // ISSUE: reference to a compiler-generated field
                paramsCAnonStorey243.banner = banners[index];
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated method
                if (!string.IsNullOrEmpty(paramsCAnonStorey243.banner.banner) && bannerParamList.FindIndex(new Predicate <BannerParam>(paramsCAnonStorey243.\u003C\u003Em__270)) == -1)
                {
                    // ISSUE: reference to a compiler-generated field
                    if (paramsCAnonStorey243.banner.type == BannerType.shop)
                    {
                        // ISSUE: reference to a compiler-generated field
                        if (!string.IsNullOrEmpty(paramsCAnonStorey243.banner.sval))
                        {
                            // ISSUE: reference to a compiler-generated method
                            Array.Find <JSON_ShopListArray.Shops>(instance.LimitedShopList, new Predicate <JSON_ShopListArray.Shops>(paramsCAnonStorey243.\u003C\u003Em__271));
                        }
                        // ISSUE: reference to a compiler-generated field
                        if (!paramsCAnonStorey243.banner.IsAvailablePeriod(now))
                        {
                            continue;
                        }
                    }
                    else
                    {
                        // ISSUE: reference to a compiler-generated field
                        if (paramsCAnonStorey243.banner.type == BannerType.storyQuest)
                        {
                            if (lastStoryQuest != null)
                            {
                                QuestParam questParam;
                                // ISSUE: reference to a compiler-generated field
                                if (string.IsNullOrEmpty(paramsCAnonStorey243.banner.sval))
                                {
                                    questParam = lastStoryQuest;
                                }
                                else
                                {
                                    // ISSUE: reference to a compiler-generated method
                                    questParam = Array.Find <QuestParam>(availableQuests, new Predicate <QuestParam>(paramsCAnonStorey243.\u003C\u003Em__272));
                                    if (questParam == null || questParam.iname != lastStoryQuest.iname && questParam.state == QuestStates.New)
                                    {
                                        questParam = lastStoryQuest;
                                    }
                                }
                                if (!questParam.IsDateUnlock(serverTime))
                                {
                                    continue;
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }
                        else
                        {
                            // ISSUE: reference to a compiler-generated field
                            // ISSUE: reference to a compiler-generated field
                            if (paramsCAnonStorey243.banner.type == BannerType.eventQuest || paramsCAnonStorey243.banner.type == BannerType.multiQuest)
                            {
                                // ISSUE: reference to a compiler-generated field
                                if (!string.IsNullOrEmpty(paramsCAnonStorey243.banner.sval))
                                {
                                    // ISSUE: reference to a compiler-generated method
                                    QuestParam questParam = Array.Find <QuestParam>(availableQuests, new Predicate <QuestParam>(paramsCAnonStorey243.\u003C\u003Em__273));
                                    if (questParam == null || !questParam.IsDateUnlock(serverTime))
                                    {
                                        continue;
                                    }
                                }
                            }
                            else
                            {
                                // ISSUE: reference to a compiler-generated field
                                if (paramsCAnonStorey243.banner.type == BannerType.gacha)
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    if (!string.IsNullOrEmpty(paramsCAnonStorey243.banner.sval))
                                    {
                                        // ISSUE: reference to a compiler-generated method
                                        GachaParam gachaParam = Array.Find <GachaParam>(gachas, new Predicate <GachaParam>(paramsCAnonStorey243.\u003C\u003Em__274));
                                        if (gachaParam != null)
                                        {
                                            // ISSUE: reference to a compiler-generated field
                                            paramsCAnonStorey243.banner.begin_at = TimeManager.FromUnixTime(gachaParam.startat).ToString();
                                            // ISSUE: reference to a compiler-generated field
                                            paramsCAnonStorey243.banner.end_at = TimeManager.FromUnixTime(gachaParam.endat).ToString();
                                            // ISSUE: reference to a compiler-generated field
                                            if (!paramsCAnonStorey243.banner.IsAvailablePeriod(now))
                                            {
                                                continue;
                                            }
                                        }
                                        else
                                        {
                                            continue;
                                        }
                                    }
                                }
                                else
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    // ISSUE: reference to a compiler-generated field
                                    // ISSUE: reference to a compiler-generated field
                                    if (paramsCAnonStorey243.banner.type == BannerType.url && (string.IsNullOrEmpty(paramsCAnonStorey243.banner.sval) || !paramsCAnonStorey243.banner.IsAvailablePeriod(now)))
                                    {
                                        continue;
                                    }
                                }
                            }
                        }
                    }
                    // ISSUE: reference to a compiler-generated field
                    bannerParamList.Add(paramsCAnonStorey243.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());
        }
Example #12
0
        private void Refresh()
        {
            if (this.sectionName == null)
            {
                this.sectionName = (string)GlobalVars.ReplaySelectedSection;
            }
            else if (this.sectionName.Equals((string)GlobalVars.ReplaySelectedSection))
            {
                return;
            }
            this.sectionName = (string)GlobalVars.ReplaySelectedSection;
            GameUtility.DestroyGameObjects <ListItemEvents>(this.mItems);
            this.mItems.Clear();
            if (Object.op_Equality((Object)this.ItemTemplate, (Object)null) || Object.op_Equality((Object)this.ItemContainer, (Object)null))
            {
                return;
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;
            List <ReplayQuestChapterList.ReplayChapterParam> replayChapterParamList = new List <ReplayQuestChapterList.ReplayChapterParam>();

            QuestParam[] availableQuests = instance.Player.AvailableQuests;
            long         serverTime      = Network.GetServerTime();

            foreach (ChapterParam chapter in instance.Chapters)
            {
                bool flag1 = false;
                bool flag2 = false;
                foreach (QuestParam questParam in availableQuests)
                {
                    if (!(questParam.ChapterID != chapter.iname) && !questParam.IsMulti && (questParam.type != QuestTypes.Beginner && questParam.IsReplayDateUnlock(serverTime)) && ((!string.IsNullOrEmpty(questParam.event_start) || !string.IsNullOrEmpty(questParam.event_clear)) && (questParam.state == QuestStates.Challenged || questParam.state == QuestStates.Cleared)))
                    {
                        if (questParam.replayLimit && questParam.end > 0L)
                        {
                            flag2 = true;
                        }
                        flag1 = true;
                        break;
                    }
                }
                if (flag1 && (string.IsNullOrEmpty((string)GlobalVars.ReplaySelectedSection) || chapter.section == (string)GlobalVars.ReplaySelectedSection))
                {
                    replayChapterParamList.Add(new ReplayQuestChapterList.ReplayChapterParam()
                    {
                        chapterParam = chapter,
                        replayLimit  = flag2
                    });
                }
            }
            if (this.Descending)
            {
                replayChapterParamList.Reverse();
            }
            using (List <ReplayQuestChapterList.ReplayChapterParam> .Enumerator enumerator = replayChapterParamList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ReplayQuestChapterList.ReplayChapterParam current = enumerator.Current;
                    ChapterParam   chapterParam    = current.chapterParam;
                    ListItemEvents listItemEvents1 = (ListItemEvents)null;
                    if (!string.IsNullOrEmpty(chapterParam.prefabPath))
                    {
                        StringBuilder stringBuilder = GameUtility.GetStringBuilder();
                        stringBuilder.Append("QuestChapters/");
                        stringBuilder.Append(chapterParam.prefabPath);
                        listItemEvents1 = AssetManager.Load <ListItemEvents>(stringBuilder.ToString());
                    }
                    if (Object.op_Equality((Object)listItemEvents1, (Object)null))
                    {
                        listItemEvents1 = this.ItemTemplate;
                    }
                    ListItemEvents listItemEvents2 = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)listItemEvents1);
                    DataSource.Bind <ChapterParam>(((Component)listItemEvents2).get_gameObject(), chapterParam);
                    ((Component)listItemEvents2).get_transform().SetParent(this.ItemContainer.get_transform(), false);
                    ((Component)listItemEvents2).get_gameObject().SetActive(true);
                    listItemEvents2.OnSelect = new ListItemEvents.ListItemEvent(this.OnItemSelect);
                    if (chapterParam.end > 0L)
                    {
                        this.SetTimerActive(((Component)listItemEvents2).get_transform(), current.replayLimit);
                    }
                    this.mItems.Add(listItemEvents2);
                }
            }
            if (Object.op_Inequality((Object)this.BackToCategories, (Object)null) && Object.op_Inequality((Object)this.BackToSection, (Object)null))
            {
                bool flag = false;
                foreach (SectionParam section in instance.Sections)
                {
                    if (section.iname == (string)GlobalVars.ReplaySelectedSection)
                    {
                        flag = section.hidden;
                        break;
                    }
                }
                this.BackToCategories.SetActive(flag);
                this.BackToSection.SetActive(!flag);
            }
            if (Object.op_Inequality((Object)this.ScrollRect, (Object)null))
            {
                this.ScrollRect.set_normalizedPosition(Vector2.get_one());
            }
            if (this.mItems.Count > 0)
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 10);
            }
            else
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 11);
            }
        }