Exemplo n.º 1
0
 private void SetupAutoRefreshInfo()
 {
     base.transform.Find("SystemInfoPanel/SystemRefresh").gameObject.SetActive(this._shopType != UIShopType.SHOP_GACHATICKET);
     if (this._shopType != UIShopType.SHOP_GACHATICKET)
     {
         bool     flag = true;
         DateTime dateTimeFromTimeStamp = Miscs.GetDateTimeFromTimeStamp(this._storeDataItem.nextAutoRefreshTime);
         if (this._shopType == UIShopType.SHOP_ACTIVITY)
         {
             if (this._storeDataItem.scheduleChangeTime != 0)
             {
                 dateTimeFromTimeStamp = Miscs.GetDateTimeFromTimeStamp(this._storeDataItem.scheduleChangeTime);
             }
             else
             {
                 flag = false;
             }
         }
         base.transform.Find("SystemInfoPanel/SystemRefresh").gameObject.SetActive(flag);
         if (flag)
         {
             base.transform.Find("SystemInfoPanel/SystemRefresh/RemainTimer").GetComponent <MonoRemainTimer>().SetTargetTime(dateTimeFromTimeStamp, null, new Action(this.OnAutoRefreshTimeOutCallback), false);
         }
     }
 }
Exemplo n.º 2
0
 private void CheckInteractable()
 {
     if (!this._interactable || (this._endlessPlayerData == null))
     {
         base.transform.Find("BlockPanel").gameObject.SetActive(true);
     }
     else
     {
         bool     flag = true;
         DateTime dateTimeFromTimeStamp = TimeUtil.Now.AddDays(-1.0);
         if (this._endlessPlayerData.get_hidden_expire_timeSpecified())
         {
             dateTimeFromTimeStamp = Miscs.GetDateTimeFromTimeStamp(this._endlessPlayerData.get_hidden_expire_time());
         }
         if (this._endlessPlayerData.get_uid() == Singleton <PlayerModule> .Instance.playerData.userId)
         {
             flag = false;
             base.transform.Find("FrozenInfo").gameObject.SetActive(false);
         }
         else if ((this._frozenEndTime > TimeUtil.Now) || (this._endlessPlayerData.get_hidden_expire_timeSpecified() && (dateTimeFromTimeStamp > TimeUtil.Now)))
         {
             flag = false;
         }
         if (((this._endlessPlayerData.get_progress() < 2) && (this._selectToolData != null)) && (this._selectToolData.ToolType == 4))
         {
             flag = false;
         }
         if ((this._selectToolData != null) && (this._selectToolData.ToolType == 3))
         {
             flag = false;
         }
         base.transform.Find("BlockPanel").gameObject.SetActive(!flag);
     }
 }
Exemplo n.º 3
0
        public ChatMsgDataItem(ChatMsg chatMsg)
        {
            DateTime dateTimeFromTimeStamp = Miscs.GetDateTimeFromTimeStamp(chatMsg.get_time());
            string   nickname = !string.IsNullOrEmpty(chatMsg.get_nickname()) ? chatMsg.get_nickname() : ("ID. " + chatMsg.get_uid());

            this.Init((int)chatMsg.get_uid(), nickname, dateTimeFromTimeStamp, chatMsg.get_msg(), Type.MSG);
        }
Exemplo n.º 4
0
        private bool FilterMission(MissionDataItem mission)
        {
            LinearMissionData data = LinearMissionDataReader.TryGetLinearMissionDataByKey(mission.id);

            if ((data != null) && (data.IsAchievement == 1))
            {
                return(true);
            }
            if ((data != null) && (data.PreMissionId > 0))
            {
                foreach (MissionDataItem item in Singleton <MissionModule> .Instance.GetMissionDict().Values)
                {
                    if ((item.id == data.PreMissionId) && ((item.status == 2) || (item.status == 3)))
                    {
                        return(true);
                    }
                }
            }
            if (this.IsPreviewMission(mission))
            {
                TimeSpan span = (TimeSpan)(Miscs.GetDateTimeFromTimeStamp((uint)mission.beginTime) - TimeUtil.Now);
                if (span.TotalSeconds > mission.metaData.PreviewTime)
                {
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 5
0
 private void Init(int id, MailType type, string title, string content, string sender, uint time, MailAttachment attachment = null, bool isAttachmentGot = false)
 {
     this.ID              = id;
     this.type            = type;
     this.title           = title;
     this.content         = content;
     this.sender          = sender;
     this.time            = Miscs.GetDateTimeFromTimeStamp(time);
     this.attachment      = attachment;
     this.isAttachmentGot = isAttachmentGot;
 }
Exemplo n.º 6
0
        public DateTime GetFrozenEndTime(int targetUid)
        {
            EndlessItemFrozenInfo info;

            this._itemFrozenInfoDict.TryGetValue(targetUid, out info);
            if (info == null)
            {
                return(TimeUtil.Now.AddDays(-1.0));
            }
            return(Miscs.GetDateTimeFromTimeStamp(info.get_frozen_time()));
        }
Exemplo n.º 7
0
        private void OnSpecialDetailBtnClick()
        {
            if ((this._displayInfo.specialGachaData != null) && (TimeUtil.Now < Miscs.GetDateTimeFromTimeStamp(this._displayInfo.specialGachaData.get_data_expire_time())))
            {
                Singleton <MainUIManager> .Instance.ShowPage(new GachaDetailPageContext(this._displayInfo.specialGachaData.get_common_data(), 3), UIType.Page);
            }
            else
            {
                Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(LocalizationGeneralLogic.GetText("Menu_Desc_SpecialGachaTimeoutHint", new object[0]), 2f), UIType.Any);

                Singleton <NetworkManager> .Instance.RequestGachaDisplayInfo();
            }
        }
Exemplo n.º 8
0
        public DateTime CheckAvatarHPChanged(EndlessAvatarHp avatarHPData)
        {
            if ((avatarHPData.get_hp_percent() >= 100) || !avatarHPData.get_next_recover_timeSpecified())
            {
                return(DateTime.MinValue);
            }
            DateTime dateTimeFromTimeStamp = Miscs.GetDateTimeFromTimeStamp(avatarHPData.get_next_recover_time());

            if (TimeUtil.Now >= dateTimeFromTimeStamp)
            {
                Singleton <NetworkManager> .Instance.RequestEndlessAvatarHp();
            }
            return(dateTimeFromTimeStamp);
        }
Exemplo n.º 9
0
        private void FilterMissions()
        {
            List <MissionDataItem> list = Enumerable.ToList <MissionDataItem>(Singleton <MissionModule> .Instance.GetMissionDict().Values);

            this._missionList.Clear();
            foreach (MissionDataItem item in list)
            {
                bool flag = false;
                if (item.status == 5)
                {
                    flag = true;
                }
                else
                {
                    LinearMissionData data = LinearMissionDataReader.TryGetLinearMissionDataByKey(item.id);
                    if ((data != null) && (data.PreMissionId > 0))
                    {
                        foreach (MissionDataItem item2 in list)
                        {
                            if ((item2.id == data.PreMissionId) && ((item2.status == 2) || (item2.status == 3)))
                            {
                                flag = true;
                                break;
                            }
                        }
                    }
                    if (this.IsPreviewMission(item))
                    {
                        TimeSpan span = (TimeSpan)(Miscs.GetDateTimeFromTimeStamp((uint)item.beginTime) - TimeUtil.Now);
                        if (span.TotalSeconds > item.metaData.PreviewTime)
                        {
                            flag = true;
                            this._util.AddPreviewMission(item);
                        }
                    }
                    if ((data != null) && (data.IsAchievement == 1))
                    {
                        flag = true;
                    }
                }
                if (!flag)
                {
                    this._missionList.Add(item);
                }
            }
        }
Exemplo n.º 10
0
 private void Update()
 {
     if (this._missionData.metaData.type == 3)
     {
         if (this._missionData.status == 1)
         {
             if (DateTime.Compare(TimeUtil.Now, Miscs.GetDateTimeFromTimeStamp((uint)this._missionData.beginTime)) < 0)
             {
                 DateTime dateTimeFromTimeStamp = Miscs.GetDateTimeFromTimeStamp((uint)this._missionData.beginTime);
                 this.SetLeftTimeUI(TimeUtil.Now, dateTimeFromTimeStamp);
             }
         }
         else if (((this._missionData.status == 2) || (this._missionData.status == 3)) && (DateTime.Compare(TimeUtil.Now, Miscs.GetDateTimeFromTimeStamp((uint)this._missionData.endTime)) < 0))
         {
             DateTime to = Miscs.GetDateTimeFromTimeStamp((uint)this._missionData.endTime);
             this.SetLeftTimeUI(TimeUtil.Now, to);
         }
     }
 }
Exemplo n.º 11
0
 public void SetupView(EndlessToolDataItem toolData, uint timestamp, Action <int> endCallBack)
 {
     this._toolData = toolData;
     if (timestamp == 0)
     {
         this.timerMask.gameObject.SetActive(false);
         this._isUpdating = false;
     }
     else
     {
         this._targetTime           = Miscs.GetDateTimeFromTimeStamp(timestamp);
         this._timeEndCallBack      = endCallBack;
         this._timeSpan             = this._toolData.GetTimeSpanInSeconds();
         this._isUpdating           = this._timeSpan > 0;
         this._fillDirectionReverse = toolData.ToolType != 4;
         base.transform.GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(toolData.GetSmallIconPath());
         this.timerMask.gameObject.SetActive(this._timeSpan > 0);
         this.timerMask.fillAmount = 0f;
     }
 }
Exemplo n.º 12
0
        private void OnSpecialTenGachaBtnClick()
        {
            this._currentGachaType = 3;
            if ((this._displayInfo.specialGachaData != null) && (TimeUtil.Now < Miscs.GetDateTimeFromTimeStamp(this._displayInfo.specialGachaData.get_data_expire_time())))
            {
                int ticketID = (int)this._displayInfo.specialGachaData.get_ticket_material_id();
                if (this.TicketConditionCheck(ticketID, 10))
                {
                    this._waitGachaRsp.Start(this._currentGachaType, GachaAmountType.GachaTen, new Action <GachaType, GachaAmountType>(this.TriggerStageGachaBox));
                    Singleton <NetworkManager> .Instance.RequestGacha(this._currentGachaType, 10);

                    this._cost = 10;
                }
            }
            else
            {
                Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(LocalizationGeneralLogic.GetText("Menu_Desc_SpecialGachaTimeoutHint", new object[0]), 2f), UIType.Any);

                Singleton <NetworkManager> .Instance.RequestGachaDisplayInfo();
            }
        }
Exemplo n.º 13
0
        private void Update()
        {
            bool flag = false;
            uint body = 0;

            for (int i = this._previewList.Count - 1; i >= 0; i--)
            {
                MissionDataItem item = this._previewList[i];
                TimeSpan        span = (TimeSpan)(Miscs.GetDateTimeFromTimeStamp((uint)item.beginTime) - TimeUtil.Now);
                if (span.TotalSeconds <= item.metaData.PreviewTime)
                {
                    flag = true;
                    body = (uint)item.id;
                    this._previewList.RemoveAt(i);
                }
            }
            if (flag)
            {
                Singleton <NotifyManager> .Instance.FireNotify(new Notify(NotifyTypes.MissionUpdated, body));
            }
        }
Exemplo n.º 14
0
 private void SetupTimeView()
 {
     if (this._missionData.metaData.type == 3)
     {
         if (this._missionData.status == 1)
         {
             DateTime dateTimeFromTimeStamp = Miscs.GetDateTimeFromTimeStamp((uint)this._missionData.beginTime);
             this.Time_root.gameObject.SetActive(true);
             this.SetLeftTimeUI(TimeUtil.Now, dateTimeFromTimeStamp);
         }
         else if ((this._missionData.status == 2) || (this._missionData.status == 3))
         {
             DateTime to = Miscs.GetDateTimeFromTimeStamp((uint)this._missionData.endTime);
             this.Time_root.gameObject.SetActive(true);
             this.SetLeftTimeUI(TimeUtil.Now, to);
         }
         else
         {
             this.Time_root.gameObject.SetActive(false);
         }
     }
 }
Exemplo n.º 15
0
        public ChatMsgDataItem(SystemChatMsg sysChatMsg)
        {
            if (sysChatMsg.get_type() == 1)
            {
                StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)sysChatMsg.get_item_id(), 1);

                Type     mSG           = Type.MSG;
                object[] replaceParams = new object[] { string.Format("[{0}]", dummyStorageDataItem.GetDisplayTitle()) };
                string   text          = LocalizationGeneralLogic.GetText("ChatMsg_GachaGetItem", replaceParams);
                if (dummyStorageDataItem.rarity >= 4)
                {
                    string   str2      = string.Format("{0}[{1}]{2}", "<color=#9b59b6>", dummyStorageDataItem.GetDisplayTitle(), "</color>");
                    string   str3      = string.Format("{0}{1}{2}", "<color=#88c700ff>", LocalizationGeneralLogic.GetText("Chat_Content_Source_Egg", new object[0]), "</color>");
                    object[] objArray2 = new object[] { str3, str2 };
                    text = LocalizationGeneralLogic.GetText("ChatMsg_GachaGetItemFrom", objArray2);
                    mSG  = Type.LUCK_GECHA;
                }
                DateTime dateTimeFromTimeStamp = Miscs.GetDateTimeFromTimeStamp(sysChatMsg.get_time());
                string   nickname = !string.IsNullOrEmpty(sysChatMsg.get_nickname()) ? sysChatMsg.get_nickname() : ("ID. " + sysChatMsg.get_uid());
                this.Init((int)sysChatMsg.get_uid(), nickname, dateTimeFromTimeStamp, text, mSG);
            }
        }
Exemplo n.º 16
0
 public static void SetServerCurTime(uint timestamp)
 {
     _serverTimeSpan = (TimeSpan)(Miscs.GetDateTimeFromTimeStamp(timestamp) - Now);
 }
Exemplo n.º 17
0
        private void SetupSpeicalTab()
        {
            HcoinGachaData specialGachaData = this._displayInfo.specialGachaData;
            bool           flag             = (specialGachaData != null) && (TimeUtil.Now < Miscs.GetDateTimeFromTimeStamp(specialGachaData.get_data_expire_time()));

            base.view.transform.Find("SpecialTab").gameObject.SetActive(flag);
            base.view.transform.Find("TabBtns/TabBtn_2").gameObject.SetActive(flag);
            if (!flag)
            {
                if (this._currentTabKey == "SpecialTab")
                {
                    this._currentTabKey = "HcoinTab";
                }
            }
            else
            {
                StorageDataItemBase base2 = Singleton <StorageModule> .Instance.TryGetMaterialDataByID((int)specialGachaData.get_ticket_material_id());

                StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)specialGachaData.get_ticket_material_id(), 1);

                string gachaTicketIconPath = MiscData.GetGachaTicketIconPath((int)specialGachaData.get_ticket_material_id());
                Sprite spriteByPrefab      = !string.IsNullOrEmpty(gachaTicketIconPath) ? Miscs.GetSpriteByPrefab(gachaTicketIconPath) : null;
                if (spriteByPrefab == null)
                {
                    spriteByPrefab = Miscs.GetSpriteByPrefab(dummyStorageDataItem.GetIconPath());
                }
                base.view.transform.Find("SpecialTab/InfoPanel/Title/Time").GetComponent <Text>().text         = specialGachaData.get_common_data().get_title();
                base.view.transform.Find("SpecialTab/InfoPanel/Desc/Text").GetComponent <Text>().text          = UIUtil.ProcessStrWithNewLine(specialGachaData.get_common_data().get_content());
                base.view.transform.Find("SpecialTab/ActBtns/One/Btn/Text").GetComponent <Text>().text         = LocalizationGeneralLogic.GetText(MiscData.Config.GachaTimeTextID[1], new object[0]);
                base.view.transform.Find("SpecialTab/ActBtns/Ten/Btn/Text").GetComponent <Text>().text         = LocalizationGeneralLogic.GetText(MiscData.Config.GachaTimeTextID[10], new object[0]);
                base.view.transform.Find("SpecialTab/ActBtns/One/Btn/Cost/Num").GetComponent <Text>().text     = "x" + 1;
                base.view.transform.Find("SpecialTab/ActBtns/One/Btn/Cost/Icon").GetComponent <Image>().sprite = spriteByPrefab;
                base.view.transform.Find("SpecialTab/ActBtns/Ten/Btn/Cost/Num").GetComponent <Text>().text     = "x" + 10;
                base.view.transform.Find("SpecialTab/ActBtns/Ten/Btn/Cost/Icon").GetComponent <Image>().sprite = spriteByPrefab;
                base.view.transform.Find("SpecialTab/ActBtns/One/Added/Note").GetComponent <Text>().text       = LocalizationGeneralLogic.GetText("Menu_SpecialGachaNote", new object[0]);
                base.view.transform.Find("SpecialTab/ActBtns/One/Added/Num").GetComponent <Text>().text        = "2";
                base.view.transform.Find("SpecialTab/ActBtns/Ten/Added/Note").GetComponent <Text>().text       = LocalizationGeneralLogic.GetText("Menu_SpecialGachaNote", new object[0]);
                base.view.transform.Find("SpecialTab/ActBtns/Ten/Added/Num").GetComponent <Text>().text        = "20";
                base.view.transform.Find("SpecialTab/TicketRemain/Num").GetComponent <Text>().text             = (base2 != null) ? base2.number.ToString() : "0";
                base.view.transform.Find("SpecialTab/TicketRemain/Icon").GetComponent <Image>().sprite         = spriteByPrefab;
                UIUtil.TrySetupEventSprite(base.view.transform.Find("SpecialTab/SupplyImg/Pic").GetComponent <Image>(), specialGachaData.get_common_data().get_supply_image());
                UIUtil.TrySetupEventSprite(base.view.transform.Find("SpecialTab/InfoPanel/Title/Image").GetComponent <Image>(), specialGachaData.get_common_data().get_title_image());
                base.view.transform.Find("SpecialTab/RemainTime").gameObject.SetActive(specialGachaData.get_data_expire_timeSpecified());
                if (specialGachaData.get_data_expire_timeSpecified())
                {
                    base.view.transform.Find("SpecialTab/RemainTime/RemainTimer").GetComponent <MonoRemainTimer>().SetTargetTime(Miscs.GetDateTimeFromTimeStamp(specialGachaData.get_data_expire_time()), null, new Action(this.OnGachaDisplayDataExpired), false);
                }
                this._tabManager.SetTab("SpecialTab", base.view.transform.Find("TabBtns/TabBtn_2").GetComponent <Button>(), base.view.transform.Find("SpecialTab").gameObject);
            }
        }
Exemplo n.º 18
0
        public override void OnLandedFromBackPage()
        {
            base.OnLandedFromBackPage();
            bool flag = (this._displayInfo.specialGachaData != null) && (TimeUtil.Now < Miscs.GetDateTimeFromTimeStamp(this._displayInfo.specialGachaData.get_data_expire_time()));

            base.view.transform.Find("SpecialTab").gameObject.SetActive(flag && (this._currentTabKey == "SpecialTab"));
            base.view.transform.Find("TabBtns/TabBtn_2").gameObject.SetActive(flag);
            base.view.transform.Find("BlockPanel").gameObject.SetActive(false);
            if ((this._unLockAvatarDialogManager != null) && (this._unLockAvatarDialogManager.GetDialogNum() > 0))
            {
                this._unLockAvatarDialogManager.StartShow(0f);
            }
            foreach (LetterSpacing spacing in base.view.transform.GetComponentsInChildren <LetterSpacing>())
            {
                if (spacing.autoFixLine)
                {
                    spacing.AccommodateText();
                }
            }
        }