REQ: Disable daily rebootsFixed

I originally assumed that daily reboots could be disabled by simply removing the time from the configuration JSON (leaving only the empty "Daily restarts": [ ], ), but when I tried and reloaded the plugin, I was greeted with a continuous flow of errors, one per second:

  (11:39:46) | Loaded plugin SmoothRestarter v3.1.0 by 2CHEVSKII
(11:39:47) | NullReferenceException: Object reference not set to an instance of an object
(11:39:48) | NullReferenceException: Object reference not set to an instance of an object
(11:39:49) | NullReferenceException: Object reference not set to an instance of an object
(11:39:50) | NullReferenceException: Object reference not set to an instance of an object
... and so on
As soon as I inserted a time back in the config and reloaded the plugin, the flow of errors stopped.  Looking at the code, I originally expected it to kick back the message "Daily restart times cannot be null", but on a second look, the validation apparently doesn't like empty arrays.  I tried setting it to "Daily restarts": null, and didn't spam me with errors, but did throw a single NullReferenceException into the console.

I host my Rust servers on Pterodactyl and have recently added some custom server scripts that perform automated server maintenance, wipes, etc. on specific days of the week (via cron).  Because of this, I don't need SR to do daily reboots anymore, but I would like to keep the Oxide version checking and I really like your particular UI window.

P.S. It would also be slick if there was a command for a full shutdown with the countdown UI "/sr shutdown <time>".  I could actually incorporate that into my weekly routine and set my cron jobs to restart the servers when maintenance is done.

Issue with empty daily restarts array seems to be true, thanks for the report, will fix that.
What means "Fully shutdown"? All the plugin does is the full shutdown.

Ok, I apologize - I can read the code, but I'm not super familiar with the APIs.  I would have guessed (incorrectly) that you would be calling "global.restart()", not "global.quit()".  I assume that the built-in restart has it's own countdown, defeating the purpose of having your plugin.

My host container must be auto-restarting the server after it goes down.  I didn't write those scripts, so I might need dig into those a bit.

EDIT:  Found it.  For posterity's sake, it's an internal node (Wings config.yml) setting on Pterodactyl: "detect_clean_exit_as_crash", which I now have disabled.

Thanks!

E3hVJxrsJYVEOLZ.png Rathinosk

Ok, I apologize - I can read the code, but I'm not super familiar with the APIs.  I would have guessed (incorrectly) that you would be calling "global.restart()", not "global.quit()".  I assume that the built-in restart has it's own countdown, defeating the purpose of having your plugin.

My host container must be auto-restarting the server after it goes down.  I didn't write those scripts, so I might need dig into those a bit.

EDIT:  Found it.  For posterity's sake, it's an internal node (Wings config.yml) setting on Pterodactyl: "detect_clean_exit_as_crash", which I now have disabled.

Thanks!

It is stated in the docs btw:

Important notice, please read before posting in the support section

This plugin does not re-launches your server after it was shutdown, because it is not possible. You will need an external solution to that.

My bad - I didn't RTFM...

Thanks for the super quick fix!

Locked automatically