diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs
index 3f483269..9d454d21 100755
--- a/TShockAPI/Commands.cs
+++ b/TShockAPI/Commands.cs
@@ -1743,6 +1743,12 @@ namespace TShockAPI
private static void Restart(CommandArgs args)
{
+ if (TShock.NoRestart)
+ {
+ args.Player.SendErrorMessage("This command has been disabled.");
+ return;
+ }
+
if (ServerApi.RunningMono)
{
TShock.Log.ConsoleInfo("Sorry, this command has not yet been implemented in Mono.");
diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs
index 439403ee..870659bc 100755
--- a/TShockAPI/TShock.cs
+++ b/TShockAPI/TShock.cs
@@ -67,6 +67,11 @@ namespace TShockAPI
/// LogClear - Determines whether or not the log file should be cleared on initialization.
private static bool LogClear;
+ ///
+ /// Set by the command line, disables the '/restart' command.
+ ///
+ internal static bool NoRestart;
+
/// Players - Contains all TSPlayer objects for accessing TSPlayers currently on the server
public static TSPlayer[] Players = new TSPlayer[Main.maxPlayers];
/// Bans - Static reference to the ban manager for accessing bans & related functions.
@@ -690,6 +695,11 @@ namespace TShockAPI
TShock.StatTracker.OptOut = true;
break;
}
+ case "--no-restart":
+ {
+ TShock.NoRestart = true;
+ break;
+ }
}
}
}