void OnRestartCancelled(string reason, int secondsRemaining = 0)
{
// reason: Why the restart was cancelled
// secondsRemaining: How many seconds were left when cancelled (0 if not applicable)
// Possible values: "Manual cancellation", "Too many players", "Plugin unload"
Puts($"Restart cancelled: {reason}. {secondsRemaining} seconds were remaining.");
}
OnRestartWarning
Called during countdown warnings (every significant interval)
void OnRestartWarning(int secondsLeft)
{
// secondsLeft: Seconds remaining until restart
// Called at: 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 seconds
if (secondsLeft <= 10)
Puts($"URGENT: Server restarting in {secondsLeft} seconds!");
}
OnRestartInitiated
Called right before the server restart process begins
void OnRestartInitiated()
{
// Server save and quit commands will execute after this hook
Puts("Server restart initiated - saving and shutting down now!");
}