[sdtdserver] Feature request: announce server restarts ingame via telnet
Hello,
I don't know if this is possible, but it would be very helpful, if the user could be warned via ingame chat, when the server will be restarted. From about 30 minutes before comes the first announcement, then 15 mins and then maybe from the 5th minute starts an minute countdown.
Periodic reboots are pretty important in 7 days to Die, not only for performance reasons, it fixes also temporary bugs. Thanks for reading.
Hey.
I like the idea to at least send a message when it's rebooting, wouldn't be that hard and could also be applied to other games. The only difference between game implementation would be the way it's done. The easiest implementaiton would be for games that allow to input server text directly into the console.
For a scheduled reboot including a timer though, i'm not sure how it would be implemented, but i thought about that quite a lot too, to inform players before it happens so they don't lose important stuff. Maybe a new function like scheduled-reboot would be required, with a timer to set. It would inform of the auto reboot 120 minutes before, then every 30 mins, then 15mins before, 10m, 5m, 4m, 3m, 2m 1m, 30s, 15s, 10s, 9... all the way to 1, then display "Server rebooting".
Yeah this is a neat idea, maybe have a restart_delay setting that defaults to 10 seconds. When the update-restart or restart command is run, it uses tmux to "say restarting server in 10 seconds..." And then sleep until it runs the restart command. Probably want to include shutdown as well, so users know what's up.
Just need to gather a few things
- what commands for each game?
- how to handle the situation where a user has typed text into console but not hit enter ** do we want to just send an Enter and run whatever is in the buffer?
- do we want to add an "immediate" shutdown/restart option for skipping the timer?
what commands for each game?
Well, for source games, "say Server rebooting/stopping in x mins y seconds" For other games... I don't know.
how to handle the situation where a user has typed text into console but not hit enter ** do we want to just send an Enter and run whatever is in the buffer?
Seems lilke i'm not the only one it happened to ! As "stop" command now tries to send a "quit" command then closes the process after 30s if it doesn't stop, the problem is already solved : such function would simply use the native stop/start commands (after the timer).
do we want to add an "immediate" shutdown/restart option for skipping the time
Nope, we would want to keep stop/restart unchanged, but add new commands, something like : timer-stop / timer-restart.
No, what I mean is, let's say Joe User runs "insserver console" and is in a tmux session. He then types map ministry and DOESN'T hit Enter. So that command is just sitting in the buffer. If we just blindly send an "Enter" before our commands to make sure the prompt is clean, we may end up doing something we don't want. Like, if they typed "exit" and left it there. But we need to clear that command somehow, otherwise piping the say command won't work. I'm not sure what the best way to do this is, I know I could do it with rcon but that opens up a whole new set of issues. So I'm trying to figure out how we can handle that is all.
This seems not convenient for the end user to have to keep something into the console.
If by mistake, you keep, let's say "exit" in the console, then exitsay Server rebooting in 10 minutes , it will just not work. So the second notification for 5 minutes will hapen successfully, and that's OK that way. One should just not keep pre-typed stuff into the console anyways.
RCON is not in the program right now, "keep it simple" would be the way to go. It's already an advanced option that a very few people would use, no need to make it inhuman > Add a new parameter > add a new command >> allow to setup a custom message before shutting down/rebooting >> everybody happy.
(Makes me think about a new idea i had before, to improve the monitor function, i'm gonna talk about that into the topic.)
A possibility with the integration of gamedig is to schedule a reboot only once all players have exited the server