コード例 #1
0
ファイル: TowerManager.cs プロジェクト: zunaalabaya/TAC-BOT
        private void SetRecoverText()
        {
            int num = MonoSingleton <GameManager> .Instance.TowerResuponse.CalcRecoverCost();

            if (Object.op_Inequality((Object)this.RecoverCost, (Object)null))
            {
                bool flag = num == 0;
                ((Component)this.RecoverCost).get_gameObject().SetActive(!flag);
                ((Component)this.RecoverCostFree).get_gameObject().SetActive(flag);
                if (num > 0)
                {
                    this.RecoverCost.set_text(num.ToString());
                }
            }
            if (!Object.op_Inequality((Object)this.RecoverTimer, (Object)null))
            {
                return;
            }
            TimeSpan timeSpan = TimeManager.FromUnixTime(this.mRecoverTime).AddMinutes(-1.0) - TimeManager.ServerTime;

            if (timeSpan.TotalMinutes < 0.0)
            {
                this.RecoverTimer.SetActive(false);
            }
            else
            {
                this.RecoverTimer.SetActive(true);
                this.UpdateTimer(timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds);
            }
        }
コード例 #2
0
 private void Start()
 {
     if (Object.op_Inequality((Object)this.Title, (Object)null))
     {
         this.Title.set_text(LocalizedText.Get("sys.BAN_USER_TITLE"));
     }
     if (Object.op_Inequality((Object)this.Message, (Object)null))
     {
         this.Message.set_text(LocalizedText.Get("sys.BAN_USER_MESSAGE"));
     }
     if (Object.op_Inequality((Object)this.LimitDate, (Object)null))
     {
         int banStatus = GlobalVars.BanStatus;
         if (banStatus == 1)
         {
             this.LimitDate.set_text(LocalizedText.Get("sys.BAN_USER_INDEFINITE"));
         }
         else
         {
             this.LimitDate.set_text(TimeManager.FromUnixTime((long)banStatus).ToString());
         }
     }
     if (!Object.op_Inequality((Object)this.CustomerID, (Object)null))
     {
         return;
     }
     this.CustomerID.set_text(GlobalVars.CustomerID);
 }
コード例 #3
0
        public bool IsOpenLinekedQuest(DateTime now, bool is_grace)
        {
            if (!this.IsLinekedQuest)
            {
                return(true);
            }
            QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(this.linked_quest);

            if (quest == null || !MonoSingleton <GameManager> .Instance.Player.IsBeginner() && quest.IsBeginner)
            {
                return(false);
            }
            bool flag;

            if (quest.IsJigen)
            {
                DateTime dateTime1 = TimeManager.FromUnixTime(quest.start);
                DateTime dateTime2 = this.AddTimeSpan(TimeManager.FromUnixTime(quest.end), !is_grace ? this.GetQuestGrace() : this.GetGraceRewardSpan());
                flag = dateTime1 <= now && now < dateTime2;
            }
            else
            {
                flag = !quest.hidden;
            }
            return(flag);
        }
コード例 #4
0
        private void Close()
        {
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.OpenRoot, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CloseRoot, (UnityEngine.Object)null))
            {
                this.OpenRoot.SetActive(false);
                this.CloseRoot.SetActive(true);
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ScheduleTxt, (UnityEngine.Object)null))
            {
                if (instance.VSFreeNextTime == 0L)
                {
                    this.ScheduleTxt.set_text(LocalizedText.Get("sys.MULTI_VERSUS_NEXT_NONE"));
                }
                else
                {
                    DateTime dateTime = TimeManager.FromUnixTime(instance.VSFreeNextTime);
                    this.ScheduleTxt.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_NEXT_AT"), (object)dateTime.Year, (object)dateTime.Month, (object)dateTime.Day, (object)dateTime.Hour, (object)dateTime.Minute));
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.FreeBtn, (UnityEngine.Object)null))
            {
                ((Selectable)this.FreeBtn).set_interactable(false);
            }
            this.mEndTime = 0L;
        }
コード例 #5
0
 private void OnMoveScene()
 {
     if (Object.op_Inequality((Object)this.CheckToggle, (Object)null) && this.CheckToggle.get_isOn())
     {
         GameUtility.setLoginInfoRead(TimeManager.FromUnixTime(TimeManager.Now()).ToString("yyyy/MM/dd"));
     }
     FlowNode_GameObject.ActivateOutputLinks((Component)this, (int)this.mSelectScene);
 }
コード例 #6
0
        private void Start()
        {
            this.Chapter = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

            if (this.Chapter == null)
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
            }
            else
            {
                if (Object.op_Inequality((Object)this.ItemTemplate, (Object)null) && this.ItemTemplate.get_activeInHierarchy())
                {
                    this.ItemTemplate.SetActive(false);
                }
                if (Object.op_Inequality((Object)this.Message, (Object)null))
                {
                    string    str       = (string)null;
                    ItemParam itemParam = (ItemParam)null;
                    int       num       = 0;
                    if (this.Chapter.keys.Count > 0)
                    {
                        KeyItem key = this.Chapter.keys[0];
                        itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(key.iname);

                        num = key.num;
                    }
                    KeyQuestTypes keyQuestType     = this.Chapter.GetKeyQuestType();
                    bool          keyQuestTimeOver = GlobalVars.KeyQuestTimeOver;
                    switch (keyQuestType)
                    {
                    case KeyQuestTypes.Timer:
                        if (this.Chapter.keytime != 0L && itemParam != null)
                        {
                            TimeSpan timeSpan = TimeManager.FromUnixTime(this.Chapter.keytime) - TimeManager.FromUnixTime(0L);
                            if (timeSpan.TotalDays >= 1.0)
                            {
                                str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_D" : "sys.KEYQUEST_TIMEOVER_D", (object)itemParam.name, (object)num, (object)timeSpan.Days);
                                break;
                            }
                            if (timeSpan.TotalHours >= 1.0)
                            {
                                str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_H" : "sys.KEYQUEST_TIMEOVER_H", (object)itemParam.name, (object)num, (object)timeSpan.Hours);
                                break;
                            }
                            str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_M" : "sys.KEYQUEST_TIMEOVER_M", (object)itemParam.name, (object)num, (object)Mathf.Max(timeSpan.Minutes, 0));
                            break;
                        }
                        break;

                    case KeyQuestTypes.Count:
                        str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_COUNT" : "sys.KEYQUEST_TIMEOVER_COUNT", (object)itemParam.name, (object)num);
                        break;
                    }
                    this.Message.set_text(str);
                }
                this.Refresh();
            }
        }
コード例 #7
0
 private void Refresh()
 {
     if (this.mEndTime <= 0L)
     {
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Hour, (UnityEngine.Object)null))
         {
             this.Hour.set_text("00");
         }
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Minute, (UnityEngine.Object)null))
         {
             this.Minute.set_text("00");
         }
         if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Second, (UnityEngine.Object)null))
         {
             return;
         }
         this.Second.set_text("00");
     }
     else
     {
         TimeSpan timeSpan     = TimeManager.FromUnixTime(this.mEndTime) - TimeManager.ServerTime;
         int      totalHours   = (int)timeSpan.TotalHours;
         int      totalMinutes = (int)timeSpan.TotalMinutes;
         int      totalSeconds = (int)timeSpan.TotalSeconds;
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Hour, (UnityEngine.Object)null))
         {
             this.Hour.set_text(string.Format("{0:D2}", (object)totalHours));
         }
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Minute, (UnityEngine.Object)null))
         {
             if (totalHours > 0)
             {
                 this.Minute.set_text(string.Format("{0:D2}", (object)(totalMinutes % (totalHours * 60))));
             }
             else
             {
                 this.Minute.set_text(string.Format("{0:D2}", (object)totalMinutes));
             }
         }
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Second, (UnityEngine.Object)null))
         {
             if (totalMinutes > 0)
             {
                 this.Second.set_text(string.Format("{0:D2}", (object)(totalSeconds % (totalMinutes * 60))));
             }
             else
             {
                 this.Second.set_text(string.Format("{0:D2}", (object)totalSeconds));
             }
         }
         if (!(timeSpan <= TimeSpan.Zero))
         {
             return;
         }
         GlobalEvent.Invoke("FINISH_GUERRILLA_SHOP_SHOW", (object)null);
     }
 }
コード例 #8
0
ファイル: QuestTimeLimit.cs プロジェクト: zunaalabaya/TAC-BOT
 private void Refresh()
 {
     if (this.mEndTime <= 0L)
     {
         if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Body, (UnityEngine.Object)null))
         {
             return;
         }
         this.Body.SetActive(false);
     }
     else
     {
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Body, (UnityEngine.Object)null))
         {
             this.Body.SetActive(true);
         }
         TimeSpan timeSpan = TimeManager.FromUnixTime(this.mEndTime) - TimeManager.ServerTime;
         string   str1     = (string)null;
         string   str2;
         if (this.IsTTMMSS)
         {
             int num1 = Math.Max(Math.Min(timeSpan.Days * 24 + timeSpan.Hours, 99), 0);
             int num2 = Math.Max(Math.Min(timeSpan.Minutes, 59), 0);
             int num3 = Math.Max(Math.Min(timeSpan.Seconds, 59), 0);
             str2 = str1 + string.Format("{0:D2}", (object)num1).ToString() + ":" + string.Format("{0:D2}", (object)num2).ToString() + ":" + string.Format("{0:D2}", (object)num3).ToString();
         }
         else if (timeSpan.TotalDays >= 1.0)
         {
             str2 = LocalizedText.Get("sys.QUEST_TIMELIMIT_D", new object[1]
             {
                 (object)timeSpan.Days
             });
         }
         else if (timeSpan.TotalHours >= 1.0)
         {
             str2 = LocalizedText.Get("sys.QUEST_TIMELIMIT_H", new object[1]
             {
                 (object)timeSpan.Hours
             });
         }
         else
         {
             str2 = LocalizedText.Get("sys.QUEST_TIMELIMIT_M", new object[1]
             {
                 (object)Mathf.Max(timeSpan.Minutes, 0)
             });
         }
         if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Timer, (UnityEngine.Object)null) || !(this.Timer.get_text() != str2))
         {
             return;
         }
         this.Timer.set_text(str2);
     }
 }
コード例 #9
0
ファイル: TowerResuponse.cs プロジェクト: zunaalabaya/TAC-BOT
        public int CalcRecoverCost()
        {
            TowerParam tower = MonoSingleton <GameManager> .Instance.FindTower(this.TowerID);

            if (tower == null)
            {
                return(0);
            }
            double num = Math.Ceiling((TimeManager.FromUnixTime(this.rtime).AddMinutes(-1.0) - TimeManager.ServerTime).TotalMinutes) / (double)tower.unit_recover_minute;

            return(Mathf.Clamp((int)Math.Ceiling((double)tower.unit_recover_coin * num), 0, (int)tower.unit_recover_coin));
        }
コード例 #10
0
        public DateTime GetQuestTime(DateTime base_time, bool is_quest_grace)
        {
            if (!this.IsLinekedQuest)
            {
                return(base_time);
            }
            QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(this.linked_quest);

            if (quest == null)
            {
                return(base_time);
            }
            return(!is_quest_grace?TimeManager.FromUnixTime(quest.end) : this.AddTimeSpan(TimeManager.FromUnixTime(quest.end), this.GetQuestGrace()));
        }
コード例 #11
0
        public bool IsAvailable(DateTime t)
        {
            if (this.end <= 0L)
            {
                return(!this.hidden);
            }
            DateTime dateTime1 = TimeManager.FromUnixTime(this.start);
            DateTime dateTime2 = TimeManager.FromUnixTime(this.end);

            if (dateTime1 <= t)
            {
                return(t < dateTime2);
            }
            return(false);
        }
コード例 #12
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);
        }
コード例 #13
0
 private void Refresh()
 {
     if (this.mEndTime <= 0L)
     {
         if (!Object.op_Inequality((Object)this.Body, (Object)null))
         {
             return;
         }
         this.Body.SetActive(false);
     }
     else
     {
         if (Object.op_Inequality((Object)this.Body, (Object)null))
         {
             this.Body.SetActive(true);
         }
         TimeSpan timeSpan = TimeManager.FromUnixTime(this.mEndTime) - TimeManager.ServerTime;
         string   str;
         if (timeSpan.TotalDays >= 1.0)
         {
             str = LocalizedText.Get("sys.QUEST_TIMELIMIT_D", new object[1]
             {
                 (object)timeSpan.Days
             });
         }
         else if (timeSpan.TotalHours >= 1.0)
         {
             str = LocalizedText.Get("sys.QUEST_TIMELIMIT_H", new object[1]
             {
                 (object)timeSpan.Hours
             });
         }
         else
         {
             str = LocalizedText.Get("sys.QUEST_TIMELIMIT_M", new object[1]
             {
                 (object)Mathf.Max(timeSpan.Minutes, 0)
             });
         }
         if (!Object.op_Inequality((Object)this.Timer, (Object)null) || !(this.Timer.get_text() != str))
         {
             return;
         }
         this.Timer.set_text(str);
     }
 }
コード例 #14
0
        private void CountDown()
        {
            if (this.mEndTime <= 0L)
            {
                return;
            }
            DateTime dateTime   = TimeManager.FromUnixTime(this.mEndTime);
            DateTime serverTime = TimeManager.ServerTime;

            if (serverTime > dateTime)
            {
                this.Close();
            }
            else
            {
                TimeSpan timeSpan = dateTime - serverTime;
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RemainTime, (UnityEngine.Object)null))
                {
                    if (timeSpan.TotalDays >= 1.0)
                    {
                        this.RemainTime.set_text(LocalizedText.Get("sys.MULTI_VERSUS_REMAIN_AT_DAY", new object[1]
                        {
                            (object)timeSpan.Days
                        }));
                    }
                    else if (timeSpan.TotalHours >= 1.0)
                    {
                        this.RemainTime.set_text(LocalizedText.Get("sys.MULTI_VERSUS_REMAIN_AT_HOUR", new object[1]
                        {
                            (object)timeSpan.Hours
                        }));
                    }
                    else
                    {
                        this.RemainTime.set_text(LocalizedText.Get("sys.MULTI_VERSUS_REMAIN_AT_MINUTE", new object[1]
                        {
                            (object)Mathf.Max(timeSpan.Minutes, 0)
                        }));
                    }
                }
                this.mWaitTime = this.UPDATE_WAIT_TIME;
            }
        }
コード例 #15
0
 private void UpdateMessageBadgeState()
 {
     if (!Object.op_Inequality((Object)this.UpdateMessageBadge, (Object)null))
     {
         return;
     }
     if (this.mOpened)
     {
         this.UpdateMessageBadge.SetActive(false);
     }
     else if (this.mChatLogOffical != null && this.mChatLogOffical.messages.Count > 0)
     {
         if (this.mChatLogOffical.messages[this.mChatLogOffical.messages.Count - 1].id == this.mLastIDOffical)
         {
             return;
         }
         this.UpdateMessageBadge.SetActive(true);
         this.RefreshCloseShowMessage();
     }
     else
     {
         if (this.mChatLog == null || this.mChatLog.messages.Count <= 0)
         {
             return;
         }
         ChatLogParam message = this.mChatLog.messages[this.mChatLog.messages.Count - 1];
         int          id      = message.id;
         if (this.mLastMessageID > -1)
         {
             if (id == this.mLastMessageID || !(message.fuid != this.gm.Player.FUID))
             {
                 return;
             }
             this.UpdateMessageBadge.SetActive(true);
             this.RefreshCloseShowMessage();
         }
         else
         {
             this.UpdateMessageBadge.SetActive((TimeManager.ServerTime - TimeManager.FromUnixTime(message.posted_at)).TotalSeconds < (double)ChatWindow.SPAN_UPDATE_MESSAGE_UICLOSE);
         }
     }
 }
コード例 #16
0
        private void ResponseCallback(WWWResult www)
        {
            if (FlowNode_Network.HasCommonError(www))
            {
                return;
            }
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                switch (errCode)
                {
                case Network.EErrCode.MultiMaintenance:
                case Network.EErrCode.VsMaintenance:
                case Network.EErrCode.MultiVersionMaintenance:
                case Network.EErrCode.MultiTowerMaintenance:
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                    break;

                default:
                    if (errCode != Network.EErrCode.OutOfDateQuest)
                    {
                        if (errCode == Network.EErrCode.MultiVersionMismatch || errCode == Network.EErrCode.VS_Version)
                        {
                            Network.RemoveAPI();
                            Network.ResetError();
                            ((Behaviour)this).set_enabled(false);
                            break;
                        }
                        FlowNode_Network.Retry();
                        break;
                    }
                    Network.RemoveAPI();
                    Network.ResetError();
                    ((Behaviour)this).set_enabled(false);
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <ReqRankMatchHistory.Response> jsonBodyResponse = (WebAPI.JSON_BodyResponse <ReqRankMatchHistory.Response>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <ReqRankMatchHistory.Response> >(www.text);
                DebugUtility.Assert(jsonBodyResponse != null, "res == null");
                if (jsonBodyResponse.body == null)
                {
                    Network.RemoveAPI();
                }
                else
                {
                    if (jsonBodyResponse.body.histories == null || jsonBodyResponse.body.histories.list == null)
                    {
                        return;
                    }
                    long unixtime = 0;
                    for (int index = 0; index < jsonBodyResponse.body.histories.list.Length; ++index)
                    {
                        ReqRankMatchHistory.ResponceHistoryList data1 = jsonBodyResponse.body.histories.list[index];
                        ListItemEvents listItemEvents = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)this.ListItem);
                        DataSource.Bind <ReqRankMatchHistory.ResponceHistoryList>(((Component)listItemEvents).get_gameObject(), data1);
                        FriendData data2 = new FriendData();
                        data2.Deserialize(data1.enemy);
                        DataSource.Bind <FriendData>(((Component)listItemEvents).get_gameObject(), data2);
                        DataSource.Bind <UnitData>(((Component)listItemEvents).get_gameObject(), data2.Unit);
                        this.AddItem(listItemEvents);
                        ((Component)listItemEvents).get_transform().SetParent(((Component)this).get_transform(), false);
                        ((Component)listItemEvents).get_gameObject().SetActive(true);
                        if (unixtime < data1.time_end)
                        {
                            unixtime = data1.time_end;
                        }
                    }
                    if (Object.op_Inequality((Object)this.LastBattleDate, (Object)null) && unixtime > 0L)
                    {
                        this.LastBattleDate.set_text(TimeManager.FromUnixTime(unixtime).ToString("MM/dd HH:mm"));
                    }
                    Network.RemoveAPI();
                }
            }
        }
コード例 #17
0
        private void Refresh()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null))
            {
                return;
            }
            LimitedShopData limitedShopData = MonoSingleton <GameManager> .Instance.Player.GetLimitedShopData();

            DebugUtility.Assert(limitedShopData != null, "ショップ情報が存在しない");
            this.ShopName.set_text(GlobalVars.LimitedShopItem.shops.info.title);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Updated, (UnityEngine.Object)null))
            {
                this.Updated.SetActive(GlobalVars.LimitedShopItem.btn_update);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Update, (UnityEngine.Object)null))
            {
                this.Update.SetActive(GlobalVars.LimitedShopItem.btn_update);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Lineup, (UnityEngine.Object)null))
            {
                this.Lineup.SetActive(GlobalVars.LimitedShopItem.btn_update);
            }
            for (int index = 0; index < this.mBuyItems.Count; ++index)
            {
                this.mBuyItems[index].get_gameObject().SetActive(false);
            }
            int      count      = limitedShopData.items.Count;
            DateTime serverTime = TimeManager.ServerTime;
            List <LimitedShopItem> nearbyTimeout = new List <LimitedShopItem>();

            for (int index = 0; index < count; ++index)
            {
                LimitedShopItem data1 = limitedShopData.items[index];
                if (data1.end != 0L)
                {
                    DateTime dateTime = TimeManager.FromUnixTime(data1.end);
                    if (!(serverTime >= dateTime))
                    {
                        if ((dateTime - serverTime).TotalHours < 1.0)
                        {
                            nearbyTimeout.Add(data1);
                        }
                    }
                    else
                    {
                        continue;
                    }
                }
                if (index >= this.mBuyItems.Count)
                {
                    GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                    gameObject.get_transform().SetParent((Transform)this.ItemLayoutParent, false);
                    this.mBuyItems.Add(gameObject);
                }
                GameObject         mBuyItem            = this.mBuyItems[index];
                LimitedShopBuyList componentInChildren = (LimitedShopBuyList)mBuyItem.GetComponentInChildren <LimitedShopBuyList>();
                componentInChildren.limitedShopItem = data1;
                DataSource.Bind <LimitedShopItem>(mBuyItem, data1);
                componentInChildren.amount.SetActive(!data1.IsSet);
                if (data1.IsArtifact)
                {
                    ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(data1.iname);

                    DataSource.Bind <ArtifactParam>(mBuyItem, artifactParam);
                }
                else if (data1.IsConceptCard)
                {
                    ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(data1.iname);
                    componentInChildren.SetupConceptCard(cardDataForDisplay);
                }
                else if (data1.IsItem || data1.IsSet)
                {
                    ItemData data2 = new ItemData();
                    data2.Setup(0L, data1.iname, data1.num);
                    DataSource.Bind <ItemData>(mBuyItem, data2);
                    DataSource.Bind <ItemParam>(mBuyItem, MonoSingleton <GameManager> .Instance.GetItemParam(data1.iname));
                }
                else
                {
                    DebugUtility.LogError(string.Format("不明な商品タイプが設定されています (shopitem.iname({0}) => {1})", (object)data1.iname, (object)data1.ShopItemType));
                }
                ListItemEvents component1 = (ListItemEvents)mBuyItem.GetComponent <ListItemEvents>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null))
                {
                    component1.OnSelect = new ListItemEvents.ListItemEvent(this.OnSelect);
                }
                Button component2 = (Button)mBuyItem.GetComponent <Button>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component2, (UnityEngine.Object)null))
                {
                    ((Selectable)component2).set_interactable(!data1.is_soldout);
                }
                mBuyItem.SetActive(true);
            }
            this.ShowAndSaveTimeOutItem(nearbyTimeout);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
コード例 #18
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)
            {
                // 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());
        }
コード例 #19
0
        private void RefreshParty()
        {
            int             lastSelectionIndex;
            PartyEditData   loadTeamPreset  = PartyUtility.LoadTeamPresets(PlayerPartyTypes.RankMatch, out lastSelectionIndex, false)[lastSelectionIndex];
            VersusRankParam versusRankParam = MonoSingleton <GameManager> .Instance.GetVersusRankParam(MonoSingleton <GameManager> .Instance.RankMatchScheduleId);

            if (versusRankParam == null)
            {
                return;
            }
            for (int index = 0; index < this.PartyUnitSlots.Length && index < loadTeamPreset.PartyData.VSWAITMEMBER_START; ++index)
            {
                if (index + 1 <= loadTeamPreset.Units.Length && loadTeamPreset.Units[index] != null)
                {
                    UnitData unitData1 = loadTeamPreset.Units[index];
                    if (unitData1.GetJobFor(PlayerPartyTypes.RankMatch) != unitData1.CurrentJob)
                    {
                        UnitData unitData2 = new UnitData();
                        unitData2.TempFlags |= UnitData.TemporaryFlags.TemporaryUnitData;
                        unitData2.Setup(unitData1);
                        unitData2.SetJob(PlayerPartyTypes.RankMatch);
                        unitData1 = unitData2;
                    }
                    unitData1.TempFlags |= UnitData.TemporaryFlags.AllowJobChange;
                    if (index == 0)
                    {
                        DataSource.Bind <UnitData>(this.PartyUnitLeader, unitData1);
                        GameParameter.UpdateAll(this.PartyUnitLeader);
                    }
                    DataSource.Bind <UnitData>(this.PartyUnitSlots[index], unitData1);
                    GameParameter.UpdateAll(this.PartyUnitSlots[index]);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PartyInfo, (UnityEngine.Object)null))
            {
                DataSource.Bind <PartyData>(this.PartyInfo, loadTeamPreset.PartyData);
                GameParameter.UpdateAll(this.PartyInfo);
            }
            DataSource.Bind <PlayerPartyTypes>(((Component)this).get_gameObject(), PlayerPartyTypes.RankMatch);
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AwardItem, (UnityEngine.Object)null))
            {
                DataSource.Bind <PlayerData>(this.AwardItem, player);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.StreakWin, (UnityEngine.Object)null))
            {
                if (player.RankMatchStreakWin > 1)
                {
                    this.StreakWin.set_text(player.RankMatchStreakWin.ToString());
                }
                else
                {
                    ((Component)((Component)this.StreakWin).get_transform().get_parent()).get_gameObject().SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.NextOpenDate, (UnityEngine.Object)null))
            {
                if (MonoSingleton <GameManager> .Instance.RankMatchNextTime == 0L)
                {
                    ((Component)this.NextOpenDate).get_gameObject().SetActive(false);
                }
                else
                {
                    DateTime dateTime = TimeManager.FromUnixTime(MonoSingleton <GameManager> .Instance.RankMatchNextTime);
                    ((Component)this.NextOpenDate).get_gameObject().SetActive(true);
                    this.NextOpenDate.set_text(dateTime.ToString("MM/dd"));
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.NextOpenTime, (UnityEngine.Object)null))
            {
                if (MonoSingleton <GameManager> .Instance.RankMatchNextTime == 0L)
                {
                    this.NextOpenTime.set_text("--");
                }
                else
                {
                    this.NextOpenTime.set_text(TimeManager.FromUnixTime(MonoSingleton <GameManager> .Instance.RankMatchNextTime).ToString("HH:mm"));
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SeasonDateText, (UnityEngine.Object)null))
            {
                this.SeasonDateText.set_text(versusRankParam.EndAt.ToString("MM/dd"));
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SeasonTimeText, (UnityEngine.Object)null))
            {
                this.SeasonTimeText.set_text(versusRankParam.EndAt.ToString("HH:mm"));
            }
            MultiPlayVersusEdit component = (MultiPlayVersusEdit)((Component)this).GetComponent <MultiPlayVersusEdit>();

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
            {
                return;
            }
            component.Set();
        }
コード例 #20
0
        private void RefreshData()
        {
            GameManager       instance       = MonoSingleton <GameManager> .Instance;
            PlayerData        player         = instance.Player;
            List <GameObject> gameObjectList = new List <GameObject>();
            int versusTowerKey = player.VersusTowerKey;
            VersusTowerParam versusTowerParam = instance.GetCurrentVersusTowerParam(-1);

            if (versusTowerParam != null)
            {
                int num = 0;
                while (num < (int)versusTowerParam.RankupNum)
                {
                    GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.template);
                    if (!UnityEngine.Object.op_Equality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
                    {
                        gameObject.SetActive(true);
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.parent, (UnityEngine.Object)null))
                        {
                            gameObject.get_transform().SetParent(this.parent.get_transform(), false);
                        }
                        Transform child1 = gameObject.get_transform().FindChild("on");
                        Transform child2 = gameObject.get_transform().FindChild("off");
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child1, (UnityEngine.Object)null))
                        {
                            ((Component)child1).get_gameObject().SetActive(versusTowerKey > 0);
                        }
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child2, (UnityEngine.Object)null))
                        {
                            ((Component)child2).get_gameObject().SetActive(versusTowerKey <= 0);
                        }
                        gameObjectList.Add(gameObject);
                    }
                    ++num;
                    --versusTowerKey;
                }
                this.template.SetActive(false);
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.nowKey, (UnityEngine.Object)null))
                {
                    this.nowKey.set_text(GameUtility.HalfNum2FullNum(player.VersusTowerKey.ToString()));
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.maxKey, (UnityEngine.Object)null))
                {
                    this.maxKey.set_text(GameUtility.HalfNum2FullNum(versusTowerParam.RankupNum.ToString()));
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.floor, (UnityEngine.Object)null))
                {
                    this.floor.set_text(player.VersusTowerFloor.ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.winbonus, (UnityEngine.Object)null))
                {
                    this.winbonus.SetActive(player.VersusTowerWinBonus > 1);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.keyrateup, (UnityEngine.Object)null))
                {
                    this.keyrateup.SetActive(player.VersusTowerWinBonus > 0 && (int)versusTowerParam.RankupNum > 0);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.bonusRate, (UnityEngine.Object)null) && player.VersusTowerWinBonus > 0 && (int)versusTowerParam.WinNum > 0)
                {
                    this.bonusRate.set_text((((int)versusTowerParam.WinNum + (int)versusTowerParam.BonusNum) / (int)versusTowerParam.WinNum).ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.winCnt, (UnityEngine.Object)null))
                {
                    this.winCnt.set_text(player.VersusTowerWinBonus.ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.endAt, (UnityEngine.Object)null))
                {
                    DateTime dateTime = TimeManager.FromUnixTime(instance.VersusTowerMatchEndAt);
                    this.endAt.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_END_AT"), (object)dateTime.Year, (object)dateTime.Month, (object)dateTime.Day, (object)dateTime.Hour, (object)dateTime.Minute));
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.keyinfo, (UnityEngine.Object)null))
                {
                    this.keyinfo.SetActive((int)versusTowerParam.RankupNum != 0);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.keyname, (UnityEngine.Object)null))
                {
                    this.keyname.SetActive((int)versusTowerParam.RankupNum != 0);
                }
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.lastfloor, (UnityEngine.Object)null))
                {
                    return;
                }
                this.lastfloor.SetActive((int)versusTowerParam.RankupNum == 0 && instance.VersusTowerMatchBegin);
            }
            else
            {
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.lastfloor, (UnityEngine.Object)null))
                {
                    return;
                }
                this.lastfloor.SetActive(false);
            }
        }
コード例 #21
0
ファイル: GlobalVars.cs プロジェクト: zunaalabaya/TAC-BOT
 public static DateTime GetDropTableGeneratedDateTime()
 {
     return(TimeManager.FromUnixTime(GlobalVars.mDropTableGeneratedUnixTime));
 }
コード例 #22
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 0)
            {
                return;
            }
            switch (this.Selection)
            {
            case FlowNode_SelectLatestChapter.SelectModes.Latest:
                FlowNode_SelectLatestChapter.SelectLatestChapter();
                break;

            case FlowNode_SelectLatestChapter.SelectModes.DailyChapter:
                DateTime dateTime = TimeManager.FromUnixTime(Network.GetServerTime());
                GlobalVars.SelectedSection.Set("WD_DAILY");
                switch (dateTime.DayOfWeek)
                {
                case DayOfWeek.Sunday:
                    GlobalVars.SelectedChapter.Set("AR_SUN");
                    break;

                case DayOfWeek.Monday:
                    GlobalVars.SelectedChapter.Set("AR_MON");
                    break;

                case DayOfWeek.Tuesday:
                    GlobalVars.SelectedChapter.Set("AR_TUE");
                    break;

                case DayOfWeek.Wednesday:
                    GlobalVars.SelectedChapter.Set("AR_WED");
                    break;

                case DayOfWeek.Thursday:
                    GlobalVars.SelectedChapter.Set("AR_THU");
                    break;

                case DayOfWeek.Friday:
                    GlobalVars.SelectedChapter.Set("AR_FRI");
                    break;

                case DayOfWeek.Saturday:
                    GlobalVars.SelectedChapter.Set("AR_SAT");
                    break;
                }

            case FlowNode_SelectLatestChapter.SelectModes.DailySection:
                GlobalVars.SelectedSection.Set("WD_DAILY");
                GlobalVars.SelectedChapter.Set(string.Empty);
                break;

            case FlowNode_SelectLatestChapter.SelectModes.CharacterQuestSection:
                GlobalVars.SelectedSection.Set("WD_CHARA");
                GlobalVars.SelectedChapter.Set(string.Empty);
                break;

            default:
                return;
            }
            this.ActivateOutputLinks(100);
        }
コード例 #23
0
        public static BannerParam[] MakeValidBannerParams(bool _is_home_banner = true)
        {
            List <BannerParam> bannerParamList = new List <BannerParam>();
            GameManager        instance        = MonoSingleton <GameManager> .Instance;

            BannerParam[] banners = instance.MasterParam.Banners;
            if (banners == null)
            {
                DebugUtility.LogError("バナーの設定がありません、有効なバナーを1つ以上設定してください");
                return((BannerParam[])null);
            }
            QuestParam lastStoryQuest = instance.Player.FindLastStoryQuest();

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

            for (int index = 0; index < banners.Length; ++index)
            {
                BannerParam param = banners[index];
                bool        flag  = true;
                if (param != null && !string.IsNullOrEmpty(param.banner) && bannerParamList.FindIndex((Predicate <BannerParam>)(p => p.iname == param.iname)) == -1 && (!_is_home_banner || param.IsHomeBanner))
                {
                    if (param.type == BannerType.shop)
                    {
                        if (instance.IsLimitedShopOpen)
                        {
                            if (instance.LimitedShopList != null && !string.IsNullOrEmpty(param.sval))
                            {
                                JSON_ShopListArray.Shops shops = Array.Find <JSON_ShopListArray.Shops>(instance.LimitedShopList, (Predicate <JSON_ShopListArray.Shops>)(p => p.gname == param.sval));
                                if (shops != null)
                                {
                                    param.begin_at = TimeManager.FromUnixTime(shops.start).ToString();
                                    param.end_at   = TimeManager.FromUnixTime(shops.end).ToString();
                                }
                                else
                                {
                                    continue;
                                }
                            }
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else if (param.type == BannerType.storyQuest)
                    {
                        flag = false;
                        if (lastStoryQuest != null)
                        {
                            QuestParam questParam;
                            if (string.IsNullOrEmpty(param.sval))
                            {
                                questParam = lastStoryQuest;
                            }
                            else
                            {
                                questParam = Array.Find <QuestParam>(availableQuests, (Predicate <QuestParam>)(p => p.iname == param.sval));
                                if (questParam == null || questParam.iname != lastStoryQuest.iname && questParam.state == QuestStates.New)
                                {
                                    questParam = lastStoryQuest;
                                }
                            }
                            if (!questParam.IsDateUnlock(serverTime))
                            {
                                continue;
                            }
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else if (param.type == BannerType.eventQuest || param.type == BannerType.multiQuest)
                    {
                        if (!string.IsNullOrEmpty(param.sval))
                        {
                            QuestParam questParam = Array.Find <QuestParam>(availableQuests, (Predicate <QuestParam>)(p => p.iname == param.sval));
                            if (questParam == null || !questParam.IsDateUnlock(serverTime))
                            {
                                continue;
                            }
                        }
                    }
                    else if (param.type != BannerType.towerQuest && param.type != BannerType.gacha)
                    {
                        if (param.type == BannerType.url)
                        {
                            if (string.IsNullOrEmpty(param.sval))
                            {
                                continue;
                            }
                        }
                        else if (param.type == BannerType.arena || param.type == BannerType.pvp || param.type != BannerType.ordealQuest)
                        {
                            ;
                        }
                    }
                    if (!flag || param.IsAvailablePeriod(now))
                    {
                        bannerParamList.Add(param);
                    }
                }
            }
            bannerParamList.Sort((Comparison <BannerParam>)((a, b) => a.priority - b.priority));
            return(bannerParamList.ToArray());
        }
コード例 #24
0
ファイル: FlowNode_Login.cs プロジェクト: zunaalabaya/TAC-BOT
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                this.OnFailed();
            }
            else
            {
                WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                if (jsonObject.body == null)
                {
                    ((Behaviour)this).set_enabled(false);
                    PlayerPrefs.SetInt("lastplv", 0);
                    PlayerPrefs.SetInt("lastviplv", 0);
                    MonoSingleton <GameManager> .Instance.Player.ClearTrophies();

                    this.ActivateOutputLinks(1);
                }
                else
                {
                    GlobalVars.CustomerID = jsonObject.body.cuid;
                    int status = jsonObject.body.status;
                    if (status != 0)
                    {
                        GlobalVars.BanStatus = jsonObject.body.status;
                        if (status == 1)
                        {
                            this.ActivateOutputLinks(5);
                        }
                        else if (jsonObject.body.status > 1)
                        {
                            this.ActivateOutputLinks(6);
                        }
                        ((Behaviour)this).set_enabled(false);
                    }
                    else
                    {
                        GameManager instance           = MonoSingleton <GameManager> .Instance;
                        long        lastConnectionTime = Network.LastConnectionTime;
                        instance.Player.LoginDate     = TimeManager.FromUnixTime(lastConnectionTime);
                        instance.Player.TutorialFlags = jsonObject.body.tut;
                        try
                        {
                            instance.Deserialize(jsonObject.body.player);
                            instance.Deserialize(jsonObject.body.units);
                            instance.Deserialize(jsonObject.body.items);
                            instance.Deserialize(jsonObject.body.parties);
                            instance.Deserialize(jsonObject.body.notify);
                            instance.Deserialize(jsonObject.body.artifacts, false);
                            instance.Deserialize(jsonObject.body.skins);
                            instance.Deserialize(jsonObject.body.vs);
                        }
                        catch (Exception ex)
                        {
                            DebugUtility.LogException(ex);
                            this.Failure();
                            return;
                        }
                        if (Object.op_Inequality((Object)this, (Object)null))
                        {
                            ((Behaviour)this).set_enabled(false);
                        }
                        GlobalVars.BtlID.Set(jsonObject.body.player.btlid);
                        if (!string.IsNullOrEmpty(jsonObject.body.player.btltype))
                        {
                            GlobalVars.QuestType = QuestParam.ToQuestType(jsonObject.body.player.btltype);
                        }
                        GameUtility.Config_OkyakusamaCode = instance.Player.OkyakusamaCode;
                        if (!PlayerPrefs.HasKey("lastplv"))
                        {
                            PlayerPrefs.SetInt("lastplv", MonoSingleton <GameManager> .Instance.Player.Lv);
                        }
                        if (!PlayerPrefs.HasKey("lastviplv"))
                        {
                            PlayerPrefs.SetInt("lastviplv", MonoSingleton <GameManager> .Instance.Player.VipRank);
                        }
                        instance.PostLogin();
                        this.ActivateOutputLinks(!string.IsNullOrEmpty(jsonObject.body.player.name) ? 3 : 2);
                    }
                }
            }
        }
コード例 #25
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());
        }
コード例 #26
0
ファイル: FlowNode_Login.cs プロジェクト: zunaalabaya/TAC-BOT
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                this.OnFailed();
            }
            else
            {
                WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                if (jsonObject.body == null)
                {
                    ((Behaviour)this).set_enabled(false);
                    PlayerPrefsUtility.SetInt(PlayerPrefsUtility.HOME_LASTACCESS_PLAYER_LV, 0, false);
                    PlayerPrefsUtility.SetInt(PlayerPrefsUtility.HOME_LASTACCESS_VIP_LV, 0, false);
                    MonoSingleton <GameManager> .Instance.Player.ClearTrophies();

                    this.ActivateOutputLinks(1);
                }
                else
                {
                    GlobalVars.CustomerID = jsonObject.body.cuid;
                    int status = jsonObject.body.status;
                    if (status != 0)
                    {
                        GlobalVars.BanStatus = jsonObject.body.status;
                        if (status == 1)
                        {
                            this.ActivateOutputLinks(5);
                        }
                        else if (jsonObject.body.status > 1)
                        {
                            this.ActivateOutputLinks(6);
                        }
                        ((Behaviour)this).set_enabled(false);
                    }
                    else
                    {
                        GameManager instance           = MonoSingleton <GameManager> .Instance;
                        long        lastConnectionTime = Network.LastConnectionTime;
                        instance.Player.LoginDate     = TimeManager.FromUnixTime(lastConnectionTime);
                        instance.Player.TutorialFlags = jsonObject.body.tut;
                        if (instance.IsRelogin)
                        {
                            try
                            {
                                if (jsonObject.body.player != null)
                                {
                                    instance.Deserialize(jsonObject.body.player);
                                }
                                if (jsonObject.body.items != null)
                                {
                                    instance.Deserialize(jsonObject.body.items);
                                }
                                if (jsonObject.body.units != null)
                                {
                                    instance.Deserialize(jsonObject.body.units);
                                }
                                if (jsonObject.body.parties != null)
                                {
                                    instance.Deserialize(jsonObject.body.parties);
                                }
                                if (jsonObject.body.notify != null)
                                {
                                    instance.Deserialize(jsonObject.body.notify);
                                }
                                if (jsonObject.body.artifacts != null)
                                {
                                    instance.Deserialize(jsonObject.body.artifacts, false);
                                }
                                if (jsonObject.body.skins != null)
                                {
                                    instance.Deserialize(jsonObject.body.skins);
                                }
                                if (jsonObject.body.vs != null)
                                {
                                    instance.Deserialize(jsonObject.body.vs);
                                }
                                if (jsonObject.body.tips != null)
                                {
                                    instance.Tips = ((IEnumerable <string>)jsonObject.body.tips).ToList <string>();
                                }
                            }
                            catch (Exception ex)
                            {
                                DebugUtility.LogException(ex);
                                this.Failure();
                                return;
                            }
                        }
                        else
                        {
                            try
                            {
                                instance.Deserialize(jsonObject.body.player);
                                instance.Deserialize(jsonObject.body.items);
                                instance.Deserialize(jsonObject.body.units);
                                instance.Deserialize(jsonObject.body.parties);
                                instance.Deserialize(jsonObject.body.notify);
                                instance.Deserialize(jsonObject.body.artifacts, false);
                                instance.Deserialize(jsonObject.body.skins);
                                instance.Deserialize(jsonObject.body.vs);
                                if (jsonObject.body.tips != null)
                                {
                                    instance.Tips = ((IEnumerable <string>)jsonObject.body.tips).ToList <string>();
                                }
                            }
                            catch (Exception ex)
                            {
                                DebugUtility.LogException(ex);
                                this.Failure();
                                return;
                            }
                        }
                        ((Behaviour)this).set_enabled(false);
                        GlobalVars.BtlID.Set(jsonObject.body.player.btlid);
                        if (!string.IsNullOrEmpty(jsonObject.body.player.btltype))
                        {
                            GlobalVars.QuestType = QuestParam.ToQuestType(jsonObject.body.player.btltype);
                        }
                        GameUtility.Config_OkyakusamaCode = instance.Player.OkyakusamaCode;
                        if (!PlayerPrefsUtility.HasKey(PlayerPrefsUtility.HOME_LASTACCESS_PLAYER_LV))
                        {
                            PlayerPrefsUtility.SetInt(PlayerPrefsUtility.HOME_LASTACCESS_PLAYER_LV, MonoSingleton <GameManager> .Instance.Player.Lv, false);
                        }
                        if (!PlayerPrefsUtility.HasKey(PlayerPrefsUtility.HOME_LASTACCESS_VIP_LV))
                        {
                            PlayerPrefsUtility.SetInt(PlayerPrefsUtility.HOME_LASTACCESS_VIP_LV, MonoSingleton <GameManager> .Instance.Player.VipRank, false);
                        }
                        instance.PostLogin();
                        PlayerData player = MonoSingleton <GameManager> .Instance.Player;
                        if (player != null)
                        {
                            MyGrowthPush.registCustomerId(player.OkyakusamaCode);
                        }
                        this.ActivateOutputLinks(!string.IsNullOrEmpty(jsonObject.body.player.name) ? 3 : 2);
                    }
                }
            }
        }
コード例 #27
0
 private void Refresh()
 {
     if (this.mEventShopItem.is_soldout)
     {
         if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TimeLimitBase, (UnityEngine.Object)null))
         {
             return;
         }
         this.TimeLimitBase.SetActive(false);
     }
     else if (this.mEndTime <= 0L)
     {
         if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TimeLimitBase, (UnityEngine.Object)null))
         {
             return;
         }
         this.TimeLimitBase.SetActive(false);
     }
     else
     {
         DateTime serverTime = TimeManager.ServerTime;
         DateTime dateTime1  = TimeManager.FromUnixTime(this.mEndTime);
         DateTime dateTime2  = TimeManager.FromUnixTime(GlobalVars.EventShopItem.shops.end);
         if (dateTime1 > dateTime2)
         {
             if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TimeLimitBase, (UnityEngine.Object)null))
             {
                 return;
             }
             this.TimeLimitBase.SetActive(false);
         }
         else
         {
             TimeSpan timeSpan = dateTime1 - serverTime;
             if (timeSpan.TotalDays >= 8.0)
             {
                 return;
             }
             Color color = timeSpan.TotalDays >= 1.0 ? Color.get_yellow() : Color.get_red();
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TimeLimitBase, (UnityEngine.Object)null))
             {
                 this.TimeLimitBase.SetActive(true);
             }
             string str = (string)null;
             if (timeSpan.TotalDays >= 1.0)
             {
                 str = string.Format(this.mDayLimit, (object)timeSpan.Days);
             }
             else if (timeSpan.TotalHours >= 1.0)
             {
                 str = string.Format(this.mHourLimit, (object)timeSpan.Hours);
             }
             else if (timeSpan.TotalSeconds > 0.0)
             {
                 str = string.Format(this.mMinuteLimit, (object)timeSpan.Minutes);
                 if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TimeLimitPopup, (UnityEngine.Object)null))
                 {
                     this.TimeLimitPopup.SetActive(true);
                 }
             }
             else if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.self_button, (UnityEngine.Object)null))
             {
                 ((Selectable)this.self_button).set_interactable(false);
             }
             if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TimeLimitText, (UnityEngine.Object)null) || !(this.TimeLimitText.get_text() != str))
             {
                 return;
             }
             ((Graphic)this.TimeLimitText).set_color(color);
             this.TimeLimitText.set_text(str);
         }
     }
 }