Adds a --no-restart command-line argument for Multiplay
This commit is contained in:
parent
c4b7ee551c
commit
91c41aa68b
2 changed files with 16 additions and 0 deletions
|
|
@ -1743,6 +1743,12 @@ namespace TShockAPI
|
||||||
|
|
||||||
private static void Restart(CommandArgs args)
|
private static void Restart(CommandArgs args)
|
||||||
{
|
{
|
||||||
|
if (TShock.NoRestart)
|
||||||
|
{
|
||||||
|
args.Player.SendErrorMessage("This command has been disabled.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ServerApi.RunningMono)
|
if (ServerApi.RunningMono)
|
||||||
{
|
{
|
||||||
TShock.Log.ConsoleInfo("Sorry, this command has not yet been implemented in Mono.");
|
TShock.Log.ConsoleInfo("Sorry, this command has not yet been implemented in Mono.");
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,11 @@ namespace TShockAPI
|
||||||
/// <summary>LogClear - Determines whether or not the log file should be cleared on initialization.</summary>
|
/// <summary>LogClear - Determines whether or not the log file should be cleared on initialization.</summary>
|
||||||
private static bool LogClear;
|
private static bool LogClear;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set by the command line, disables the '/restart' command.
|
||||||
|
/// </summary>
|
||||||
|
internal static bool NoRestart;
|
||||||
|
|
||||||
/// <summary>Players - Contains all TSPlayer objects for accessing TSPlayers currently on the server</summary>
|
/// <summary>Players - Contains all TSPlayer objects for accessing TSPlayers currently on the server</summary>
|
||||||
public static TSPlayer[] Players = new TSPlayer[Main.maxPlayers];
|
public static TSPlayer[] Players = new TSPlayer[Main.maxPlayers];
|
||||||
/// <summary>Bans - Static reference to the ban manager for accessing bans & related functions.</summary>
|
/// <summary>Bans - Static reference to the ban manager for accessing bans & related functions.</summary>
|
||||||
|
|
@ -690,6 +695,11 @@ namespace TShockAPI
|
||||||
TShock.StatTracker.OptOut = true;
|
TShock.StatTracker.OptOut = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case "--no-restart":
|
||||||
|
{
|
||||||
|
TShock.NoRestart = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue