Mods / Restart Timer

Tags:
Utility
Author:
Darlem
Side:
Both
Created:
Feb 11th at 6:39 AM
Last modified:
Aug 5th at 12:37 AM
Downloads:
3198
Latest release (for Vintage Story 1.21.6 - 1.21.7 and 1.22.0 - 1.22.6, potentially outdated):
restarttimer_v1.3.8.zip  1-click install

When the server starts, this mod begins a uptime timer. At the configured time (default 4 hours), it runs:

  • /announce warnings at configured intervals
  • /stop at the end of the countdown

 

Default warning announcements:

  • 30 minutes

  • 15 minutes

  • 10 minutes

  • 5 minutes

  • 3 minutes

  • 1 minute

Then:

  • Stop server: /stop

Important: The mod stops the server. Something else (your hosting panel / script / service) must start it back up. Check README in mod zip for help.

 

Admins can manually trigger a restart countdown at any time:

Command:

/restart + /restart cancel

Countdown:

  • Immediately announces “Manual restart initiated. Server restart in 10 minutes.”

  • Then announcements at:

    • 5 minutes

    • 3 minutes

    • 1 minute

  • Then runs: /stop

If a manual restart is already scheduled, the mod prevents stacking multiple restart timers.

New autosave commands

 

/autosavenowset <1-1440> or /autosavenowset <1m-1440m> — Schedules a vanilla /autosavenow to run that many minutes before the next automatic restart. Both 30 and 30m work. You can configure multiple save points; duplicates are ignored.

 

/autosavenowset (no arguments) — Lists all configured autosave points and whether each has already fired this cycle.

 

/autosavenowset list — Same as above.

 

/autosavenowset clear — Removes all configured autosave points.

 

 

Commands summary

Public:

  • /rss "restart status" – show time remaining until restart(s)

Admin:

  • /restart + /restart cancel – start a manual 10-minute restart countdown
  • /autorestart set 1-24
  • /autorestart on/off

Mod Version Mod IdentifierFor Game version Downloads Released Changelog Download 1-click mod install*
1.3.8 restarttimer
1.21.6 - 1.21.7 1.22.0 - 1.22.6
237 Aug 4th at 11:04 PM restarttimer_v1.3.8.zip 1-click install

fixed a bug

1.3.7 restarttimer
1.21.6 - 1.21.7 1.22.0 - 1.22.5
110 Jul 29th at 3:19 PM restarttimer_v1.3.7.zip 1-click install

fixed setting restart time. added /autosavenowset command to add custom auto saves

1.3.6 restarttimer
1.22.1 - 1.22.3
1770 May 2nd at 1:54 AM Empty RestartTimer_v1.3.6.zip 1-click install
1.3.5 restarttimer 571 Feb 22nd at 3:45 AM RestartTimer_v1.3.5.zip 1-click install

changed /restart status to /rss. added /restart cancel

1.3.3 restarttimer 318 Feb 14th at 4:22 AM RestartTimer_v1.3.3.zip 1-click install

added in game commands to change the auro restart timer

/autorestart set 1-24

/autorestart on/off

1.3.2 restarttimer 192 Feb 11th at 6:42 AM Empty RestartTimer_v1.3.2.zip 1-click install

Disclaimer

By downloading a mod you consent to our Terms of Use.

We tell you this specifically because we want to make sure you are aware that we cannot validate every mod, and you are responsible for any damages you might incur by installing or loading mods.

This prompt will not be shown to you again (for the current browser session) if you proceed.


15 Comments (oldest first | newest first) (threaded | flat)

Alyssa4, Oct 3rd at 11:26 AM

how can I change the warning announcement timer? I only want the warning 5, 3 and 1 minutes before restart instead of 30 minutes

Bakuscout, Aug 2nd at 9:45 PM (modified Aug 2nd at 9:51 PM)

I'm trying to create bash script using this mod to help run my server, but whenever i try to get it to run the /restart command i get this. any advice?

server is currently running 1.22.3.

 

Crash Report
[Server Error] Exception: Object reference not set to an instance of an object.
   at RestartTimer.RestartTimerSystem.OnRestartCommand(IServerPlayer player, Int32 groupId, CmdArgs args)
   at Vintagestory.Common.ChatCommandApi.<>c__DisplayClass31_0.<RegisterCommand>b__0(TextCommandCallingArgs args) in VintagestoryLib\Common\API\Command\ChatCommandApi.cs:line 341
   at Vintagestory.Common.ChatCommandImpl.CallHandler(TextCommandCallingArgs callargs, Action`1 onCommandComplete, Dictionary`2 asyncParseResults) in VintagestoryLib\Common\API\Command\ChatCommandImpl.cs:line 313
   at Vintagestory.Common.ChatCommandImpl.Execute(TextCommandCallingArgs callargs, Action`1 onCommandComplete) in VintagestoryLib\Common\API\Command\ChatCommandImpl.cs:line 238
   at Vintagestory.Common.ChatCommandApi.Execute(String commandName, TextCommandCallingArgs args, Action`1 onCommandComplete) in VintagestoryLib\Common\API\Command\ChatCommandApi.cs:line 101
   at Vintagestory.Server.ServerMain.ReceiveServerConsole(String message) in VintagestoryLib\Server\ServerMain.cs:line 1341
   at Vintagestory.Server.ServerConsole.<>c__DisplayClass7_0.<readAsync>b__0() in VintagestoryLib\Server\Systems\ServerConsole.cs:line 58
   at Vintagestory.Server.ServerMain.ProcessMainThreadTasks() in VintagestoryLib\Server\ServerMain.cs:line 3099
   at Vintagestory.Server.ServerMain.ProcessMain() in VintagestoryLib\Server\ServerMain.cs:line 950
   at Vintagestory.Server.ServerMain.Process() in VintagestoryLib\Server\ServerMain.cs:line 886
Darlem , Aug 4th at 11:07 PM
@Bakuscout: I'm trying to create bash script using this mod to help run my server, but whenever i try to get it to run the /restart command i get this. any advice? server is currently running 1.22.3. Crash Report [Server Error] Exception: Object reference not set to

Thanks for the report, and for including the full stack trace — that made this really easy to pin down.

This is a bug on my end, not anything wrong with your script. The trace shows the command coming in through ReceiveServerConsole, meaning you're running /restart from the server console rather than in-game. When a command comes from the console there's no player object attached, so the very first thing my command handler does — checking the caller's controlserver privilege — was trying to read a privilege off of nothing and throwing the NRE immediately. The same issue was hiding in my reply code too, so it would have crashed on the way back out even if it got past the permission check.

It affects /restart, /autorestart, /autosavenowset and /rss from the console, not just /restart. Nothing to do with 1.22.3 — it's been there the whole time, it just never came up because everyone was typing commands in game.

I've got the fix written: console callers are now treated as authorized (the console has full authority anyway, there's no privilege to check), and command output goes to the server log instead.

One heads up for your script: the responses will show up in the server log rather than coming back on stdout, so if you're parsing output for anything you'll want to point it there.

Thanks again for catching this ^-^

Paeddy, Jul 28th at 5:35 AM (modified Jul 28th at 5:35 AM)

I have changed the time in the config to one hour and it doesn't seem to affect things.

Darlem , Jul 29th at 12:59 AM
@Paeddy: I have changed the time in the config to one hour and it doesn't seem to affect things.

I'll take a look at it either tomorrow or this weekend. Thank you for letting me know ^-^

Darlem , Jul 29th at 4:00 PM
@Paeddy: I have changed the time in the config to one hour and it doesn't seem to affect things.

Updated, let me know if you run into any other issues ^-^

Bakuscout, Jul 5th at 2:54 PM

Thinking about adding this to my server, what would happen if my server run script determines the server is on battery power, and tries to shutdown in say 2 minutes?

Doctor_MooDM, Jun 6th at 12:23 PM

I hope this gets updated to 1.22.3
Seems like a great mod to have, especially when the AMP auto restart functions seem busted. Unfortunately it throws errors instead of functioning right now.

TeoJam, Jun 11th at 1:48 PM
@Doctor_MooDM: I hope this gets updated to 1.22.3Seems like a great mod to have, especially when the AMP auto restart functions seem busted. Unfortunately it throws errors instead of functioning right now.

Doctor_MooDM I'm using the AMP scheduler to take backups of my VS server and found a way to make it work:

Time based trigger with following tasks:
- Application - Stop the application
- Wait for 10 seconds (maybe a little more if you are using a mechanical hard disk)
- Backups - Take a backup

An event trigger based on this event: A backup finishes archiving, with this task
- Application - Start the application

Darlem , Feb 14th at 4:31 AM (modified Apr 6th at 12:58 PM)

MrLizzardPlz  Added /autorestart set 1-24 /autorestart on/off and a README file to help set up auto restarting the server

MrLizzardPlz, Feb 14th at 2:37 AM (modified Feb 14th at 2:47 AM)

Darl3mGh0ul
 The reason I ask was actually my friend has a server PC he runs and does hosting for the group but in this case he doesn't actually play so he doesn't know when things need to be rebooted so it was nice to be able to reboot the server when needed without need. The other thing was that we just saw auto restarts every 4hrs being a bit much compared to once a day since we are a small group.

Also I'm now realizing that I may have misread how the mod works as I assume you still need someone to turn back on the server from the server PC? Since based on your description I'm reading is just running /stop

MrLizzardPlz, Feb 13th at 6:52 AM

Is there a way to configure the auto restart or turn it off?