예제 #1
0
        public static bool AwakeningIsLock(Hotfix_LT.Data.eRoleAttr type)
        {
            //判断当日是否开启
            DateTime datetime = TaskSystem.TimeSpanToDateTime(EB.Time.Now);
            int      weeknow  = Convert.ToInt32(datetime.DayOfWeek);
            bool     isLock   = true;

            switch (type)
            {
            case Hotfix_LT.Data.eRoleAttr.Feng:
                string   goodsStr      = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigStrValue("WindOpenWeek");
                string[] tempGoodsStrs = goodsStr.Split(',');
                isLock = !ContainWeek(tempGoodsStrs, weeknow);
                break;

            case Hotfix_LT.Data.eRoleAttr.Huo:
                string   goodsStrH      = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigStrValue("FireOpenWeek");
                string[] tempGoodsStrsH = goodsStrH.Split(',');
                isLock = !ContainWeek(tempGoodsStrsH, weeknow);
                break;

            case Hotfix_LT.Data.eRoleAttr.Shui:
                string   goodsStrS      = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigStrValue("WaterOpenWeek");
                string[] tempGoodsStrsS = goodsStrS.Split(',');
                isLock = !ContainWeek(tempGoodsStrsS, weeknow);
                break;
            }
            return(isLock);
        }
예제 #2
0
        public bool SetLock()
        {
            //判断当日是否开启
            DateTime datetime = TaskSystem.TimeSpanToDateTime(EB.Time.Now);
            int      weeknow  = Convert.ToInt32(datetime.DayOfWeek);
            bool     isLock   = true;

            switch (AwakeningInstanceType)
            {
            case Hotfix_LT.Data.eRoleAttr.Feng:
                string   goodsStr      = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigStrValue("WindOpenWeek");
                string[] tempGoodsStrs = goodsStr.Split(',');
                isLock             = !ContainWeek(tempGoodsStrs, weeknow);
                OpenTimeLabel.text = string.Format(EB.Localizer.GetString("ID_EVERY_WANTONLY_DAY_OPEN"), ConvertDay(tempGoodsStrs));
                break;

            case Hotfix_LT.Data.eRoleAttr.Huo:
                string   goodsStrH      = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigStrValue("FireOpenWeek");
                string[] tempGoodsStrsH = goodsStrH.Split(',');
                isLock             = !ContainWeek(tempGoodsStrsH, weeknow);
                OpenTimeLabel.text = string.Format(EB.Localizer.GetString("ID_EVERY_WANTONLY_DAY_OPEN"), ConvertDay(tempGoodsStrsH));
                break;

            case Hotfix_LT.Data.eRoleAttr.Shui:
                string   goodsStrS      = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigStrValue("WaterOpenWeek");
                string[] tempGoodsStrsS = goodsStrS.Split(',');
                isLock             = !ContainWeek(tempGoodsStrsS, weeknow);
                OpenTimeLabel.text = string.Format(EB.Localizer.GetString("ID_EVERY_WANTONLY_DAY_OPEN"), ConvertDay(tempGoodsStrsS));
                break;
            }
            return(isLock);
        }
예제 #3
0
        private DateTime GetWeekFirstDayMon()
        {
            DateTime datetime = TaskSystem.TimeSpanToDateTime(EB.Time.Now);
            int      weeknow  = (int)datetime.DayOfWeek;
            int      daydiff  = (-1) * weeknow;
            string   FirstDay = datetime.AddDays(daydiff).ToString("yyyy-MM-dd");

            return(Convert.ToDateTime(FirstDay + " 00:00:00"));
        }
예제 #4
0
        public bool IsOpenWarTime()
        {
            var world = System.Array.Find(LoginManager.Instance.GameWorlds, w => w.Default);

            if (world.OpenTime > 0)
            {
                DateTime datetime = TaskSystem.TimeSpanToDateTime(world.OpenTime);
                int      weeknow  = (int)(datetime.DayOfWeek);
                int      daydiff  = 7 - weeknow;
                DateTime FirstDay = datetime.AddDays(daydiff);
                return(EB.Time.Now > EB.Time.ToPosixTime(FirstDay));
            }
            return(true);
        }
예제 #5
0
        public DateTime OpenWarTime()
        {
            var world = System.Array.Find(LoginManager.Instance.GameWorlds, w => w.Default);

            if (world.OpenTime > 0)
            {
                DateTime datetime = TaskSystem.TimeSpanToDateTime(world.OpenTime);
                int      weeknow  = (int)(datetime.DayOfWeek);
                int      daydiff  = 7 - weeknow;
                DateTime FirstDay = datetime.AddDays(daydiff);
                return(FirstDay);
            }
            return(Data.ZoneTimeDiff.GetServerTime());
        }