mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-26 06:27:19 +01:00
Rename IInterface to IServerInterface
This commit is contained in:
@@ -5,8 +5,8 @@ namespace TGCommandLine
|
||||
abstract class ConsoleCommand : Command
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="IInterface"/> currently in use by the <see cref="Program"/>
|
||||
/// The <see cref="IServerInterface"/> currently in use by the <see cref="Program"/>
|
||||
/// </summary>
|
||||
public static IInterface Interface;
|
||||
public static IServerInterface Interface;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace TGCommandLine
|
||||
{
|
||||
abstract class InstanceRootCommand : RootCommand
|
||||
{
|
||||
public static IInterface currentInterface;
|
||||
public static IServerInterface 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 IInterface currentInterface;
|
||||
static IServerInterface currentInterface;
|
||||
static Command.ExitCode RunCommandLine(IList<string> argsAsList)
|
||||
{
|
||||
//first lookup the connection string
|
||||
@@ -100,7 +100,7 @@ namespace TGCommandLine
|
||||
};
|
||||
}
|
||||
|
||||
static void ReplaceInterface(IInterface I)
|
||||
static void ReplaceInterface(IServerInterface 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="IInterface.ConnectToInstance(string, bool)"/>, <see langword="false"/> otherwise</returns>
|
||||
/// <returns><see langword="true"/> if a <see cref="ConnectivityLevel.Authenticated"/> was achieved with <see cref="IServerInterface.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(IInterface I)
|
||||
public CLICommand(IServerInterface 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))
|
||||
|
||||
@@ -18,15 +18,15 @@ namespace TGControlPanel
|
||||
public static IDictionary<string, ControlPanel> InstancesInUse { get; private set; } = new Dictionary<string, ControlPanel>();
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IInterface"/> instance for this <see cref="ControlPanel"/>
|
||||
/// The <see cref="IServerInterface"/> instance for this <see cref="ControlPanel"/>
|
||||
/// </summary>
|
||||
readonly IInterface Interface;
|
||||
readonly IServerInterface Interface;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a <see cref="ControlPanel"/>
|
||||
/// </summary>
|
||||
/// <param name="I">The <see cref="IInterface"/> for the <see cref="ControlPanel"/></param>
|
||||
public ControlPanel(IInterface I)
|
||||
/// <param name="I">The <see cref="IServerInterface"/> for the <see cref="ControlPanel"/></param>
|
||||
public ControlPanel(IServerInterface I)
|
||||
{
|
||||
InitializeComponent();
|
||||
FormClosed += ControlPanel_FormClosed;
|
||||
|
||||
@@ -13,9 +13,9 @@ namespace TGControlPanel
|
||||
sealed partial class InstanceSelector : CountedForm
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="IInterface"/> we build instance connections from
|
||||
/// The <see cref="IServerInterface"/> we build instance connections from
|
||||
/// </summary>
|
||||
readonly IInterface masterInterface;
|
||||
readonly IServerInterface masterInterface;
|
||||
/// <summary>
|
||||
/// List of <see cref="InstanceMetadata"/> from <see cref="masterInterface"/>
|
||||
/// </summary>
|
||||
@@ -28,8 +28,8 @@ namespace TGControlPanel
|
||||
/// <summary>
|
||||
/// Construct an <see cref="InstanceSelector"/>
|
||||
/// </summary>
|
||||
/// <param name="I">An <see cref="IInterface"/> connected a the <see cref="ITGSService"/></param>
|
||||
public InstanceSelector(IInterface I)
|
||||
/// <param name="I">An <see cref="IServerInterface"/> connected a the <see cref="ITGSService"/></param>
|
||||
public InstanceSelector(IServerInterface I)
|
||||
{
|
||||
InitializeComponent();
|
||||
InstanceListBox.MouseDoubleClick += InstanceListBox_MouseDoubleClick;
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace TGControlPanel
|
||||
VerifyAndConnect(new Interface());
|
||||
}
|
||||
|
||||
void VerifyAndConnect(IInterface I)
|
||||
void VerifyAndConnect(IServerInterface I)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.Windows.Forms;
|
||||
namespace TGControlPanel
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to provide an ATP function for calls into an <see cref="TGServiceInterface.IInterface"/>
|
||||
/// Used to provide an ATP function for calls into an <see cref="TGServiceInterface.IServerInterface"/>
|
||||
/// </summary>
|
||||
#if !DEBUG
|
||||
abstract class ServerOpForm : Form
|
||||
@@ -14,9 +14,9 @@ namespace TGControlPanel
|
||||
#endif
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to wrap <see cref="TGServiceInterface.IInterface"/> calls in a non-blocking fashion while disabling the <see cref="Form"/> and enabling the wait cursor
|
||||
/// Used to wrap <see cref="TGServiceInterface.IServerInterface"/> calls in a non-blocking fashion while disabling the <see cref="Form"/> and enabling the wait cursor
|
||||
/// </summary>
|
||||
/// <param name="action">The <see cref="TGServiceInterface.IInterface"/> operation to wrap</param>
|
||||
/// <param name="action">The <see cref="TGServiceInterface.IServerInterface"/> operation to wrap</param>
|
||||
/// <returns>A <see cref="Task"/> wrapping <paramref name="action"/></returns>
|
||||
protected Task WrapServerOp(Action action)
|
||||
{
|
||||
|
||||
@@ -17,9 +17,9 @@ namespace TGControlPanel
|
||||
const string MergedPullsError = "Error retrieving currently merged pull requests: {0}";
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IInterface"/> connected to an <see cref="ITGInstance"/> to handle the pull requests for
|
||||
/// The <see cref="IServerInterface"/> connected to an <see cref="ITGInstance"/> to handle the pull requests for
|
||||
/// </summary>
|
||||
readonly IInterface currentInterface;
|
||||
readonly IServerInterface currentInterface;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="GitHubClient"/> to use to read PR lists
|
||||
@@ -38,9 +38,9 @@ namespace TGControlPanel
|
||||
/// <summary>
|
||||
/// Construct a <see cref="TestMergeManager"/>
|
||||
/// </summary>
|
||||
/// <param name="interfaceToUse">The <see cref="IInterface"/> to use for managing the <see cref="ITGInstance"/></param>
|
||||
/// <param name="interfaceToUse">The <see cref="IServerInterface"/> to use for managing the <see cref="ITGInstance"/></param>
|
||||
/// <param name="clientToUse">The <see cref="GitHubClient"/> to use for getting pull request information</param>
|
||||
public TestMergeManager(IInterface interfaceToUse, GitHubClient clientToUse)
|
||||
public TestMergeManager(IServerInterface interfaceToUse, GitHubClient clientToUse)
|
||||
{
|
||||
InitializeComponent();
|
||||
DialogResult = DialogResult.Cancel;
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace TGInstallerWrapper
|
||||
bool cancelled = false;
|
||||
bool pathIsDefault = true;
|
||||
|
||||
IInterface Interface;
|
||||
IServerInterface Interface;
|
||||
|
||||
/// <summary>
|
||||
/// Construct an installer form
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace TGServerService
|
||||
//what is says on the tin
|
||||
CompilerStatus IsInitialized()
|
||||
{
|
||||
if (File.Exists(RelativePath(Path.Combine(GameDirLive, BridgeDLLName))) || File.Exists(RelativePath(Path.Combine(GameDirLive, Assembly.GetAssembly(typeof(IInterface)).GetName().Name + ".dll")))) //its a good tell, jim
|
||||
if (File.Exists(RelativePath(Path.Combine(GameDirLive, BridgeDLLName))) || File.Exists(RelativePath(Path.Combine(GameDirLive, Assembly.GetAssembly(typeof(IServerInterface)).GetName().Name + ".dll")))) //its a good tell, jim
|
||||
return CompilerStatus.Initialized;
|
||||
return CompilerStatus.Uninitialized;
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ namespace TGServerService
|
||||
return;
|
||||
//Copy the interface dll to the static dir
|
||||
|
||||
var InterfacePath = Assembly.GetAssembly(typeof(IInterface)).Location;
|
||||
var InterfacePath = Assembly.GetAssembly(typeof(IServerInterface)).Location;
|
||||
//bridge is installed next to the interface
|
||||
var BridgePath = Path.Combine(Path.GetDirectoryName(InterfacePath), BridgeDLLName);
|
||||
#if DEBUG
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace TGServiceInterface
|
||||
/// <summary>
|
||||
/// Main <see langword="interface"/> for communicating the <see cref="ITGSService"/>
|
||||
/// </summary>
|
||||
public interface IInterface : IDisposable
|
||||
public interface IServerInterface : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the current instance in use. Defaults to <see langword="null"/>
|
||||
@@ -32,7 +32,7 @@ namespace TGServiceInterface
|
||||
ushort HTTPSPort { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the <see cref="IInterface"/> is setup for a remote connection
|
||||
/// Checks if the <see cref="IServerInterface"/> is setup for a remote connection
|
||||
/// </summary>
|
||||
bool IsRemoteConnection { get; }
|
||||
|
||||
@@ -45,14 +45,14 @@ namespace TGServiceInterface
|
||||
ConnectivityLevel ConnectToInstance(string instanceName = null, bool skipChecks = false);
|
||||
|
||||
/// <summary>
|
||||
/// Returns <see langword="true"/> if the <see cref="IInterface"/> interface being used to connect to a service does not have the same release version as the service
|
||||
/// Returns <see langword="true"/> if the <see cref="IServerInterface"/> interface being used to connect to a service does not have the same release version as the service
|
||||
/// </summary>
|
||||
/// <param name="errorMessage">An error message to display to the user should this function return <see langword="true"/></param>
|
||||
/// <returns><see langword="true"/> if the <see cref="IInterface"/> interface being used to connect to a service does not have the same release version as the service</returns>
|
||||
/// <returns><see langword="true"/> if the <see cref="IServerInterface"/> interface being used to connect to a service does not have the same release version as the service</returns>
|
||||
bool VersionMismatch(out string errorMessage);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the requested <see cref="IInterface"/> component <see langword="interface"/> for the instance <see cref="InstanceName"/>. This does not guarantee a successful connection.
|
||||
/// Returns the requested <see cref="IServerInterface"/> component <see langword="interface"/> for the instance <see cref="InstanceName"/>. This does not guarantee a successful connection.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The component <see langword="interface"/> to retrieve</typeparam>
|
||||
/// <returns>The correct component <see langword="interface"/></returns>
|
||||
@@ -79,7 +79,7 @@ namespace TGServiceInterface
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
sealed public class Interface : IInterface
|
||||
sealed public class Interface : IServerInterface
|
||||
{
|
||||
/// <summary>
|
||||
/// List of <see langword="interface"/>s that can be used with <see cref="GetServiceComponent{T}"/>
|
||||
|
||||
@@ -8,13 +8,13 @@ namespace TGCommandLine.Commands.Repository.Tests
|
||||
public abstract class RepositoryCommandTest : OutputProcOverriderTest
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a mock <see cref="IInterface"/> that returns a specific <see cref="ITGRepository"/> when that component is requested
|
||||
/// Creates a mock <see cref="IServerInterface"/> that returns a specific <see cref="ITGRepository"/> when that component is requested
|
||||
/// </summary>
|
||||
/// <param name="repo">The <see cref="ITGRepository"/> the resulting <see cref="IInterface.GetComponent{T}"/> should return</param>
|
||||
/// <returns>A mock <see cref="IInterface"/></returns>
|
||||
protected IInterface MockInterfaceToRepo(ITGRepository repo)
|
||||
/// <param name="repo">The <see cref="ITGRepository"/> the resulting <see cref="IServerInterface.GetComponent{T}"/> should return</param>
|
||||
/// <returns>A mock <see cref="IServerInterface"/></returns>
|
||||
protected IServerInterface MockInterfaceToRepo(ITGRepository repo)
|
||||
{
|
||||
var mock = new Mock<IInterface>();
|
||||
var mock = new Mock<IServerInterface>();
|
||||
mock.Setup(foo => foo.GetComponent<ITGRepository>()).Returns(repo);
|
||||
return mock.Object;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace TGControlPanel.Tests
|
||||
{
|
||||
var mockLanding = new Mock<ITGLanding>();
|
||||
mockLanding.Setup(x => x.ListInstances()).Returns(new List<InstanceMetadata>());
|
||||
var mockInter = new Mock<IInterface>();
|
||||
var mockInter = new Mock<IServerInterface>();
|
||||
mockInter.Setup(x => x.GetComponent<ITGLanding>()).Returns(mockLanding.Object);
|
||||
|
||||
new InstanceSelector(mockInter.Object).Dispose();
|
||||
|
||||
Reference in New Issue
Block a user