mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-27 15:07:03 +01:00
Removes deprecated API calls
This commit is contained in:
@@ -10,7 +10,7 @@ namespace TGCommandLine
|
||||
public AdminCommand()
|
||||
{
|
||||
Keyword = "admin";
|
||||
Children = new Command[] { new AdminViewGroupCommand(), new AdminSetGroupCommand(), new AdminClearGroupCommand(), new AdminViewPortCommand(), new AdminSetPortCommand(), new AdminMoveServerCommand(), new AdminRecreateStaticCommand() };
|
||||
Children = new Command[] { new AdminViewGroupCommand(), new AdminSetGroupCommand(), new AdminClearGroupCommand(), new AdminRecreateStaticCommand() };
|
||||
}
|
||||
public override string GetHelpText()
|
||||
{
|
||||
@@ -18,31 +18,6 @@ namespace TGCommandLine
|
||||
}
|
||||
}
|
||||
|
||||
class AdminMoveServerCommand : Command
|
||||
{
|
||||
public AdminMoveServerCommand()
|
||||
{
|
||||
Keyword = "move-server";
|
||||
RequiredParameters = 1;
|
||||
}
|
||||
|
||||
protected override ExitCode Run(IList<string> parameters)
|
||||
{
|
||||
var res = Interface.GetComponent<ITGAdministration>().MoveServer(parameters[0]);
|
||||
OutputProc(res ?? "Success");
|
||||
return res == null ? ExitCode.Normal : ExitCode.ServerError;
|
||||
}
|
||||
|
||||
public override string GetArgumentString()
|
||||
{
|
||||
return "<new path>";
|
||||
}
|
||||
|
||||
public override string GetHelpText()
|
||||
{
|
||||
return "Move the server installation (BYOND, Repo, Game) to a new location. Nothing else may be running for this task to complete";
|
||||
}
|
||||
}
|
||||
class AdminRecreateStaticCommand : Command
|
||||
{
|
||||
public AdminRecreateStaticCommand()
|
||||
@@ -63,59 +38,6 @@ namespace TGCommandLine
|
||||
}
|
||||
}
|
||||
|
||||
class AdminSetPortCommand : Command
|
||||
{
|
||||
public AdminSetPortCommand()
|
||||
{
|
||||
Keyword = "set-port";
|
||||
RequiredParameters = 1;
|
||||
}
|
||||
public override string GetHelpText()
|
||||
{
|
||||
return "Set the port used for remote access. Requires a service restart to take effect";
|
||||
}
|
||||
|
||||
public override string GetArgumentString()
|
||||
{
|
||||
return "<port>";
|
||||
}
|
||||
|
||||
protected override ExitCode Run(IList<string> parameters)
|
||||
{
|
||||
ushort port;
|
||||
try
|
||||
{
|
||||
port = Convert.ToUInt16(parameters[0]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
OutputProc("Invalid port number!");
|
||||
return ExitCode.BadCommand;
|
||||
}
|
||||
var res = Interface.GetComponent<ITGAdministration>().SetRemoteAccessPort(port);
|
||||
OutputProc(res ?? "Success!");
|
||||
return ExitCode.Normal;
|
||||
}
|
||||
}
|
||||
|
||||
class AdminViewPortCommand : Command {
|
||||
public AdminViewPortCommand()
|
||||
{
|
||||
Keyword = "view-port";
|
||||
}
|
||||
public override string GetHelpText()
|
||||
{
|
||||
return "Print the port currently designated for remote access";
|
||||
}
|
||||
|
||||
protected override ExitCode Run(IList<string> parameters)
|
||||
{
|
||||
var port = Interface.GetComponent<ITGAdministration>().RemoteAccessPort();
|
||||
OutputProc(String.Format("{0}", port));
|
||||
return ExitCode.Normal;
|
||||
}
|
||||
}
|
||||
|
||||
class AdminViewGroupCommand : Command
|
||||
{
|
||||
public AdminViewGroupCommand()
|
||||
|
||||
Reference in New Issue
Block a user