Moves MoveServer() to ITGAdministration

This commit is contained in:
Cyberboss
2017-09-20 16:25:05 -04:00
parent 517e86febc
commit c6c820541d
7 changed files with 163 additions and 155 deletions
+26 -1
View File
@@ -9,14 +9,39 @@ namespace TGCommandLine
public AdminCommand()
{
Keyword = "admin";
Children = new Command[] { new AdminViewGroupCommand(), new AdminSetGroupCommand(), new AdminClearGroupCommand(), new AdminViewPortCommand(), new AdminSetPortCommand() };
Children = new Command[] { new AdminViewGroupCommand(), new AdminSetGroupCommand(), new AdminClearGroupCommand(), new AdminViewPortCommand(), new AdminSetPortCommand(), new AdminMoveServerCommand() };
}
public override string GetHelpText()
{
return "Manage server service authentication";
}
}
class AdminMoveServerCommand : Command
{
public AdminMoveServerCommand()
{
Keyword = "move-server";
RequiredParameters = 1;
}
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.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 AdminSetPortCommand : Command
{
+1 -27
View File
@@ -10,7 +10,7 @@ namespace TGCommandLine
public ConfigCommand()
{
Keyword = "config";
Children = new Command[] { new ConfigMoveServerCommand(), new ConfigServerDirectoryCommand(), new ConfigDownloadCommand(), new ConfigUploadCommand() };
Children = new Command[] { new ConfigServerDirectoryCommand(), new ConfigDownloadCommand(), new ConfigUploadCommand() };
}
public override string GetHelpText()
{
@@ -18,32 +18,6 @@ namespace TGCommandLine
}
}
class ConfigMoveServerCommand : Command
{
public ConfigMoveServerCommand()
{
Keyword = "move-server";
RequiredParameters = 1;
}
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGConfig>().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 ConfigServerDirectoryCommand : Command
{
public ConfigServerDirectoryCommand()