Adds a function to recreate static directories

This commit is contained in:
Cyberboss
2017-09-27 14:14:23 -04:00
parent 2d8fab96ad
commit 848221fc0a
8 changed files with 148 additions and 21 deletions
+21 -2
View File
@@ -9,14 +9,14 @@ namespace TGCommandLine
public AdminCommand()
{
Keyword = "admin";
Children = new Command[] { new AdminViewGroupCommand(), new AdminSetGroupCommand(), new AdminClearGroupCommand(), new AdminViewPortCommand(), new AdminSetPortCommand(), new AdminMoveServerCommand() };
Children = new Command[] { new AdminViewGroupCommand(), new AdminSetGroupCommand(), new AdminClearGroupCommand(), new AdminViewPortCommand(), new AdminSetPortCommand(), new AdminMoveServerCommand(), new AdminRecreateStaticCommand() };
}
public override string GetHelpText()
{
return "Manage server service authentication";
}
}
class AdminMoveServerCommand : Command
{
public AdminMoveServerCommand()
@@ -42,6 +42,25 @@ namespace TGCommandLine
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()
{
Keyword = "recreate-static-directory";
}
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGAdministration>().RecreateStaticFolder();
OutputProc(res ?? "Success");
return res == null ? ExitCode.Normal : ExitCode.ServerError;
}
public override string GetHelpText()
{
return "Backup the current static directory and repopulate it from the TGS3.json in the repository";
}
}
class AdminSetPortCommand : Command
{