Пример #1
0
 public static void Exec()
 {
     if (ConnectionManager.Instance.ClientCount() > 0 && GameManager.Instance.World.IsDaytime())
     {
         ulong _worldTime     = GameManager.Instance.World.worldTime;
         int   _24HourTime    = (int)(_worldTime / 1000UL) % 24;
         int   _dusk          = (int)SkyManager.GetDuskTime();
         int   _timeRemaining = _dusk - _24HourTime;
         Phrases.Dict.TryGetValue(801, out string _phrase801);
         _phrase801 = _phrase801.Replace("{Value}", _timeRemaining.ToString());
         ChatHook.ChatMessage(null, LoadConfig.Chat_Response_Color + _phrase801 + "[-]", -1, LoadConfig.Server_Response_Name, EChatType.Global, null);
     }
 }
Пример #2
0
 public static void Exec()
 {
     if (ConnectionManager.Instance.ClientCount() > 0 && GameManager.Instance.World.IsDaytime())
     {
         ulong worldTime          = GameManager.Instance.World.worldTime;
         int   twentyFourHourTime = (int)(worldTime / 1000UL) % 24;
         int   dusk          = (int)SkyManager.GetDuskTime();
         int   timeRemaining = dusk - twentyFourHourTime;
         Phrases.Dict.TryGetValue("NightAlert1", out string phrase);
         phrase = phrase.Replace("{Value}", timeRemaining.ToString());
         ChatHook.ChatMessage(null, Config.Chat_Response_Color + phrase + "[-]", -1, Config.Server_Response_Name, EChatType.Global, null);
     }
 }
Пример #3
0
        public static void CheckBloodmoon()
        {
            ulong _worldTime      = GameManager.Instance.World.worldTime;
            int   _daysUntilHorde = Days_Until_Horde - GameUtils.WorldTimeToDays(_worldTime) % Days_Until_Horde;
            int   _worldHours     = (int)(_worldTime / 1000UL) % 24;

            if (_daysUntilHorde == Days_Until_Horde && (_worldHours >= (int)SkyManager.GetDuskTime() - 3) || SkyManager.BloodMoon())
            {
                Bloodmoon = true;
            }
            else
            {
                Bloodmoon = false;
                Auto_Shutdown();
            }
        }
 public static bool DuskSky()
 {
     try
     {
         float _duskTime      = SkyManager.GetDuskTime();
         float _timeInMinutes = SkyManager.GetTimeOfDayAsMinutes();
         if (!SkyManager.BloodMoon() && _timeInMinutes > _duskTime && !GameManager.Instance.World.IsDark())
         {
             return(true);
         }
     }
     catch (Exception e)
     {
         Log.Out(string.Format("[SERVERTOOLS] Error in PersistentOperations.DuskSky: {0}.", e));
     }
     return(false);
 }
 public static void Exec()
 {
     if (GameManager.Instance.World.IsDaytime())
     {
         ulong  _worldTime     = GameManager.Instance.World.worldTime;
         int    _24HourTime    = (int)(_worldTime / 1000UL) % 24;
         int    _dusk          = (int)SkyManager.GetDuskTime();
         int    _timeRemaining = _dusk - _24HourTime;
         string _phrase940;
         if (!Phrases.Dict.TryGetValue(940, out _phrase940))
         {
             _phrase940 = "{Time} hours until night time.";
         }
         _phrase940 = _phrase940.Replace("{Time}", _timeRemaining.ToString());
         ChatHook.ChatMessage(null, LoadConfig.Chat_Response_Color + _phrase940 + "[-]", -1, LoadConfig.Server_Response_Name, EChatType.Global, null);
     }
 }
 public static void Exec()
 {
     if (GameManager.Instance.World.IsDaytime())
     {
         ulong  _worldTime  = GameManager.Instance.World.worldTime;
         int    _worldHours = (int)(_worldTime / 1000UL) % 24;
         int    _dusk       = (int)SkyManager.GetDuskTime();
         int    _hours      = _dusk - _worldHours;
         string _phrase940;
         if (!Phrases.Dict.TryGetValue(940, out _phrase940))
         {
             _phrase940 = "{Time} hours until night time.";
         }
         _phrase940 = _phrase940.Replace("{Time}", _hours.ToString());
         GameManager.Instance.GameMessageServer((ClientInfo)null, EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase940), Config.Server_Response_Name, false, "ServerTools", false);
     }
 }
 public static bool BloodMoonDuskSky()
 {
     try
     {
         int   _daysRemaining = Day7.DaysRemaining(GameUtils.WorldTimeToDays(GameManager.Instance.World.GetWorldTime()));
         float _duskTime      = SkyManager.GetDuskTime();
         float _timeInMinutes = SkyManager.GetTimeOfDayAsMinutes();
         if (_daysRemaining == 0 && !SkyManager.BloodMoon() && _timeInMinutes > _duskTime && !GameManager.Instance.World.IsDark())
         {
             return(true);
         }
     }
     catch (Exception e)
     {
         Log.Out(string.Format("[SERVERTOOLS] Error in PersistentOperations.BloodMoonDuskSky: {0}.", e));
     }
     return(false);
 }