Auto Restart

Платное Auto Restart 3.8.1

Available Hooks

OnRestartScheduled
Called when a restart is scheduled (both automatic and manual)

void OnRestartScheduled(int seconds, bool isCustom)
{
// seconds: Time until restart in seconds
// isCustom: true if manually triggered, false if automatic schedule

Puts($"Restart scheduled in {seconds} seconds (Custom: {isCustom})");
}

OnRestartCancelled
Called when a restart is cancelled

JSON:
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!");
}