From ca4cd31feaffced2b4a62e672bb5b5f78f381534 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Wed, 6 Sep 2017 16:10:11 -0400 Subject: [PATCH] Adds the webclient command to the command line --- TGCommandLine/DDCommands.cs | 41 ++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/TGCommandLine/DDCommands.cs b/TGCommandLine/DDCommands.cs index ef41ff1ffd..09f6bda7dc 100644 --- a/TGCommandLine/DDCommands.cs +++ b/TGCommandLine/DDCommands.cs @@ -9,7 +9,7 @@ namespace TGCommandLine public DDCommand() { Keyword = "dd"; - Children = new Command[] { new DDStartCommand(), new DDStopCommand(), new DDRestartCommand(), new DDStatusCommand(), new DDAutostartCommand(), new DDPortCommand(), new DDSecurityCommand(), new DDWorldAnnounceCommand() }; + Children = new Command[] { new DDStartCommand(), new DDStopCommand(), new DDRestartCommand(), new DDStatusCommand(), new DDAutostartCommand(), new DDPortCommand(), new DDSecurityCommand(), new DDWorldAnnounceCommand(), new DDWebclientCommand() }; } public override string GetHelpText() { @@ -191,6 +191,45 @@ namespace TGCommandLine return "Change or check autostarting of the game server with the service"; } } + class DDWebclientCommand : Command + { + public DDWebclientCommand() + { + Keyword = "webclient"; + RequiredParameters = 1; + } + + protected override ExitCode Run(IList parameters) + { + var DD = Server.GetComponent(); + switch (parameters[0].ToLower()) + { + case "on": + DD.SetWebclient(true); + break; + case "off": + DD.SetWebclient(false); + break; + case "check": + OutputProc("Webclient is: " + (DD.Webclient() ? "Enabled" : "Disabled")); + break; + default: + OutputProc("Invalid parameter: " + parameters[0]); + return ExitCode.BadCommand; + } + return ExitCode.Normal; + } + + public override string GetArgumentString() + { + return ""; + } + public override string GetHelpText() + { + return "Change or check if the BYOND webclient is enabled for the game server"; + } + } + class DDPortCommand : Command { public DDPortCommand()