Example #1
0
        public ServerRestartProcessor(
            INWScript script,
            INWNXAdmin nwnxAdmin,
            ITimeService time)
        {
            _          = script;
            _nwnxAdmin = nwnxAdmin;
            _time      = time;

            if (!_isLoaded)
            {
                string autoRebootMinutes = Environment.GetEnvironmentVariable("AUTO_REBOOT_MINUTES");
                if (!int.TryParse(autoRebootMinutes, out int minutes))
                {
                    minutes = DefaultRestartMinutes;
                }

                if (minutes <= 0)
                {
                    _isDisabled = true;
                    _isLoaded   = true;
                    Console.WriteLine("Server auto-reboot is DISABLED. You can enable this with the AUTO_REBOOT_MINUTES environment variable.");
                }
                else
                {
                    _isLoaded         = true;
                    _restartTime      = DateTime.UtcNow.AddMinutes(minutes);
                    _nextNotification = DateTime.UtcNow.AddMinutes(minutes < NotificationIntervalMinutes ? 1 : NotificationIntervalMinutes);

                    Console.WriteLine("Server will reboot in " + minutes + " minutes at: " + _restartTime);
                }
            }
        }
Example #2
0
 public Delete(
     INWScript script,
     INWNXAdmin admin,
     IDataService data)
 {
     _      = script;
     _admin = admin;
     _data  = data;
 }
 public PlayerValidationService(
     INWScript script,
     INWNXAdmin nwnxAdmin,
     IDataService data)
 {
     _          = script;
     _nwnxAdmin = nwnxAdmin;
     _data      = data;
 }