Example #1
0
        public override void Connect()
        {
            InitRefresh();
            m_cronRefreshManager.InitRefresher(null);
            m_deltaTimeRefresherManager.InitRefresher(null);
            m_activityRollingMsgManager.InitRefresher(null);
            var now = Data.ZoneTimeDiff.GetServerTime();

            AddRefresh(RefreshName.LoginActivity, now, 0, 0);
            AddRefresh(RefreshName.VigorUpdate, now, 0, 0);
            AddRefresh(RefreshName.Signin, now, 0, 0);
            AddRefresh(RefreshName.SpecialActivity, now, 0, 0);
            AddRefresh(RefreshName.AwakenStone, now, 0, 0);
            Hotfix_LT.Data.CronJobs cj = Hotfix_LT.Data.EventTemplateManager.Instance.GetCronJobsByName("clashofheroestimes");
            string[] strs   = cj.interval.Split(' ');
            int      minute = 0;
            int      hour   = 5;

            if (strs.Length != 6)
            {
                EB.Debug.LogError("cronTable Str Length!=6");
            }
            else
            {
                minute = int.Parse(strs[1]);
                hour   = int.Parse(strs[2]);
            }
            AddRefresh(RefreshName.HeroBattleRefresh, now, hour, minute);
            AddRefresh(RefreshName.Promotion, now, 0, 0);
        }
Example #2
0
        private void InitTime()
        {
            start = 0;
            end   = 0;

            Hotfix_LT.Data.CronJobs startTbl = Hotfix_LT.Data.EventTemplateManager.Instance.GetCronJobsByName(worldBossStartName);
            Hotfix_LT.Data.CronJobs stopTbl  = Hotfix_LT.Data.EventTemplateManager.Instance.GetCronJobsByName(worldBossStopName);

            if (startTbl == null || stopTbl == null)
            {
                return;
            }

            EB.Debug.Log(string.Format("**LTWorldBossDataManager**  startTbl::{0}", startTbl.interval));
            EB.Debug.Log(string.Format("**LTWorldBossDataManager**  stopTbl::{0}", stopTbl.interval));

            string open_time = GetWorldBossOpenWeekTime(startTbl.interval);
            int    curweek   = EB.Time.LocalWeek;

            if (open_time.Contains(curweek.ToString()))
            {
                Hotfix_LT.Data.ActivityTime startAct = GetWorldBossTime(startTbl.interval);
                Hotfix_LT.Data.ActivityTime endAct   = GetWorldBossTime(stopTbl.interval);
                start = Hotfix_LT.Data.ZoneTimeDiff.GetTime(startAct);
                end   = Hotfix_LT.Data.ZoneTimeDiff.GetTime(endAct);
            }
        }
Example #3
0
        private string GetTimeFromDuring(string key)
        {
            Hotfix_LT.Data.CronJobs cj = Hotfix_LT.Data.EventTemplateManager.Instance.GetCronJobsByName(key);
            string[] ss  = cj.interval.Split(' ');
            string   hr  = ss[2].Equals("0") ? "00" : ss[2];
            string   min = ss[1].Equals("0") ? "00" : ss[1];
            string   sec = ss[0].Equals("0") ? "00" : ss[0];

            return($"{hr}:{min}:{sec}");
        }
Example #4
0
 /// <summary>
 /// 添加前端活动跑马灯逻辑
 /// </summary>
 /// <param name="id">guide表中words中的id,用来触发文字提示的事件</param>
 /// <param name="name">event表中活动cronjobs中的name,用来拿时间</param>
 public void AddRollingMsgActivity(int msgId, string name)
 {
     Hotfix_LT.Data.CronJobs cron = Hotfix_LT.Data.EventTemplateManager.Instance.GetCronJobsByName(name);
     string[] strs = cron.interval.Split(' ');
     if (strs.Length != 6)
     {
         EB.Debug.LogError("cronTable Str Length!=6");
     }
     else
     {
         string   minute = strs[1];
         string[] hour   = strs[2].Split(',');
         string   week   = strs[5];
         for (int i = 0; i < hour.Length; i++)
         {
             m_schedulers.Add(new ActivityRollingMsgRefresher(msgId, Data.ZoneTimeDiff.GetServerTime(), minute, hour[i], week));
         }
     }
 }