예제 #1
0
        private void GetCountdown()
        {
            LegionWarTimeLine time = LTLegionWarManager.GetLegionWarStatus();

            if (time == LegionWarTimeLine.SemiFinal || time == LegionWarTimeLine.Final)
            {
                int ts = 0;
                if (LTLegionWarTimeLine.Instance != null)
                {
                    ts = Convert.ToInt32(((_WarType == WarType.Semifinal) ? LTLegionWarTimeLine.Instance.SemiFinalStopTime : LTLegionWarTimeLine.Instance.FinalStopTime) - EB.Time.Now);
                }
                string timeStr = "";
                if (ts >= 0)
                {
                    System.DateTime dt = EB.Time.FromPosixTime(ts);
                    if (dt.Hour > 0)
                    {
                        timeStr = dt.ToString("hh:mm:ss");
                    }
                    else
                    {
                        timeStr = dt.ToString("mm:ss");
                    }
                }
                TimeLabel.text = TimeLabel.transform.GetChild(0).GetComponent <UILabel>().text = timeStr;
                TimeLabel.gameObject.CustomSetActive(true);
            }
            else
            {
                isWarOver = true;
                TimeLabel.gameObject.CustomSetActive(false);
            }
        }
예제 #2
0
        /// <summary>
        /// 军团战前端状态判断方法
        /// </summary>
        /// <returns></returns>
        public static LegionWarTimeLine GetLegionWarStatus()
        {
            LegionWarTimeLine status = LegionWarTimeLine.none;
            var qualifyOpenTime      = LTLegionWarManager.Instance.WarOpenTime.QualifyOpenTime;
            var semiOpenTime         = LTLegionWarManager.Instance.WarOpenTime.SemiOpenTime;
            var finalOpenTime        = LTLegionWarManager.Instance.WarOpenTime.FinalOpenTime;
            var now         = Data.ZoneTimeDiff.GetServerTime();
            var day         = (int)(now.DayOfWeek);
            var hour        = now.Hour;
            var minute      = now.Minute;
            var second      = now.Second;
            int start_time1 = qualifyOpenTime[0].hour * 10000 + qualifyOpenTime[0].minute * 100 + qualifyOpenTime[0].second;
            int end_time1   = qualifyOpenTime[1].hour * 10000 + qualifyOpenTime[1].minute * 100 + qualifyOpenTime[1].second;
            int start_time2 = semiOpenTime[0].hour * 10000 + semiOpenTime[0].minute * 100 + semiOpenTime[0].second;
            int end_time2   = semiOpenTime[2].hour * 10000 + semiOpenTime[2].minute * 100 + semiOpenTime[2].second;
            int start_time3 = finalOpenTime[0].hour * 10000 + finalOpenTime[0].minute * 100 + finalOpenTime[0].second;
            int end_time3   = finalOpenTime[2].hour * 10000 + finalOpenTime[2].minute * 100 + finalOpenTime[2].second;
            int now_time    = hour * 10000 + minute * 100 + second;

            if ((day == qualifyOpenTime[0].day || qualifyOpenTime[0].day == -1) && now_time >= start_time1 && now_time < end_time1)
            {
                status = LegionWarTimeLine.QualifyGame;
            }
            else if ((day == semiOpenTime[0].day || semiOpenTime[0].day == -1) && now_time >= start_time2 && now_time < end_time2)
            {
                status = LegionWarTimeLine.SemiFinal;
            }
            else if ((day == finalOpenTime[0].day || finalOpenTime[0].day == -1) && now_time >= start_time3 && now_time < end_time3)
            {
                status = LegionWarTimeLine.Final;
            }
            return(status);
        }
예제 #3
0
        public void GetTimeNow()
        {
            InitTimeStamps();
            if (LTLegionWarManager.Instance.serveCurState > 0)
            {
                switch (LTLegionWarManager.Instance.serveCurState)
                {
                case 1: {
                    TimeNow = LegionWarTimeLine.QualifyGame;
                }; break;

                case 2: {
                    TimeNow = LegionWarTimeLine.SemiFinal;
                }; break;

                case 3: {
                    TimeNow = LegionWarTimeLine.Final;
                }; break;

                default: {
                    EB.Debug.LogError("LTLegionWarManager.Instance.serveCurState is error!");
                } break;
                }
            }
            else
            {
                TimeNow = CalculateTimeLinePoint();
            }
        }
예제 #4
0
        public void ShowUI(bool isShow)
        {
            if (isShow)
            {
                //军团护送
                for (int i = 0; i < TransferDartItems.Length; i++)
                {
                    TransferDartItems[i].mDMono.gameObject.CustomSetActive(false);
                }
                Hotfix_LT.Data.SpecialActivityTemplate template = Hotfix_LT.Data.EventTemplateManager.Instance.GetSpecialActivity(9005);
                if (template.awards != null)
                {
                    for (int i = 0; i < ((template.awards.Count > TransferDartItems.Length) ? TransferDartItems.Length : template.awards.Count); i++)
                    {
                        if (template.awards[i] != null)
                        {
                            TransferDartItems[i].LTItemData = template.awards[i];
                            TransferDartItems[i].mDMono.gameObject.CustomSetActive(true);
                        }
                        else
                        {
                            TransferDartItems[i].mDMono.gameObject.CustomSetActive(false);
                        }
                    }
                }

                if (Hotfix_LT.Data.EventTemplateManager.Instance.IsTimeOK("escort_start", "escort_stop"))
                {
                    TransferDartTimeLabel.color = LT.Hotfix.Utility.ColorUtility.GreenColor;
                }
                else
                {
                    TransferDartTimeLabel.color = LT.Hotfix.Utility.ColorUtility.RedColor;
                }
                LTUIUtil.SetText(TransferDartTimeLabel, Hotfix_LT.Data.EventTemplateManager.Instance.GetActivityOpenTimeStr("escort_start", "escort_stop"));

                //走配置表来设置奖励内容
                ArrayList             aList         = EB.JSON.Parse(Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigStrValue("AllianceFBReward")) as ArrayList;
                List <LTShowItemData> showItemsList = new List <LTShowItemData>();
                if (aList == null)
                {
                    FubenItems[0].LTItemData = new LTShowItemData("arena-gold", 1, "res", false);
                    FubenItems[1].LTItemData = new LTShowItemData("gold", 1, "res", false);
                }
                else
                {
                    for (int i = 0; i < aList.Count; i++)
                    {
                        string id    = EB.Dot.String("data", aList[i], string.Empty);
                        int    count = EB.Dot.Integer("quantity", aList[i], 0);
                        string type  = EB.Dot.String("type", aList[i], string.Empty);
                        if (!string.IsNullOrEmpty(id))
                        {
                            LTShowItemData showItemData = new LTShowItemData(id, count, type, false);
                            showItemsList.Add(showItemData);
                        }
                    }
                    //
                    FubenItems[0].LTItemData = showItemsList[0];
                    FubenItems[1].LTItemData = showItemsList[1];
                }

                //军团战
                Hotfix_LT.Data.SpecialActivityTemplate template2 = Hotfix_LT.Data.EventTemplateManager.Instance.GetSpecialActivity(9004);
                for (int i = 0; i < LegionWarItems.Length; i++)
                {
                    LegionWarItems[i].mDMono.gameObject.CustomSetActive(false);
                }
                if (template.awards != null)
                {
                    for (int i = 0; i < ((template2.awards.Count > LegionWarItems.Length) ? LegionWarItems.Length : template2.awards.Count); i++)
                    {
                        if (template.awards[i] != null)
                        {
                            LegionWarItems[i].LTItemData = template2.awards[i];
                            LegionWarItems[i].mDMono.gameObject.CustomSetActive(true);
                        }
                        else
                        {
                            LegionWarItems[i].mDMono.gameObject.CustomSetActive(false);
                        }
                    }
                }
                warTime = LegionWarTimeLine.none;
                string Title = string.Empty;
                LegionLogic.GetInstance().IsOpenLegionBattle();
                if (LTLegionWarManager.Instance.IsOpenWarTime())
                {
                    warTime = LTLegionWarManager.GetLegionWarStatus();
                }
                else
                {
                    Title = string.Format("[ff6699]{0}[-]\n", EB.Localizer.GetString("ID_NEXT_WEEK"));
                }

                LegionWarTimeLabel.text = string.Format("{0}{1}{2}{3}", Title, GetTimeStr(LTLegionWarManager.Instance.WarOpenTime.QualifyOpenTime, warTime == LegionWarTimeLine.QualifyGame)
                                                        , GetTimeStr(LTLegionWarManager.Instance.WarOpenTime.SemiOpenTime, warTime == LegionWarTimeLine.SemiFinal)
                                                        , GetTimeStr(LTLegionWarManager.Instance.WarOpenTime.FinalOpenTime, warTime == LegionWarTimeLine.Final));

                LegionLogic.GetInstance().IsOpenConvoy();
                LegionLogic.GetInstance().IsOpenLegionFB();
            }


            mDMono.gameObject.CustomSetActive(isShow);
        }
예제 #5
0
        public int GetActivityCount(int activityID)//仅用于活动是否需要提示以及日常界面显示,部分活动次数不准确
        {
            Hotfix_LT.Data.SpecialActivityTemplate curAct = Hotfix_LT.Data.EventTemplateManager.Instance.GetSpecialActivity(activityID);

            if (curAct == null)
            {
                return(0);
            }

            if (activityID == 9001 || activityID == 9002 || activityID == 9007)
            {
                //经验副本,金币副本,夺宝奇兵
                int    times = 0;
                string path  = string.Format("special_activity.{0}.c_times", activityID);
                DataLookupsCache.Instance.SearchDataByID(path, out times);
                return(curAct.times - times);
            }
            else if (activityID == 9003)
            {
                DataLookupsCache.Instance.SearchDataByID("world_boss.fightTimes", out int ChallengeTime);
                DataLookupsCache.Instance.SearchDataByID("world_boss.buyTimes", out int BuyTimes);
                int Maxtime = (int)Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("worldBossChallengeMaxTimes");
                return(Maxtime + BuyTimes - ChallengeTime);
            }
            else if (activityID == 9004)
            {//军团战
                //EB.Debug.LogError("军团战数据获取");
                if (!LTLegionWarManager.Instance.IsOpenWarTime())
                {
                    return(0);
                }
                LegionWarTimeLine status = LTLegionWarManager.GetLegionWarStatus();
                if (status == LegionWarTimeLine.QualifyGame)
                {
                    if (!AllianceUtil.IsJoinedAlliance)
                    {
                        return(1);
                    }
                    int myScore = LTLegionWarManager.Instance.QualifyEnemyList.MyScore;
                    return(myScore >= LTLegionWarManager.Instance.MaxScore ? 0 : 1);
                }
                else if (status == LegionWarTimeLine.SemiFinal)
                {
                    return(1);
                }
                else if (status == LegionWarTimeLine.Final)
                {
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
            else if (activityID == 9005)
            {
                //军团护送
                if (AlliancesManager.Instance.Account.State != eAllianceState.Joined)
                {
                    return(curAct.times + GetVIPAdditionTimes(activityID));
                }
                return(AllianceEscortUtil.GetResidueTransferDartNum());
            }
            else if (activityID == 9006)
            {
                //军团拦截
                if (AlliancesManager.Instance.Account.State != eAllianceState.Joined)
                {
                    return(curAct.times + GetVIPAdditionTimes(activityID));
                }
                return(AllianceEscortUtil.GetResidueRobDartNum());
            }
            else if (activityID == 9009)
            {
                //极限试炼
                int dayDisCountTime = 0;
                int oldVigor        = 0;
                int NewVigor        = 0;
                int times           = LTUltimateTrialDataManager.Instance.GetCurrencyTimes();
                NewGameConfigTemplateManager.Instance.GetEnterVigor(eBattleType.InfiniteChallenge, out dayDisCountTime, out NewVigor, out oldVigor);
                int curDisCountTime = dayDisCountTime - times;
                return(Mathf.Max(0, curDisCountTime));
                //if (!DataLookupsCache.Instance.SearchIntByID("infiniteChallenge.info.challengeTimes", out times))
                //{
                //    times = curAct.times;
                //}
                //return Mathf.Max(0, times + GetVIPAdditionTimes(activityID));
            }
            else if (activityID == 9010)
            {//天梯
                LTDailyData tempdailydata = GetDailyDataByActivityID(9010);
                if (tempdailydata == null)
                {
                    return(0);
                }
                else
                {
                    return(tempdailydata.OpenTimeValue < LTDailyDataManager.TimeNow && tempdailydata.StopTimeValue > LTDailyDataManager.TimeNow ? 1 : 0);
                }
            }
            else if (activityID == 9011)
            {//英雄交锋
                //今天赢了或者达到最大胜场 0 就不显示红点
                return(LTNewHeroBattleManager.GetInstance().GetHeroBattleTipNum());
            }
            else if (activityID == 9013)
            {
                return(IsCouldReceiveVit()?1:0);
            }
            else if (activityID == 9014)
            {
                //幸运悬赏
                int times = LTBountyTaskHudController.CurHantTimes;
                return(times);
            }
            else if (activityID == 9015)
            {
                //角斗场
                int totalTimes = VIPTemplateManager.Instance.GetTotalNum(VIPPrivilegeKey.ArenaTimes) + ArenaManager.Instance.Info.buyTimes;
                int times      = Mathf.Max(0, totalTimes - ArenaManager.Instance.Info.usedTimes);
                return(times);
            }
            else if (activityID == 9016)
            {
                //荣耀角斗场
                int freetimes = HonorArenaManager.Instance.GetHonorArenaFreeTimes();
                int usetimes  = HonorArenaManager.Instance.Info.usedTimes;
                return(freetimes - usetimes);
            }
            return(0);
        }
예제 #6
0
        private void CheckTime()
        {
            bool isShowTime        = false;
            LegionWarTimeLine time = LTLegionWarManager.GetLegionWarStatus();

            if (time != LegionWarTimeLine.QualifyGame)
            {
                isWarOver  = true;
                isShowTime = false;
            }
            else
            {
                int ts = 0;

                if (LTLegionWarTimeLine.Instance != null)
                {
                    ts = Convert.ToInt32(LTLegionWarTimeLine.Instance.QualifyEndTime - EB.Time.Now);
                }

                ts = ts <= 0 ? 0 : ts;
                DateTime dt = EB.Time.FromPosixTime(ts);
                string   timeStr;

                if (dt.Hour > 0)
                {
                    timeStr = dt.ToString("hh:mm:ss");
                }
                else
                {
                    timeStr = dt.ToString("mm:ss");
                }

                if (TimeLabel != null)
                {
                    var child = TimeLabel.transform.GetChild(0);

                    if (child != null)
                    {
                        var label = child.GetComponent <UILabel>();

                        if (label != null)
                        {
                            label.text = timeStr;
                        }
                    }

                    TimeLabel.text = timeStr;
                }

                isShowTime = true;
            }

            if (EndLabel != null)
            {
                EndLabel.gameObject.CustomSetActive(!isShowTime);
            }

            if (TimeLabel != null)
            {
                TimeLabel.gameObject.CustomSetActive(isShowTime);
            }
        }