void updateTime()
    {
        setShenMoOpenTime();
        System.DateTime serverDate  = ServerTimeKit.getDateTime();
        godsWarTime     godsTimes   = GodsWarInfoConfigManager.Instance().getSampleBySid(6001).times[2];
        int             currnetTime = serverDate.Hour * 3600 + serverDate.Minute * 60 + serverDate.Second;
        int             rushTime    = godsTimes.hour * 3600 + godsTimes.minute * 60;

        if ((rushTime - currnetTime > 0 && rushTime - currnetTime < 300) || (currnetTime - rushTime > 0 && currnetTime - rushTime < 100))
        {
            zhanOrReplay.gameObject.SetActive(false);
            return;
        }
        if (!rushFlag && rushTime - currnetTime < 0)
        {
            rushFlag = true;
            if (UiManager.Instance.isInGodsBattle)
            {
                UiManager.Instance.isInGodsBattle = false;
                UiManager.Instance.BackToWindow <MainWindow>();
                UiManager.Instance.backGround.switchBackGround("backGround_1");
                UiManager.Instance.openDialogWindow <MessageLineWindow>((win) => {
                    win.Initialize(LanguageConfigManager.Instance.getLanguage("godsCloseInfo"));
                });
                return;
            }
            OnDataLoad();
        }
    }
示例#2
0
 public void parseTime(string str)
 {
     string[] arr = str.Split('#');
     for (int i = 0; i < arr.Length; i++)
     {
         godsWarTime t = new godsWarTime();
         t = parseSigletime(arr[i]);
         times.Add(t);
     }
 }
    /// <summary>
    /// 设置神魔大战开始时间
    /// </summary>
    private void setShenMoOpenTime()
    {
        System.DateTime serverDate = ServerTimeKit.getDateTime();
        int             day        = TimeKit.getWeekCHA(serverDate.DayOfWeek);

        if (day < 5)
        {
            lblTime.text = LanguageConfigManager.Instance.getLanguage("godsWar_126",
                                                                      getDateTime(ServerTimeKit.getSecondTime() + 86400 * (5 - day)),
                                                                      GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times[0].hour + ":" +
                                                                      (GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times[0].minute == 0
                        ? "00"
                        : GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times[0].minute + ""));
        }
        else
        {
            int         currentTime = serverDate.Hour * 3600 + serverDate.Minute * 60 + serverDate.Second;
            godsWarTime gwt         = GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times[0];
            if (day == 5)
            {
                if (currentTime < gwt.hour * 3600 + gwt.minute * 60)
                {
                    lblTime.text = LanguageConfigManager.Instance.getLanguage("godsWar_126",
                                                                              getDateTime(ServerTimeKit.getSecondTime() + 86400 * (5 - day)),
                                                                              GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times[0].hour + ":" +
                                                                              (GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times[0].minute == 0
                    ? "00"
                    : GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times[0].minute + ""));
                }
                else if (currentTime > gwt.hour * 3600 + gwt.minute * 60 && currentTime < gwt.hour * 3600 + gwt.minute * 60 + 1261)
                {
                    lblTime.text = LanguageConfigManager.Instance.getLanguage("godsWar_1277");
                }
                else
                {
                    lblTime.text = LanguageConfigManager.Instance.getLanguage("godsWar_127");
                }
            }
        }

        // if (zhanOrReplay.gameObject.activeInHierarchy && zhanOrReplay.textLabel.text == LanguageConfigManager.Instance.getLanguage("godsWar_125")) lblTime.text = LanguageConfigManager.Instance.getLanguage("godsWar_127");
    }