Shutdown / Restart Plugin

tarynkelley

Retired Staff
Retired Staff
Trusted Member
Nov 14, 2015
575
178
28
Parts Unknown
Plugin Name: ServerControl

Plugin command:

/restart xxx

/shutdown xxx

(xxs for seconds, minimum 60 seconds or so)

+ a SteamID Whitelist for which Players can execute this command
+ Countdown Time Message like Rust.PP Shutdown
+ AutoSave
+ Announce Message (Popup) + GlobalChat

I'm searching for a way to shutdown / restart the server by an ingame command.

I know that at least you can modify the batch file somehow so the rust_server will automatically restart after a shutdown.

RustPP.Shutdown is unfortunately only possible with RCON and the Shutdown process is more like a hard shutdown, because players don't get disconnected automatically (like when I use CTRL+C to stop the Server Console.)
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,790
113
At your house.
github.com
Plugin Name: ServerControl

Plugin command:

/restart xxx

/shutdown xxx

(xxs for seconds, minimum 60 seconds or so)

+ a SteamID Whitelist for which Players can execute this command
+ Countdown Time Message like Rust.PP Shutdown
+ AutoSave
+ Announce Message (Popup) + GlobalChat

I'm searching for a way to shutdown / restart the server by an ingame command.

I know that at least you can modify the batch file somehow so the rust_server will automatically restart after a shutdown.

RustPP.Shutdown is unfortunately only possible with RCON and the Shutdown process is more like a hard shutdown, because players don't get disconnected automatically (like when I use CTRL+C to stop the Server Console.)
I currently only use an exe which checks if the server process is running and then restarts It.

There is no way to restart a server with a plugin.
 

tarynkelley

Retired Staff
Retired Staff
Trusted Member
Nov 14, 2015
575
178
28
Parts Unknown
I'm using this batch file at the moment:

Code:
@echo off
chcp 65001
color 0F
cls
:restart
rust_server.exe -batchmode -insecure -hostname "Rust Server" -cfg cfg/server.cfg -maxplayers 100 -port 28015 -datadir "rust_server_Data/" -nographics
timeout /T 10
echo :::::::::::::::::::::::::::::::::::::::::::::::::
echo :: The server was restarted  ::
echo :::::::::::::::::::::::::::::::::::::::::::::::::
echo %time% %date% Restart >> restart.txt
goto restart
and rustpp.shutdown to let it shutdown and therefore automatically restart.

Is there a way to execute rustpp.shutdown via a plugin so that I don't need to give the mods RCON permissions?
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,790
113
At your house.
github.com
I'm using this batch file at the moment:

Code:
@echo off
chcp 65001
color 0F
cls
:restart
rust_server.exe -batchmode -insecure -hostname "Rust Server" -cfg cfg/server.cfg -maxplayers 100 -port 28015 -datadir "rust_server_Data/" -nographics
timeout /T 10
echo :::::::::::::::::::::::::::::::::::::::::::::::::
echo :: The server was restarted  ::
echo :::::::::::::::::::::::::::::::::::::::::::::::::
echo %time% %date% Restart >> restart.txt
goto restart
and rustpp.shutdown to let it shutdown and therefore automatically restart.

Is there a way to execute rustpp.shutdown via a plugin so that I don't need to give the mods RCON permissions?
Test this please.

Commands:
/shutdown
/shutdown urgent - Immediately shuts down the server without saving

New cfg option:
shutdown_trigger=10 ; Triggers timer every 10 seconds

Permission for shutdown cmd:
CanShutdown

Kill command should be fixed
 

Attachments

tarynkelley

Retired Staff
Retired Staff
Trusted Member
Nov 14, 2015
575
178
28
Parts Unknown
The command /shutdown and /shutdown urgent has no effect at all, even though I gave myself the CanShutdown permission. There is also no error message while trying to execute it.
 

tarynkelley

Retired Staff
Retired Staff
Trusted Member
Nov 14, 2015
575
178
28
Parts Unknown
Try this.

Also rustpp.shutdown should be using the same method now.
The same with /shutdown. Nothing happens.

rustpp.shutdown works, but there is no notification for the countdown start (Server is shutting down in 60 seconds). It only starts after 10 seconds with "Server is shutting down in 50 seconds"