mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-28 23:52:36 +01:00
Adds IInterface
This commit is contained in:
@@ -5,8 +5,8 @@ namespace TGCommandLine
|
||||
abstract class ConsoleCommand : Command
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="TGServiceInterface.Interface"/> currently in use by the <see cref="Program"/>
|
||||
/// The <see cref="IInterface"/> currently in use by the <see cref="Program"/>
|
||||
/// </summary>
|
||||
public static Interface Interface;
|
||||
public static IInterface Interface;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace TGCommandLine
|
||||
{
|
||||
abstract class InstanceRootCommand : RootCommand
|
||||
{
|
||||
public static Interface currentInterface;
|
||||
public static IInterface currentInterface;
|
||||
public override ExitCode DoRun(IList<string> parameters)
|
||||
{
|
||||
if (currentInterface.InstanceName == null)
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace TGCommandLine
|
||||
class Program
|
||||
{
|
||||
static bool interactive = false, saidSrvVersion = false;
|
||||
static Interface currentInterface;
|
||||
static IInterface currentInterface;
|
||||
static Command.ExitCode RunCommandLine(IList<string> argsAsList)
|
||||
{
|
||||
//first lookup the connection string
|
||||
@@ -100,7 +100,7 @@ namespace TGCommandLine
|
||||
};
|
||||
}
|
||||
|
||||
static void ReplaceInterface(Interface I)
|
||||
static void ReplaceInterface(IInterface I)
|
||||
{
|
||||
currentInterface = I;
|
||||
ConsoleCommand.Interface = I;
|
||||
@@ -157,7 +157,7 @@ namespace TGCommandLine
|
||||
/// </summary>
|
||||
/// <param name="instanceName">The name of the <see cref="ITGInstance"/> to test</param>
|
||||
/// <param name="silentSuccess">If <see langword="true"/>, does not output on success</param>
|
||||
/// <returns><see langword="true"/> if a <see cref="ConnectivityLevel.Authenticated"/> was achieved with <see cref="Interface.ConnectToInstance(string, bool)"/>, <see langword="false"/> otherwise</returns>
|
||||
/// <returns><see langword="true"/> if a <see cref="ConnectivityLevel.Authenticated"/> was achieved with <see cref="IInterface.ConnectToInstance(string, bool)"/>, <see langword="false"/> otherwise</returns>
|
||||
static bool CheckInstanceConnectivity(string instanceName, bool silentSuccess)
|
||||
{
|
||||
var res = currentInterface.ConnectToInstance(instanceName);
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace TGCommandLine
|
||||
{
|
||||
class CLICommand : RootCommand
|
||||
{
|
||||
public CLICommand(Interface I)
|
||||
public CLICommand(IInterface I)
|
||||
{
|
||||
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 (I.ConnectToInstance().HasFlag(ConnectivityLevel.Administrator))
|
||||
|
||||
Reference in New Issue
Block a user