Esempio n. 1
0
        private void OnTowerSelect(GameObject go)
        {
            TowerParam dataOfClass = DataSource.FindDataOfClass <TowerParam>(go, (TowerParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            QuestParam[] availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
            long         serverTime      = Network.GetServerTime();
            int          num1            = 0;
            int          num2            = 0;

            for (int index = 0; index < availableQuests.Length; ++index)
            {
                if (availableQuests[index].type == QuestTypes.Tower && !(availableQuests[index].ChapterID != dataOfClass.iname) && !availableQuests[index].IsMulti)
                {
                    ++num1;
                    if (availableQuests[index].IsJigen && !availableQuests[index].IsDateUnlock(serverTime))
                    {
                        ++num2;
                    }
                }
            }
            if (num1 > 0 && num1 == num2)
            {
                UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.QUEST_OUT_OF_DATE"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
            }
            else
            {
                GlobalVars.SelectedTowerID = dataOfClass.iname;
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 200);
            }
        }
Esempio n. 2
0
        private void RefreshSwitchButton(EventQuestList.EventQuestTypes type)
        {
            ChapterParam[] chapters = MonoSingleton <GameManager> .Instance.Chapters;
            bool           flag1    = false;
            bool           flag2    = false;
            bool           flag3    = false;

            if (chapters != null)
            {
                long serverTime = Network.GetServerTime();
                for (int index = 0; index < chapters.Length; ++index)
                {
                    if (chapters[index].IsKeyQuest())
                    {
                        flag1 = true;
                        if (chapters[index].IsDateUnlock(serverTime))
                        {
                            flag3 = true;
                        }
                        if (chapters[index].IsKeyUnlock(serverTime))
                        {
                            flag2 = true;
                        }
                    }
                }
            }
            switch (type)
            {
            case EventQuestList.EventQuestTypes.Normal:
                if (Object.op_Inequality((Object)this.EventQuestButton, (Object)null))
                {
                    ((Component)this.EventQuestButton).get_gameObject().SetActive(false);
                }
                if (Object.op_Inequality((Object)this.KeyQuestButton, (Object)null))
                {
                    ((Component)this.KeyQuestButton).get_gameObject().SetActive(true);
                    ((Selectable)this.KeyQuestButton).set_interactable(flag3);
                    break;
                }
                break;

            case EventQuestList.EventQuestTypes.Key:
                if (Object.op_Inequality((Object)this.EventQuestButton, (Object)null))
                {
                    ((Component)this.EventQuestButton).get_gameObject().SetActive(true);
                }
                if (Object.op_Inequality((Object)this.KeyQuestButton, (Object)null))
                {
                    ((Component)this.KeyQuestButton).get_gameObject().SetActive(false);
                    ((Selectable)this.KeyQuestButton).set_interactable(flag1);
                    break;
                }
                break;
            }
            if (!Object.op_Inequality((Object)this.KeyQuestOpenEffect, (Object)null))
            {
                return;
            }
            this.KeyQuestOpenEffect.SetActive(flag2);
        }
        public void InitializeContentList()
        {
            this.ReleaseContentList();
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_ContentController, (UnityEngine.Object)null))
            {
                return;
            }
            this.m_ContentSource = new FriendPresentWantWindow.Content.ItemSource();
            FriendPresentItemParam[] presentItemParams = MonoSingleton <GameManager> .Instance.MasterParam.GetFriendPresentItemParams();

            List <FriendPresentItemParam> list = new List <FriendPresentItemParam>();

            for (int index = 0; index < presentItemParams.Length; ++index)
            {
                if (!presentItemParams[index].IsDefault() && presentItemParams[index].IsValid(Network.GetServerTime()))
                {
                    list.Add(presentItemParams[index]);
                }
            }
            long serverTime = Network.GetServerTime();

            SortUtility.StableSort <FriendPresentItemParam>(list, (Comparison <FriendPresentItemParam>)((p1, p2) => (!p1.HasTimeLimit() ? long.MaxValue : p1.GetRestTime(serverTime)).CompareTo(!p2.HasTimeLimit() ? long.MaxValue : p2.GetRestTime(serverTime))));
            for (int index = 0; index < list.Count; ++index)
            {
                FriendPresentWantWindow.Content.ItemSource.ItemParam itemParam = new FriendPresentWantWindow.Content.ItemSource.ItemParam(list[index]);
                if (itemParam.IsValid())
                {
                    this.m_ContentSource.Add(itemParam);
                }
            }
            this.m_ContentController.Initialize((ContentSource)this.m_ContentSource, Vector2.get_zero());
        }
Esempio n. 4
0
        private void Update()
        {
            if ((double)this.UpdateInterval <= 0.0)
            {
                return;
            }
            if (this.mBannerLoadRequest != null)
            {
                if (!this.mBannerLoadRequest.isDone)
                {
                    return;
                }
                if (Object.op_Inequality((Object)this.mTarget, (Object)null))
                {
                    this.mTarget.set_texture((Texture)(this.mBannerLoadRequest.asset as Texture2D));
                }
                this.mBannerLoadRequest = (LoadRequest)null;
            }
            this.mInterval += Time.get_unscaledDeltaTime();
            if ((double)this.mInterval < (double)this.UpdateInterval)
            {
                return;
            }
            this.mInterval = 0.0f;
            GameManager   instance   = MonoSingleton <GameManager> .Instance;
            List <string> stringList = new List <string>();

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

            for (int index1 = 0; index1 < chapters.Length; ++index1)
            {
                bool   flag   = false;
                string banner = chapters[index1].banner;
                if (!string.IsNullOrEmpty(banner) && !stringList.Contains(banner))
                {
                    for (int index2 = 0; index2 < availableQuests.Length; ++index2)
                    {
                        if (availableQuests[index2].ChapterID == chapters[index1].iname && availableQuests[index2].IsDateUnlock(serverTime))
                        {
                            flag = true;
                            break;
                        }
                    }
                    if (flag)
                    {
                        stringList.Add(banner);
                    }
                }
            }
            if (stringList.Count <= 0)
            {
                return;
            }
            int index = (stringList.IndexOf(this.mLastBannerName) + 1) % stringList.Count;

            this.mLastBannerName    = stringList[index];
            this.mBannerLoadRequest = AssetManager.LoadAsync <Texture2D>("Banners/" + this.mLastBannerName);
        }
Esempio n. 5
0
        private bool setQuestVariables(string questId, bool story)
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            QuestParam[] availableQuests = instance.Player.AvailableQuests;
            for (int index = 0; index < availableQuests.Length; ++index)
            {
                if (availableQuests[index].iname == questId)
                {
                    GlobalVars.SelectedSection.Set(availableQuests[index].Chapter.section);
                    GlobalVars.SelectedChapter.Set(availableQuests[index].ChapterID);
                    return(true);
                }
            }
            if (story)
            {
                QuestParam lastStoryQuest = instance.Player.FindLastStoryQuest();
                if (lastStoryQuest != null && lastStoryQuest.IsDateUnlock(Network.GetServerTime()))
                {
                    GlobalVars.SelectedSection.Set(lastStoryQuest.Chapter.section);
                    GlobalVars.SelectedChapter.Set(lastStoryQuest.ChapterID);
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 6
0
        private void Initialize()
        {
            this.QuestCount = new List <int>(Enum.GetValues(typeof(ReplayCategoryList.ReplayCategoryType)).Length);
            for (int index = 0; index < this.QuestCount.Capacity; ++index)
            {
                this.QuestCount.Add(0);
            }
            QuestParam[] availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
            long         serverTime      = Network.GetServerTime();

            foreach (QuestParam questParam in availableQuests)
            {
                if (!string.IsNullOrEmpty(questParam.ChapterID) && !questParam.IsMulti && questParam.IsReplayDateUnlock(serverTime) && ((!string.IsNullOrEmpty(questParam.event_start) || !string.IsNullOrEmpty(questParam.event_clear)) && (questParam.state == QuestStates.Challenged || questParam.state == QuestStates.Cleared)))
                {
                    if (questParam.type == QuestTypes.Story)
                    {
                        this.AddQuestCount(ReplayCategoryList.ReplayCategoryType.Story);
                    }
                    else if (questParam.type == QuestTypes.Event || questParam.type == QuestTypes.Beginner)
                    {
                        this.AddQuestCount(ReplayCategoryList.ReplayCategoryType.Event);
                    }
                    else if (questParam.type == QuestTypes.Character)
                    {
                        this.AddQuestCount(ReplayCategoryList.ReplayCategoryType.Character);
                    }
                }
            }
        }
Esempio n. 7
0
        public void Activated(int pinID)
        {
            switch (pinID)
            {
            case 1:
                if (this.Chapter != null && this.Chapter.keys.Count > 0)
                {
                    KeyItem  key = this.Chapter.keys[0];
                    ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(key.iname);

                    if (itemDataByItemId == null || itemDataByItemId.Num < key.num)
                    {
                        UIUtility.SystemMessage(LocalizedText.Get("sys.KEYQUEST_UNLOCK"), LocalizedText.Get("sys.KEYQUEST_OUTOFKEY"), (UIUtility.DialogResultEvent)(go => FlowNode_GameObject.ActivateOutputLinks((Component)this, 101)), (GameObject)null, false, -1);
                        break;
                    }
                    if (!this.Chapter.IsDateUnlock(Network.GetServerTime()))
                    {
                        UIUtility.SystemMessage(LocalizedText.Get("sys.KEYQUEST_UNLOCK"), LocalizedText.Get("sys.QUEST_OUT_OF_DATE"), (UIUtility.DialogResultEvent)(go => FlowNode_GameObject.ActivateOutputLinks((Component)this, 101)), (GameObject)null, false, -1);
                        break;
                    }
                }
                GlobalVars.KeyQuestTimeOver = false;
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 100);
                break;

            case 2:
                GlobalVars.KeyQuestTimeOver = false;
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
                break;
            }
        }
Esempio n. 8
0
        private void Start()
        {
            ChapterParam[] chapters = MonoSingleton <GameManager> .Instance.Chapters;
            bool           flag1    = false;
            bool           flag2    = false;

            if (chapters != null)
            {
                long serverTime = Network.GetServerTime();
                for (int index = 0; index < chapters.Length; ++index)
                {
                    if (chapters[index].IsKeyQuest())
                    {
                        if (chapters[index].IsDateUnlock(serverTime))
                        {
                            flag2 = true;
                        }
                        if (chapters[index].IsKeyUnlock(serverTime))
                        {
                            flag1 = true;
                        }
                    }
                }
            }
            if (Object.op_Inequality((Object)this.KeyQuestOpenEffect, (Object)null))
            {
                this.KeyQuestOpenEffect.SetActive(flag1);
            }
            if (!Object.op_Inequality((Object)this.KeyQuestButton, (Object)null))
            {
                return;
            }
            ((Component)this.KeyQuestButton).get_gameObject().SetActive(true);
            ((Selectable)this.KeyQuestButton).set_interactable(flag2);
        }
Esempio n. 9
0
 private void SetDeactivateNotAvailableUnit()
 {
     using (List <GameObject> .Enumerator enumerator1 = this.mCurrentUnitObjects.GetEnumerator())
     {
         while (enumerator1.MoveNext())
         {
             GameObject current = enumerator1.Current;
             QuestBookmarkWindow.ItemAndQuests dataOfClass = DataSource.FindDataOfClass <QuestBookmarkWindow.ItemAndQuests>(current, (QuestBookmarkWindow.ItemAndQuests)null);
             QuestParam[] availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
             bool         flag            = false;
             long         currentTime     = Network.GetServerTime();
             using (List <QuestParam> .Enumerator enumerator2 = dataOfClass.quests.GetEnumerator())
             {
                 while (enumerator2.MoveNext())
                 {
                     QuestParam quest = enumerator2.Current;
                     if (((IEnumerable <QuestParam>)availableQuests).Any <QuestParam>((Func <QuestParam, bool>)(q =>
                     {
                         if (this.IsAvailableQuest(q, currentTime))
                         {
                             return(quest.iname == q.iname);
                         }
                         return(false);
                     })))
                     {
                         flag = true;
                         break;
                     }
                 }
             }
             ((BookmarkUnit)current.GetComponent <BookmarkUnit>()).Overlay.SetActive(!flag);
         }
     }
 }
Esempio n. 10
0
        public bool IsOpendTower()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

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

            for (int index1 = 0; index1 < instance.Towers.Length; ++index1)
            {
                TowerParam tower = instance.Towers[index1];
                for (int index2 = 0; index2 < availableQuests.Length; ++index2)
                {
                    if (availableQuests[index2].type == QuestTypes.Tower && !(availableQuests[index2].iname != tower.iname) && availableQuests[index2].IsDateUnlock(serverTime))
                    {
                        return(true);
                    }
                }
            }
            for (int index = 0; index < availableQuests.Length; ++index)
            {
                if (availableQuests[index].IsMultiTower && availableQuests[index].IsDateUnlock(serverTime))
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 11
0
        public void Bind(FriendPresentItemParam present, bool checkTimeLimit)
        {
            if (present == null)
            {
                present = FriendPresentItemParam.DefaultParam;
                if (present == null)
                {
                    Debug.LogError((object)"フレンドプレゼントのデフォルトパラメータが存在しません!");
                    return;
                }
            }
            if (checkTimeLimit && !present.IsValid(Network.GetServerTime()))
            {
                present = FriendPresentItemParam.DefaultParam;
            }
            this.m_Present = present;
            if (this.m_Present.item == null)
            {
                return;
            }
            this.m_ItemData = MonoSingleton <GameManager> .Instance.Player.Items.Find((Predicate <ItemData>)(prop => prop.ItemID == present.item.iname));

            if (this.m_ItemData != null)
            {
                return;
            }
            this.m_ItemData = new ItemData();
            this.m_ItemData.Setup(0L, this.m_Present.item, 0);
        }
Esempio n. 12
0
        private void OnUnitSelect(SRPG_Button button)
        {
            if (!((Selectable)button).get_interactable() || this.mSelectQuestFlag)
            {
                return;
            }
            QuestBookmarkWindow.ItemAndQuests dataOfClass1 = DataSource.FindDataOfClass <QuestBookmarkWindow.ItemAndQuests>(((Component)button).get_gameObject(), (QuestBookmarkWindow.ItemAndQuests)null);
            long currentTime = Network.GetServerTime();

            QuestParam[] availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
            QuestParam[] questParamArray = !(this.mLastSectionName == this.BookmarkSectionName) ? dataOfClass1.quests.Where <QuestParam>((Func <QuestParam, bool>)(q => q.world == this.mLastSectionName)).ToArray <QuestParam>() : QuestDropParam.Instance.GetItemDropQuestList(MonoSingleton <GameManager> .Instance.MasterParam.GetItemParam(dataOfClass1.itemName), GlobalVars.GetDropTableGeneratedDateTime()).Where <QuestParam>((Func <QuestParam, bool>)(q => ((IEnumerable <string>) this.mAvailableSections).Contains <string>(q.world))).ToArray <QuestParam>();
            if (questParamArray.Length <= 0)
            {
                return;
            }
            List <QuestParam> questParamList = new List <QuestParam>();

            foreach (QuestParam questParam1 in questParamArray)
            {
                foreach (QuestParam questParam2 in ((IEnumerable <QuestParam>)availableQuests).Where <QuestParam>((Func <QuestParam, bool>)(q => this.IsAvailableQuest(q, currentTime))))
                {
                    if (questParam1.iname == questParam2.iname)
                    {
                        questParamList.Add(questParam1);
                    }
                }
            }
            if (questParamList.Count <= 0)
            {
                QuestParam questParam = questParamArray[0];
                UIUtility.SystemMessage((string)null, LocalizedText.Get("sys.TXT_QUESTBOOKMARK_BOOKMARK_NOT_AVAIABLE_QUEST", (object)questParam.title, (object)questParam.name), (UIUtility.DialogResultEvent)null, (GameObject)null, true, -1);
            }
            else if (this.mIsBookmarkEditing)
            {
                this.OnUnitSelectBookmark(dataOfClass1, (BookmarkUnit)((Component)button).GetComponent <BookmarkUnit>());
            }
            else if (questParamArray.Length > 1)
            {
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.QuestSelectorTemplate, (UnityEngine.Object)null))
                {
                    return;
                }
                GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.QuestSelectorTemplate);
                gameObject.get_transform().SetParent(((Component)this).get_transform().get_parent(), false);
                QuestBookmarkKakeraWindow component = (QuestBookmarkKakeraWindow)gameObject.GetComponent <QuestBookmarkKakeraWindow>();
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    return;
                }
                UnitParam dataOfClass2 = DataSource.FindDataOfClass <UnitParam>(((Component)button).get_gameObject(), (UnitParam)null);
                component.Refresh(dataOfClass2, (IEnumerable <QuestParam>)questParamArray);
            }
            else
            {
                this.mSelectQuestFlag      = true;
                GlobalVars.SelectedQuestID = questParamArray[0].iname;
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 100);
            }
        }
Esempio n. 13
0
        public long GetNextRecoverySec()
        {
            if ((int)this.val >= (int)this.valMax)
            {
                return(0);
            }
            long num1 = Network.GetServerTime() - (long)this.at;
            int  num2 = (int)(num1 / (long)this.interval);

            return((long)this.interval - (num1 - (long)this.interval * (long)num2));
        }
Esempio n. 14
0
        private bool LoadAppealMaster(string path)
        {
            if (string.IsNullOrEmpty(path))
            {
                return(false);
            }
            string src = AssetManager.LoadTextData(path);

            if (string.IsNullOrEmpty(src))
            {
                return(false);
            }
            try
            {
                JSON_AppealEventShopMaster[] jsonArray = JSONParser.parseJSONArray <JSON_AppealEventShopMaster>(src);
                if (jsonArray == null)
                {
                    throw new InvalidJSONException();
                }
                long serverTime = Network.GetServerTime();
                AppealEventShopMaster appealEventShopMaster1 = new AppealEventShopMaster();
                foreach (JSON_AppealEventShopMaster json in jsonArray)
                {
                    AppealEventShopMaster appealEventShopMaster2 = new AppealEventShopMaster();
                    if (appealEventShopMaster2.Deserialize(json) && appealEventShopMaster2.start_at <= serverTime && appealEventShopMaster2.end_at > serverTime)
                    {
                        if (appealEventShopMaster1 == null)
                        {
                            appealEventShopMaster1 = appealEventShopMaster2;
                        }
                        else if (appealEventShopMaster1.priority < appealEventShopMaster2.priority)
                        {
                            appealEventShopMaster1 = appealEventShopMaster2;
                        }
                    }
                }
                if (appealEventShopMaster1 != null)
                {
                    this.mAppealID   = appealEventShopMaster1.appeal_id;
                    this.mPosX_Chara = appealEventShopMaster1.position_chara;
                    this.mPosX_Text  = appealEventShopMaster1.position_text;
                }
            }
            catch (Exception ex)
            {
                DebugUtility.LogException(ex);
                return(false);
            }
            return(true);
        }
Esempio n. 15
0
        public void Update()
        {
            if ((int)this.val >= (int)this.valMax || (double)this.lastUpdateTime == (double)Time.get_realtimeSinceStartup())
            {
                return;
            }
            this.lastUpdateTime = Time.get_realtimeSinceStartup();
            long num1     = Network.GetServerTime() - (long)this.at;
            long at       = (long)this.at;
            long interval = (long)this.interval;
            int  num2     = (int)(num1 / interval);

            this.at  = (OLong)(at + (long)num2 * interval);
            this.val = (OInt)Math.Min((int)this.val + num2, (int)this.valMax);
        }
Esempio n. 16
0
        private void RefreshTimer()
        {
            DateTime serverTime = TimeManager.ServerTime;
            DateTime dateTime   = TimeManager.FromUnixTime(this.mEndAt);
            TimeSpan timeSpan   = dateTime - serverTime;

            if (this.Disabled && timeSpan.TotalSeconds < 0.0 && this.mGachaEndAt >= Network.GetServerTime())
            {
                this.mEndAt = TimeManager.FromDateTime(dateTime.AddDays(1.0));
                dateTime    = TimeManager.FromUnixTime(this.mEndAt);
                timeSpan    = dateTime - serverTime;
                SRPG_Button component = (SRPG_Button)((Component)this).GetComponent <SRPG_Button>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    ((Selectable)component).set_interactable(true);
                    this.Disabled = false;
                }
            }
            string empty = string.Empty;
            string str;

            if (timeSpan.TotalDays >= 1.0)
            {
                str = LocalizedText.Get(this.FormatKey + "D", new object[1]
                {
                    (object)timeSpan.Days
                });
            }
            else if (timeSpan.TotalHours >= 1.0)
            {
                str = LocalizedText.Get(this.FormatKey + "H", new object[1]
                {
                    (object)timeSpan.Hours
                });
            }
            else
            {
                str = LocalizedText.Get(this.FormatKey + "M", new object[1]
                {
                    (object)Mathf.Max(timeSpan.Minutes, 0)
                });
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Value, (UnityEngine.Object)null) && this.Value.get_text() != str)
            {
                this.Value.set_text(str);
            }
            this.SetUpdateTimer(1f);
        }
Esempio n. 17
0
        private bool LoadAppealMaster(string path)
        {
            if (string.IsNullOrEmpty(path))
            {
                return(false);
            }
            string src = AssetManager.LoadTextData(path);

            if (string.IsNullOrEmpty(src))
            {
                return(false);
            }
            try
            {
                JSON_AppealQuestMaster[] jsonArray = JSONParser.parseJSONArray <JSON_AppealQuestMaster>(src);
                if (jsonArray == null)
                {
                    throw new InvalidJSONException();
                }
                long          serverTime = Network.GetServerTime();
                List <string> stringList = new List <string>();
                foreach (JSON_AppealQuestMaster json in jsonArray)
                {
                    AppealQuestMaster appealQuestMaster = new AppealQuestMaster();
                    if (appealQuestMaster.Deserialize(json) && appealQuestMaster.start_at <= serverTime && appealQuestMaster.end_at > serverTime)
                    {
                        stringList.Add(appealQuestMaster.appeal_id);
                    }
                }
                if (stringList != null)
                {
                    if (stringList.Count > 0)
                    {
                        this.mAppealIds = new string[stringList.Count];
                        this.mAppealIds = stringList.ToArray();
                    }
                }
            }
            catch (Exception ex)
            {
                DebugUtility.LogException(ex);
                return(false);
            }
            return(true);
        }
Esempio n. 18
0
        private bool LoadAppealMaster(string path)
        {
            if (string.IsNullOrEmpty(path))
            {
                return(false);
            }
            string src = AssetManager.LoadTextData(path);

            if (string.IsNullOrEmpty(src))
            {
                return(false);
            }
            try
            {
                JSON_AppealGachaMaster[] jsonArray = JSONParser.parseJSONArray <JSON_AppealGachaMaster>(src);
                if (jsonArray == null)
                {
                    throw new InvalidJSONException();
                }
                long   serverTime = Network.GetServerTime();
                string str        = string.Empty;
                foreach (JSON_AppealGachaMaster json in jsonArray)
                {
                    AppealGachaMaster appealGachaMaster = new AppealGachaMaster();
                    if (appealGachaMaster.Deserialize(json) && appealGachaMaster.start_at <= serverTime && appealGachaMaster.end_at > serverTime)
                    {
                        str        = appealGachaMaster.appeal_id;
                        this.IsNew = appealGachaMaster.is_new;
                        break;
                    }
                }
                if (!string.IsNullOrEmpty(str))
                {
                    this.mAppealId = str;
                }
            }
            catch (Exception ex)
            {
                DebugUtility.LogException(ex);
                return(false);
            }
            return(true);
        }
Esempio n. 19
0
 private void SetDeactivateNotAvailableUnit()
 {
     using (List <GameObject> .Enumerator enumerator1 = this.mCurrentUnitObjects.GetEnumerator())
     {
         while (enumerator1.MoveNext())
         {
             GameObject current = enumerator1.Current;
             // ISSUE: object of a compiler-generated type is created
             // ISSUE: variable of a compiler-generated type
             QuestBookmarkWindow.\u003CSetDeactivateNotAvailableUnit\u003Ec__AnonStorey362 unitCAnonStorey362 = new QuestBookmarkWindow.\u003CSetDeactivateNotAvailableUnit\u003Ec__AnonStorey362();
             // ISSUE: reference to a compiler-generated field
             unitCAnonStorey362.\u003C\u003Ef__this = this;
             QuestBookmarkWindow.ItemAndQuests dataOfClass = DataSource.FindDataOfClass <QuestBookmarkWindow.ItemAndQuests>(current, (QuestBookmarkWindow.ItemAndQuests)null);
             QuestParam[] availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
             bool         flag            = false;
             // ISSUE: reference to a compiler-generated field
             unitCAnonStorey362.currentTime = Network.GetServerTime();
             // ISSUE: object of a compiler-generated type is created
             // ISSUE: variable of a compiler-generated type
             QuestBookmarkWindow.\u003CSetDeactivateNotAvailableUnit\u003Ec__AnonStorey363 unitCAnonStorey363 = new QuestBookmarkWindow.\u003CSetDeactivateNotAvailableUnit\u003Ec__AnonStorey363();
             // ISSUE: reference to a compiler-generated field
             unitCAnonStorey363.\u003C\u003Ef__ref\u0024866 = unitCAnonStorey362;
             // ISSUE: reference to a compiler-generated field
             unitCAnonStorey363.\u003C\u003Ef__this = this;
             using (List <QuestParam> .Enumerator enumerator2 = dataOfClass.quests.GetEnumerator())
             {
                 while (enumerator2.MoveNext())
                 {
                     // ISSUE: reference to a compiler-generated field
                     unitCAnonStorey363.quest = enumerator2.Current;
                     // ISSUE: reference to a compiler-generated method
                     if (((IEnumerable <QuestParam>)availableQuests).Any <QuestParam>(new Func <QuestParam, bool>(unitCAnonStorey363.\u003C\u003Em__3E2)))
                     {
                         flag = true;
                         break;
                     }
                 }
             }
             ((BookmarkUnit)current.GetComponent <BookmarkUnit>()).Overlay.SetActive(!flag);
         }
     }
 }
Esempio n. 20
0
        private void OnItemSelect(GameObject go)
        {
            ChapterParam dataOfClass = DataSource.FindDataOfClass <ChapterParam>(go, (ChapterParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            QuestParam[] availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
            long         serverTime      = Network.GetServerTime();
            int          num1            = 0;
            int          num2            = 0;

            for (int index = 0; index < availableQuests.Length; ++index)
            {
                if (availableQuests[index].ChapterID == dataOfClass.iname && !availableQuests[index].IsMulti)
                {
                    ++num1;
                    if (availableQuests[index].IsJigen && !availableQuests[index].IsDateUnlock(serverTime))
                    {
                        ++num2;
                    }
                }
            }
            if (num1 > 0 && num1 == num2)
            {
                UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.QUEST_OUT_OF_DATE"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
            }
            else
            {
                if (dataOfClass.quests == null || dataOfClass.quests.Count <= 0)
                {
                    return;
                }
                this.mCurrentQuest         = dataOfClass.quests[0];
                GlobalVars.SelectedQuestID = this.mCurrentQuest.iname;
                DataSource.Bind <QuestParam>(((Component)this).get_gameObject(), this.mCurrentQuest);
                this.ResetMissionButton();
                this.LoadBossData(this.mCurrentQuest);
                this.LoadTeam();
            }
        }
Esempio n. 21
0
        private void OnMultiTowerSelect(GameObject go)
        {
            QuestParam dataOfClass = DataSource.FindDataOfClass <QuestParam>(go, (QuestParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            long serverTime = Network.GetServerTime();

            if (dataOfClass.IsJigen && !dataOfClass.IsDateUnlock(serverTime))
            {
                UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.QUEST_OUT_OF_DATE"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
            }
            else
            {
                GlobalVars.SelectedMultiTowerID = dataOfClass.iname;
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 201);
            }
        }
Esempio n. 22
0
        private SubQuestTypes GetHighestPrioritySubType()
        {
            ChapterParam[] chapters        = MonoSingleton <GameManager> .Instance.Chapters;
            QuestParam[]   availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
            long           serverTime      = Network.GetServerTime();
            ChapterParam   currentChapter;

            using (List <ChapterParam> .Enumerator enumerator = this.GetAvailableChapters(EventQuestList.EventQuestTypes.Normal, chapters, availableQuests, (string)GlobalVars.SelectedSection, (string)null, serverTime, out currentChapter).GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ChapterParam current = enumerator.Current;
                    if (current.GetSubQuestType() == SubQuestTypes.Special && this.ChapterContainsPlayableQuest(current, chapters, availableQuests, serverTime))
                    {
                        return(SubQuestTypes.Special);
                    }
                }
            }
            return(SubQuestTypes.Limited);
        }
Esempio n. 23
0
        public ReqBtlOrdealReq(string iname, List <SupportData> supports, Network.ResponseCallback response)
        {
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            this.name = "btl/ordeal/req";
            stringBuilder.Append("\"iname\":\"");
            stringBuilder.Append(iname);
            stringBuilder.Append("\",");
            stringBuilder.Append("\"req_at\":");
            stringBuilder.Append(Network.GetServerTime());
            stringBuilder.Append(",");
            stringBuilder.Append("\"btlparam\":{\"helps\":[");
            for (int index = 0; index < supports.Count; ++index)
            {
                if (supports != null)
                {
                    if (index > 0)
                    {
                        stringBuilder.Append(",");
                    }
                    SupportData support = supports[index];
                    if (support == null)
                    {
                        stringBuilder.Append("{}");
                    }
                    else
                    {
                        stringBuilder.Append("{");
                        stringBuilder.Append("\"fuid\":");
                        stringBuilder.Append("\"" + support.FUID + "\"");
                        stringBuilder.Append(",\"elem\":" + (object)support.Unit.SupportElement);
                        stringBuilder.Append(",\"iname\":\"" + support.Unit.UnitID + "\"");
                        stringBuilder.Append("}");
                    }
                }
            }
            stringBuilder.Append("]");
            stringBuilder.Append("}");
            this.body     = WebAPI.GetRequestString(stringBuilder.ToString());
            this.callback = response;
        }
Esempio n. 24
0
        public ReqBtlComRaid(string iname, int ticket, Network.ResponseCallback response, int partyIndex)
        {
            this.name = "btl/com/raid2";
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            stringBuilder.Append("\"iname\":\"");
            stringBuilder.Append(iname);
            stringBuilder.Append("\",");
            if (partyIndex >= 0)
            {
                stringBuilder.Append("\"partyid\":");
                stringBuilder.Append(partyIndex);
                stringBuilder.Append(",");
            }
            stringBuilder.Append("\"req_at\":");
            stringBuilder.Append(Network.GetServerTime());
            stringBuilder.Append(",");
            stringBuilder.Append("\"ticket\":");
            stringBuilder.Append(ticket.ToString());
            this.body     = WebAPI.GetRequestString(stringBuilder.ToString());
            this.callback = response;
        }
Esempio n. 25
0
        private void OnItemSelect(GameObject go)
        {
            ChapterParam dataOfClass = DataSource.FindDataOfClass <ChapterParam>(go, (ChapterParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            QuestParam[] availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
            long         serverTime      = Network.GetServerTime();
            int          num1            = 0;
            int          num2            = 0;

            for (int index = 0; index < availableQuests.Length; ++index)
            {
                if (availableQuests[index].ChapterID == dataOfClass.iname && !availableQuests[index].IsMulti)
                {
                    ++num1;
                    if (availableQuests[index].IsJigen && !availableQuests[index].IsDateUnlock(serverTime))
                    {
                        ++num2;
                    }
                }
            }
            if (num1 > 0 && num1 == num2)
            {
                UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.QUEST_OUT_OF_DATE"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
            }
            else
            {
                GlobalVars.SelectedChapter.Set(dataOfClass.iname);
                WorldMapController instance = WorldMapController.FindInstance(this.WorldMapControllerID);
                if (Object.op_Inequality((Object)instance, (Object)null))
                {
                    instance.GotoArea(dataOfClass.world);
                }
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 100);
            }
        }
Esempio n. 26
0
        public void SetRestTime(GameObject gobj, long endTime)
        {
            Text component = (Text)gobj.GetComponent <Text>();

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
            {
                return;
            }
            long num = endTime - Network.GetServerTime();

            if (num <= 0L)
            {
                return;
            }
            string str;

            if (num >= 86400L)
            {
                str = LocalizedText.Get("sys.QUEST_TIMELIMIT_D", new object[1]
                {
                    (object)(int)(num / 86400L)
                });
            }
            else if (num >= 3600L)
            {
                str = LocalizedText.Get("sys.QUEST_TIMELIMIT_H", new object[1]
                {
                    (object)(int)(num / 3600L)
                });
            }
            else
            {
                str = LocalizedText.Get("sys.QUEST_TIMELIMIT_M", new object[1]
                {
                    (object)(int)(num / 60L)
                });
            }
            component.set_text(str);
        }
Esempio n. 27
0
        private void RefreshSwitchButton()
        {
            ChapterParam[] chapters = MonoSingleton <GameManager> .Instance.Chapters;
            bool           flag     = false;

            if (chapters != null)
            {
                long serverTime = Network.GetServerTime();
                for (int index = 0; index < chapters.Length; ++index)
                {
                    if (chapters[index].IsKeyQuest() && chapters[index].IsKeyUnlock(serverTime))
                    {
                        flag = true;
                    }
                }
            }
            if (!Object.op_Inequality((Object)this.KeyQuestOpenEffect, (Object)null))
            {
                return;
            }
            this.KeyQuestOpenEffect.SetActive(flag);
        }
Esempio n. 28
0
        private void CreateUnitPanels(IEnumerable <QuestBookmarkWindow.ItemAndQuests> targetPieces, string sectionName)
        {
            UnitParam[] allUnits = MonoSingleton <GameManager> .Instance.MasterParam.GetAllUnits();

            Dictionary <string, QuestParam> dictionary = ((IEnumerable <QuestParam>)MonoSingleton <GameManager> .Instance.Player.AvailableQuests).ToDictionary <QuestParam, string>((Func <QuestParam, string>)(quest => quest.iname));

            foreach (QuestBookmarkWindow.ItemAndQuests targetPiece in targetPieces)
            {
                QuestBookmarkWindow.ItemAndQuests itemQuests = targetPiece;
                GameObject   root      = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                BookmarkUnit component = (BookmarkUnit)root.GetComponent <BookmarkUnit>();
                bool         flag1     = this.mBookmarkedPieces.Exists((Predicate <QuestBookmarkWindow.ItemAndQuests>)(p => p.itemName == itemQuests.itemName));
                component.BookmarkIcon.SetActive(flag1);
                long serverTime = Network.GetServerTime();
                bool flag2      = false;
                foreach (QuestParam questParam1 in !(sectionName == this.BookmarkSectionName) ? itemQuests.quests.Where <QuestParam>((Func <QuestParam, bool>)(q => q.world == sectionName)) : (IEnumerable <QuestParam>)itemQuests.quests)
                {
                    QuestParam questParam2;
                    if (dictionary.TryGetValue(questParam1.iname, out questParam2) && this.IsAvailableQuest(questParam2, serverTime))
                    {
                        flag2 = true;
                        break;
                    }
                }
                component.Overlay.SetActive(!flag2);
                component.Button.AddListener(new SRPG_Button.ButtonClickEvent(this.OnUnitSelect));
                ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(itemQuests.itemName);

                UnitParam data = ((IEnumerable <UnitParam>)allUnits).FirstOrDefault <UnitParam>((Func <UnitParam, bool>)(unit => unit.piece == itemParam.iname));
                DataSource.Bind <ItemParam>(root, itemParam);
                DataSource.Bind <UnitParam>(root, data);
                DataSource.Bind <QuestBookmarkWindow.ItemAndQuests>(root, itemQuests);
                root.get_transform().SetParent(this.ItemContainer.get_transform(), false);
                this.mCurrentUnitObjects.Add(root);
                GameParameter.UpdateAll(root);
                root.SetActive(true);
            }
        }
Esempio n. 29
0
        private void SetCurrentAppeal()
        {
            if (this.m_ValidAppeal == null)
            {
                return;
            }
            long serverTime = Network.GetServerTime();

            for (int index = 0; index < this.m_ValidAppeal.Count; ++index)
            {
                if (this.m_ValidAppeal[index].start_at <serverTime && this.m_ValidAppeal[index].end_at> serverTime)
                {
                    this.m_CurrentAppealId    = this.m_ValidAppeal[index].appeal_id;
                    this.m_CurrentAppealIndex = index;
                    break;
                }
            }
            if (string.IsNullOrEmpty(this.m_CurrentAppealId) || !this.mCacheAppealSprites.ContainsKey(this.m_CurrentAppealId))
            {
                return;
            }
            this.AppealSprite = this.mCacheAppealSprites[this.m_CurrentAppealId];
        }
Esempio n. 30
0
        private bool LoadAppealMaster(string _path)
        {
            bool flag = false;

            if (!string.IsNullOrEmpty(_path))
            {
                string src = AssetManager.LoadTextData(_path);
                if (!string.IsNullOrEmpty(src))
                {
                    try
                    {
                        JSON_AppealChargeParam[] jsonArray = JSONParser.parseJSONArray <JSON_AppealChargeParam>(src);
                        if (jsonArray == null)
                        {
                            throw new InvalidJSONException();
                        }
                        long serverTime = Network.GetServerTime();
                        foreach (JSON_AppealChargeParam _json in jsonArray)
                        {
                            AppealChargeParam appealChargeParam = new AppealChargeParam();
                            appealChargeParam.Deserialize(_json);
                            if (appealChargeParam != null && appealChargeParam.end_at >= serverTime)
                            {
                                this.m_ValidAppeal.Add(appealChargeParam);
                            }
                        }
                        flag = true;
                    }
                    catch (Exception ex)
                    {
                        DebugUtility.LogError(ex.ToString());
                    }
                }
            }
            return(flag);
        }