Server => Interface

This commit is contained in:
Cyberboss
2017-10-20 14:12:46 -04:00
parent 81adbb454a
commit 2fba289804
21 changed files with 456 additions and 456 deletions
+7 -7
View File
@@ -28,7 +28,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGAdministration>().MoveServer(parameters[0]);
var res = Interface.GetComponent<ITGAdministration>().MoveServer(parameters[0]);
OutputProc(res ?? "Success");
return res == null ? ExitCode.Normal : ExitCode.ServerError;
}
@@ -52,7 +52,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGAdministration>().RecreateStaticFolder();
var res = Interface.GetComponent<ITGAdministration>().RecreateStaticFolder();
OutputProc(res ?? "Success");
return res == null ? ExitCode.Normal : ExitCode.ServerError;
}
@@ -92,7 +92,7 @@ namespace TGCommandLine
OutputProc("Invalid port number!");
return ExitCode.BadCommand;
}
var res = Server.GetComponent<ITGAdministration>().SetRemoteAccessPort(port);
var res = Interface.GetComponent<ITGAdministration>().SetRemoteAccessPort(port);
OutputProc(res ?? "Success!");
return ExitCode.Normal;
}
@@ -110,7 +110,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var port = Server.GetComponent<ITGAdministration>().RemoteAccessPort();
var port = Interface.GetComponent<ITGAdministration>().RemoteAccessPort();
OutputProc(String.Format("{0}", port));
return ExitCode.Normal;
}
@@ -129,7 +129,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var group = Server.GetComponent<ITGAdministration>().GetCurrentAuthorizedGroup();
var group = Interface.GetComponent<ITGAdministration>().GetCurrentAuthorizedGroup();
OutputProc(group ?? "ERROR");
return group != null ? ExitCode.Normal : ExitCode.ServerError;
}
@@ -154,7 +154,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var result = Server.GetComponent<ITGAdministration>().SetAuthorizedGroup(parameters[0]);
var result = Interface.GetComponent<ITGAdministration>().SetAuthorizedGroup(parameters[0]);
if(result != null)
{
OutputProc("Group set to: " + result);
@@ -182,7 +182,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGAdministration>().SetAuthorizedGroup(null);
var res = Interface.GetComponent<ITGAdministration>().SetAuthorizedGroup(null);
if(res != "ADMIN")
{
OutputProc("Failed to clear the group??? We are currently set to: " + res);
+3 -3
View File
@@ -33,7 +33,7 @@ namespace TGCommandLine
type = ByondVersion.Staged;
else if (parameters[0].ToLower() == "--latest")
type = ByondVersion.Latest;
OutputProc(Server.GetComponent<ITGByond>().GetVersion(type) ?? "Unistalled");
OutputProc(Interface.GetComponent<ITGByond>().GetVersion(type) ?? "Unistalled");
return ExitCode.Normal;
}
public override string GetArgumentString()
@@ -56,7 +56,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
switch (Server.GetComponent<ITGByond>().CurrentStatus())
switch (Interface.GetComponent<ITGByond>().CurrentStatus())
{
case ByondStatus.Downloading:
OutputProc("Downloading update...");
@@ -109,7 +109,7 @@ namespace TGCommandLine
return ExitCode.BadCommand;
}
var BYOND = Server.GetComponent<ITGByond>();
var BYOND = Interface.GetComponent<ITGByond>();
if (!BYOND.UpdateToVersion(Major, Minor))
{
+17 -17
View File
@@ -48,7 +48,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var Chat = Server.GetComponent<ITGChat>();
var Chat = Interface.GetComponent<ITGChat>();
Chat.SetProviderInfo(new IRCSetupInfo(Chat.ProviderInfos()[(int)ChatProvider.IRC])
{
Nickname = parameters[0],
@@ -78,7 +78,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var IRC = Server.GetComponent<ITGChat>();
var IRC = Interface.GetComponent<ITGChat>();
var info = IRC.ProviderInfos()[providerIndex];
IList<string> channels;
@@ -156,7 +156,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var IRC = Server.GetComponent<ITGChat>();
var IRC = Interface.GetComponent<ITGChat>();
var info = IRC.ProviderInfos()[providerIndex];
IList<string> channels;
@@ -222,7 +222,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var info = Server.GetComponent<ITGChat>().ProviderInfos()[providerIndex];
var info = Interface.GetComponent<ITGChat>().ProviderInfos()[providerIndex];
string authType;
switch ((ChatProvider)providerIndex)
{
@@ -281,7 +281,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGChat>().Reconnect(providerIndex);
var res = Interface.GetComponent<ITGChat>().Reconnect(providerIndex);
if (res != null)
{
OutputProc("Error: " + res);
@@ -310,7 +310,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var IRC = Server.GetComponent<ITGChat>();
var IRC = Interface.GetComponent<ITGChat>();
var info = IRC.ProviderInfos()[providerIndex];
var newmin = parameters[0].ToLower();
@@ -355,7 +355,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var IRC = Server.GetComponent<ITGChat>();
var IRC = Interface.GetComponent<ITGChat>();
var info = IRC.ProviderInfos()[(int)ChatProvider.IRC];
var lowerparam = parameters[0].ToLower();
if (lowerparam == "channel-mode")
@@ -394,7 +394,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var IRC = Server.GetComponent<ITGChat>();
var IRC = Interface.GetComponent<ITGChat>();
var info = IRC.ProviderInfos()[(int)ChatProvider.Discord];
var lowerparam = parameters[0].ToLower();
if (lowerparam == "role-id")
@@ -433,7 +433,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var IRC = Server.GetComponent<ITGChat>();
var IRC = Interface.GetComponent<ITGChat>();
var info = new IRCSetupInfo(IRC.ProviderInfos()[(int)ChatProvider.IRC]);
switch (parameters[0])
{
@@ -482,7 +482,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var IRC = Server.GetComponent<ITGChat>();
var IRC = Interface.GetComponent<ITGChat>();
var info = IRC.ProviderInfos()[providerIndex];
var newmin = parameters[0].ToLower();
@@ -529,7 +529,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var IRC = Server.GetComponent<ITGChat>();
var IRC = Interface.GetComponent<ITGChat>();
IRC.SetProviderInfo(new IRCSetupInfo(IRC.ProviderInfos()[(int)ChatProvider.IRC])
{
AuthTarget = parameters[0],
@@ -551,7 +551,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var IRC = Server.GetComponent<ITGChat>();
var IRC = Interface.GetComponent<ITGChat>();
IRC.SetProviderInfo(new IRCSetupInfo(IRC.ProviderInfos()[(int)ChatProvider.IRC])
{
AuthTarget = null,
@@ -575,7 +575,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var IRC = Server.GetComponent<ITGChat>();
var IRC = Interface.GetComponent<ITGChat>();
var info = IRC.ProviderInfos()[providerIndex];
OutputProc("Currently configured channels:");
OutputProc("Admin:");
@@ -610,7 +610,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var Chat = Server.GetComponent<ITGChat>();
var Chat = Interface.GetComponent<ITGChat>();
var info = Chat.ProviderInfos()[providerIndex];
info.Enabled = true;
var res = Chat.SetProviderInfo(info);
@@ -638,7 +638,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var Chat = Server.GetComponent<ITGChat>();
var Chat = Interface.GetComponent<ITGChat>();
var info = Chat.ProviderInfos()[providerIndex];
info.Enabled = false;
var res = Chat.SetProviderInfo(info);
@@ -675,7 +675,7 @@ namespace TGCommandLine
OutputProc("Invalid parameter!");
return ExitCode.BadCommand;
}
var Chat = Server.GetComponent<ITGChat>();
var Chat = Interface.GetComponent<ITGChat>();
var PI = new IRCSetupInfo(Chat.ProviderInfos()[(int)ChatProvider.IRC])
{
URL = splits[0]
@@ -713,7 +713,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var Chat = Server.GetComponent<ITGChat>();
var Chat = Interface.GetComponent<ITGChat>();
var res = Chat.SetProviderInfo(new DiscordSetupInfo(Chat.ProviderInfos()[(int)ChatProvider.Discord]) { BotToken = parameters[0] });
OutputProc(res ?? "Success");
return res == null ? ExitCode.Normal : ExitCode.ServerError;
+5 -5
View File
@@ -28,7 +28,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGConfig>().DeleteFile(parameters[0], out bool unauthorized);
var res = Interface.GetComponent<ITGConfig>().DeleteFile(parameters[0], out bool unauthorized);
if (res != null)
{
OutputProc(res);
@@ -64,7 +64,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var list = Server.GetComponent<ITGConfig>().ListStaticDirectory(parameters.Count > 0 ? parameters[0] : null, out string error, out bool unauthorized);
var list = Interface.GetComponent<ITGConfig>().ListStaticDirectory(parameters.Count > 0 ? parameters[0] : null, out string error, out bool unauthorized);
if(list == null)
{
OutputProc(error);
@@ -88,7 +88,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
OutputProc(Server.GetComponent<ITGConfig>().ServerDirectory());
OutputProc(Interface.GetComponent<ITGConfig>().ServerDirectory());
return ExitCode.Normal;
}
@@ -108,7 +108,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var bytes = Server.GetComponent<ITGConfig>().ReadText(parameters[0], parameters.Count > 2 && parameters[2].ToLower() == "--repo", out string error, out bool unauthorized);
var bytes = Interface.GetComponent<ITGConfig>().ReadText(parameters[0], parameters.Count > 2 && parameters[2].ToLower() == "--repo", out string error, out bool unauthorized);
if(bytes == null)
{
OutputProc("Error: " + error);
@@ -148,7 +148,7 @@ namespace TGCommandLine
{
try
{
var res = Server.GetComponent<ITGConfig>().WriteText(parameters[0], File.ReadAllText(parameters[1]), out bool unauthorized);
var res = Interface.GetComponent<ITGConfig>().WriteText(parameters[0], File.ReadAllText(parameters[1]), out bool unauthorized);
if (res != null)
{
OutputProc("Error: " + res);
+9 -9
View File
@@ -38,7 +38,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGDreamDaemon>().WorldAnnounce(String.Join(" ", parameters));
var res = Interface.GetComponent<ITGDreamDaemon>().WorldAnnounce(String.Join(" ", parameters));
OutputProc(res ?? "Success!");
return res == null ? ExitCode.Normal : ExitCode.ServerError;
}
@@ -58,7 +58,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGDreamDaemon>().Start();
var res = Interface.GetComponent<ITGDreamDaemon>().Start();
OutputProc(res ?? "Success!");
return res == null ? ExitCode.Normal : ExitCode.ServerError;
}
@@ -82,7 +82,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var DD = Server.GetComponent<ITGDreamDaemon>();
var DD = Interface.GetComponent<ITGDreamDaemon>();
if (parameters.Count > 0 && parameters[0].ToLower() == "--graceful")
{
if (DD.DaemonStatus() != DreamDaemonStatus.Online)
@@ -111,7 +111,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var DD = Server.GetComponent<ITGDreamDaemon>();
var DD = Interface.GetComponent<ITGDreamDaemon>();
if (parameters.Count > 0 && parameters[0].ToLower() == "--graceful")
{
if (DD.DaemonStatus() != DreamDaemonStatus.Online)
@@ -146,7 +146,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var DD = Server.GetComponent<ITGDreamDaemon>();
var DD = Interface.GetComponent<ITGDreamDaemon>();
OutputProc(DD.StatusString(true));
if (DD.ShutdownInProgress())
OutputProc("The server will shutdown once the current round completes.");
@@ -167,7 +167,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var DD = Server.GetComponent<ITGDreamDaemon>();
var DD = Interface.GetComponent<ITGDreamDaemon>();
switch (parameters[0].ToLower())
{
case "on":
@@ -205,7 +205,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var DD = Server.GetComponent<ITGDreamDaemon>();
var DD = Interface.GetComponent<ITGDreamDaemon>();
switch (parameters[0].ToLower())
{
case "on":
@@ -255,7 +255,7 @@ namespace TGCommandLine
return ExitCode.BadCommand;
}
Server.GetComponent<ITGDreamDaemon>().SetPort(port);
Interface.GetComponent<ITGDreamDaemon>().SetPort(port);
return ExitCode.Normal;
}
@@ -298,7 +298,7 @@ namespace TGCommandLine
OutputProc("Invalid security word!");
return ExitCode.BadCommand;
}
Server.GetComponent<ITGDreamDaemon>().SetSecurityLevel(sec);
Interface.GetComponent<ITGDreamDaemon>().SetSecurityLevel(sec);
return ExitCode.Normal;
}
+7 -7
View File
@@ -28,7 +28,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var DM = Server.GetComponent<ITGCompiler>();
var DM = Interface.GetComponent<ITGCompiler>();
var stat = DM.GetStatus();
if (stat != CompilerStatus.Initialized)
{
@@ -36,7 +36,7 @@ namespace TGCommandLine
return ExitCode.ServerError;
}
if (Server.GetComponent<ITGByond>().GetVersion(ByondVersion.Installed) == null)
if (Interface.GetComponent<ITGByond>().GetVersion(ByondVersion.Installed) == null)
{
Console.Write("Error: BYOND is not installed!");
return ExitCode.ServerError;
@@ -84,14 +84,14 @@ namespace TGCommandLine
void ShowError()
{
var error = Server.GetComponent<ITGCompiler>().CompileError();
var error = Interface.GetComponent<ITGCompiler>().CompileError();
if (error != null)
OutputProc("Last error: " + error);
}
protected override ExitCode Run(IList<string> parameters)
{
var DM = Server.GetComponent<ITGCompiler>();
var DM = Interface.GetComponent<ITGCompiler>();
OutputProc(String.Format("Target Project: /{0}.dme", DM.ProjectName()));
Console.Write("Compilier is currently: ");
switch (DM.GetStatus())
@@ -142,7 +142,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
Server.GetComponent<ITGCompiler>().SetProjectName(parameters[0]);
Interface.GetComponent<ITGCompiler>().SetProjectName(parameters[0]);
return ExitCode.Normal;
}
}
@@ -166,7 +166,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var DM = Server.GetComponent<ITGCompiler>();
var DM = Interface.GetComponent<ITGCompiler>();
var stat = DM.GetStatus();
if (stat == CompilerStatus.Compiling || stat == CompilerStatus.Initializing)
{
@@ -206,7 +206,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGCompiler>().Cancel();
var res = Interface.GetComponent<ITGCompiler>().Cancel();
OutputProc(res ?? "Success!");
return ExitCode.Normal; //because failing cancellation implys it's already cancelled
}
+14 -14
View File
@@ -51,7 +51,7 @@ namespace TGCommandLine
}
argsAsList.RemoveAt(I);
argsAsList.RemoveAt(I);
Server.SetRemoteLoginInformation(address, port, username, password);
Interface.SetRemoteLoginInformation(address, port, username, password);
break;
}
}
@@ -62,7 +62,7 @@ namespace TGCommandLine
return Command.ExitCode.BadCommand;
}
var res = Server.VerifyConnection();
var res = Interface.VerifyConnection();
if (res != null)
{
Console.WriteLine("Unable to connect to service: " + res);
@@ -70,13 +70,13 @@ namespace TGCommandLine
return Command.ExitCode.ConnectionError;
}
if (!Server.Authenticate())
if (!Interface.Authenticate())
{
Console.WriteLine("Authentication error: Username/password/windows identity is not authorized!");
return Command.ExitCode.ConnectionError;
}
if (!SentVMMWarning && Server.VersionMismatch(out string error))
if (!SentVMMWarning && Interface.VersionMismatch(out string error))
{
SentVMMWarning = true;
Console.WriteLine(error);
@@ -141,7 +141,7 @@ namespace TGCommandLine
Command.OutputProcVar.Value = Console.WriteLine;
if (args.Length != 0)
{
Server.SetBadCertificateHandler((message) => {
Interface.SetBadCertificateHandler((message) => {
foreach (var I in args)
if (I.ToLower() == "--disable-ssl-verification") //im just not even going to document this because i hate it so much
return true;
@@ -151,7 +151,7 @@ namespace TGCommandLine
return (int)RunCommandLine(new List<string>(args));
}
Server.SetBadCertificateHandler(BadCertificateInteractive);
Interface.SetBadCertificateHandler(BadCertificateInteractive);
Console.WriteLine("Type 'remote' to connect to a remote service");
//interactive mode
@@ -179,22 +179,22 @@ namespace TGCommandLine
var username = Console.ReadLine();
Console.Write("Enter password: ");
var password = ReadLineSecure();
Server.SetRemoteLoginInformation(address, port, username, password);
var res = Server.VerifyConnection();
Interface.SetRemoteLoginInformation(address, port, username, password);
var res = Interface.VerifyConnection();
if (res != null)
{
Console.WriteLine("Unable to connect: " + res);
Server.MakeLocalConnection();
Interface.MakeLocalConnection();
}
else if (!Server.Authenticate())
else if (!Interface.Authenticate())
{
Console.WriteLine("Authentication error: Username/password/windows identity is not authorized! Returning to local mode...");
Server.MakeLocalConnection();
Interface.MakeLocalConnection();
}
else
{
Console.WriteLine("Connected remotely");
if (Server.VersionMismatch(out res))
if (Interface.VersionMismatch(out res))
{
SentVMMWarning = true;
Console.WriteLine(res);
@@ -204,7 +204,7 @@ namespace TGCommandLine
break;
case "disconnect":
SentVMMWarning = false;
Server.MakeLocalConnection();
Interface.MakeLocalConnection();
Console.WriteLine("Switch to local mode");
break;
case "quit":
@@ -212,7 +212,7 @@ namespace TGCommandLine
return (int)Command.ExitCode.Normal;
#if DEBUG
case "debug-upgrade":
Server.GetComponent<ITGSService>().PrepareForUpdate();
Interface.GetComponent<ITGSService>().PrepareForUpdate();
return (int)Command.ExitCode.Normal;
#endif
default:
+14 -14
View File
@@ -32,7 +32,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGRepository>().UpdateTGS3Json();
var res = Interface.GetComponent<ITGRepository>().UpdateTGS3Json();
if (res != null)
{
OutputProc(res);
@@ -51,7 +51,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGRepository>().Setup(parameters[0], parameters.Count > 1 ? parameters[1] : "master");
var res = Interface.GetComponent<ITGRepository>().Setup(parameters[0], parameters.Count > 1 ? parameters[1] : "master");
if (res != null)
{
OutputProc("Error: " + res);
@@ -78,7 +78,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var Repo = Server.GetComponent<ITGRepository>();
var Repo = Interface.GetComponent<ITGRepository>();
var busy = Repo.OperationInProgress();
if (!busy)
{
@@ -131,7 +131,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var result = Server.GetComponent<ITGRepository>().Reset(parameters.Count > 0 && parameters[0].ToLower() == "--origin");
var result = Interface.GetComponent<ITGRepository>().Reset(parameters.Count > 0 && parameters[0].ToLower() == "--origin");
OutputProc(result ?? "Success!");
return result == null ? ExitCode.Normal : ExitCode.ServerError;
}
@@ -167,7 +167,7 @@ namespace TGCommandLine
OutputProc("Invalid parameter: " + parameters[0]);
return ExitCode.BadCommand;
}
var res = Server.GetComponent<ITGRepository>().Update(hard);
var res = Interface.GetComponent<ITGRepository>().Update(hard);
OutputProc(res ?? "Success");
return res == null ? ExitCode.Normal : ExitCode.ServerError;
}
@@ -188,7 +188,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var result = Server.GetComponent<ITGRepository>().GenerateChangelog(out string error);
var result = Interface.GetComponent<ITGRepository>().GenerateChangelog(out string error);
OutputProc(error ?? "Success!");
if (result != null)
OutputProc(result);
@@ -208,7 +208,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var result = Server.GetComponent<ITGRepository>().SynchronizePush();
var result = Interface.GetComponent<ITGRepository>().SynchronizePush();
if(result != null)
OutputProc(result);
return result == null ? ExitCode.Normal : ExitCode.ServerError;
@@ -228,7 +228,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
Server.GetComponent<ITGRepository>().SetCommitterEmail(parameters[0]);
Interface.GetComponent<ITGRepository>().SetCommitterEmail(parameters[0]);
return ExitCode.Normal;
}
@@ -250,7 +250,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
Server.GetComponent<ITGRepository>().SetCommitterName(parameters[0]);
Interface.GetComponent<ITGRepository>().SetCommitterName(parameters[0]);
return ExitCode.Normal;
}
public override string GetArgumentString()
@@ -271,7 +271,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
Server.GetComponent<ITGRepository>().SetPythonPath(parameters[0]);
Interface.GetComponent<ITGRepository>().SetPythonPath(parameters[0]);
return ExitCode.Normal;
}
public override string GetArgumentString()
@@ -304,7 +304,7 @@ namespace TGCommandLine
OutputProc("Invalid PR Number!");
return ExitCode.BadCommand;
}
var res = Server.GetComponent<ITGRepository>().MergePullRequest(PR);
var res = Interface.GetComponent<ITGRepository>().MergePullRequest(PR);
OutputProc(res ?? "Success");
return res == null ? ExitCode.Normal : ExitCode.ServerError;
}
@@ -331,7 +331,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var data = Server.GetComponent<ITGRepository>().MergedPullRequests(out string error);
var data = Interface.GetComponent<ITGRepository>().MergedPullRequests(out string error);
if (data == null)
{
OutputProc(error);
@@ -358,7 +358,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var data = Server.GetComponent<ITGRepository>().ListBackups(out string error);
var data = Interface.GetComponent<ITGRepository>().ListBackups(out string error);
if (data == null)
{
OutputProc(error);
@@ -385,7 +385,7 @@ namespace TGCommandLine
}
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGRepository>().Checkout(parameters[0]);
var res = Interface.GetComponent<ITGRepository>().Checkout(parameters[0]);
OutputProc(res ?? "Success");
return res == null ? ExitCode.Normal : ExitCode.ServerError;
}
+7 -7
View File
@@ -10,7 +10,7 @@ namespace TGCommandLine
public CLICommand()
{
var tmp = new List<Command> { new UpdateCommand(), new TestmergeCommand(), new RepoCommand(), new BYONDCommand(), new DMCommand(), new DDCommand(), new ConfigCommand(), new IRCCommand(), new DiscordCommand(), new AutoUpdateCommand(), new SetAutoUpdateCommand() };
if (Server.VerifyConnection() == null && Server.Authenticate() && Server.AuthenticateAdmin())
if (Interface.VerifyConnection() == null && Interface.Authenticate() && Interface.AuthenticateAdmin())
tmp.Add(new AdminCommand());
Children = tmp.ToArray();
}
@@ -35,7 +35,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var res = Server.GetComponent<ITGRepository>().AutoUpdateInterval();
var res = Interface.GetComponent<ITGRepository>().AutoUpdateInterval();
OutputProc(res == 0 ? "OFF" : String.Format("Auto updating every {0} minutes", res));
return ExitCode.Normal;
}
@@ -74,7 +74,7 @@ namespace TGCommandLine
return ExitCode.BadCommand;
}
Server.GetComponent<ITGRepository>().SetAutoUpdateInterval(NewInterval);
Interface.GetComponent<ITGRepository>().SetAutoUpdateInterval(NewInterval);
return ExitCode.Normal;
}
@@ -89,7 +89,7 @@ namespace TGCommandLine
protected override ExitCode Run(IList<string> parameters)
{
var gen_cl = parameters.Count > 1 && parameters[1].ToLower() == "--cl";
var Repo = Server.GetComponent<ITGRepository>();
var Repo = Interface.GetComponent<ITGRepository>();
switch (parameters[0].ToLower())
{
case "hard":
@@ -124,7 +124,7 @@ namespace TGCommandLine
OutputProc(res);
}
}
var resu = Server.GetComponent<ITGCompiler>().Compile(true);
var resu = Interface.GetComponent<ITGCompiler>().Compile(true);
OutputProc(resu ? "Compilation started!" : "Compilation could not be started!");
return resu ? ExitCode.Normal : ExitCode.ServerError;
}
@@ -161,7 +161,7 @@ namespace TGCommandLine
OutputProc("Invalid tesmerge #: " + parameters[0]);
return ExitCode.BadCommand;
}
var Repo = Server.GetComponent<ITGRepository>();
var Repo = Interface.GetComponent<ITGRepository>();
var res = Repo.MergePullRequest(tm);
if (res != null)
{
@@ -174,7 +174,7 @@ namespace TGCommandLine
OutputProc(res);
return ExitCode.ServerError;
}
var resu = Server.GetComponent<ITGCompiler>().Compile(true);
var resu = Interface.GetComponent<ITGCompiler>().Compile(true);
OutputProc(resu ? "Compilation started!" : "Compilation could not be started!");
return resu ? ExitCode.Normal : ExitCode.ServerError;
}