diff --git a/TGS.CommandLine/Program.cs b/TGS.CommandLine/Program.cs index 59d41f71da..369652de33 100644 --- a/TGS.CommandLine/Program.cs +++ b/TGS.CommandLine/Program.cs @@ -9,7 +9,7 @@ namespace TGS.CommandLine class Program { static bool interactive = false, saidSrvVersion = false; - static IServerInterface currentInterface; + static IClient currentInterface; static Command.ExitCode RunCommandLine(IList argsAsList) { //first lookup the connection string @@ -52,7 +52,7 @@ namespace TGS.CommandLine } argsAsList.RemoveAt(I); argsAsList.RemoveAt(I); - ReplaceInterface(new ServerInterface(new RemoteLoginInfo(address, port, username, password))); + ReplaceInterface(new Client(new RemoteLoginInfo(address, port, username, password))); break; } } @@ -99,7 +99,7 @@ namespace TGS.CommandLine }; } - static void ReplaceInterface(IServerInterface I) + static void ReplaceInterface(IClient I) { currentInterface = I; ConsoleCommand.Server = I.Server; @@ -173,7 +173,7 @@ namespace TGS.CommandLine static int Main(string[] args) { - ReplaceInterface(new ServerInterface()); + ReplaceInterface(new Client()); Command.OutputProcVar.Value = Console.WriteLine; if (args.Length != 0) { @@ -191,13 +191,13 @@ namespace TGS.CommandLine { argsAsList.RemoveAt(I); --I; - ServerInterface.SetBadCertificateHandler(_ => false); + Client.SetBadCertificateHandler(_ => false); } } return (int)RunCommandLine(argsAsList); } //interactive mode - ServerInterface.SetBadCertificateHandler(BadCertificateInteractive); + Client.SetBadCertificateHandler(BadCertificateInteractive); Console.WriteLine("Type 'instance' to connect to a server instance"); Console.WriteLine("Type 'remote' to connect to a remote service"); while (true) @@ -228,17 +228,17 @@ namespace TGS.CommandLine var username = Console.ReadLine(); Console.Write("Enter password: "); var password = ReadLineSecure(); - ReplaceInterface(new ServerInterface(new RemoteLoginInfo(address, port, username, password))); + ReplaceInterface(new Client(new RemoteLoginInfo(address, port, username, password))); var res = currentInterface.ConnectionStatus(out string error); if (!res.HasFlag(ConnectivityLevel.Connected)) { Console.WriteLine("Unable to connect: " + error); - ReplaceInterface(new ServerInterface()); + ReplaceInterface(new Client()); } else if (!res.HasFlag(ConnectivityLevel.Authenticated)) { Console.WriteLine("Authentication error: Username/password/windows identity is not authorized! Returning to local mode..."); - ReplaceInterface(new ServerInterface()); + ReplaceInterface(new Client()); } else { @@ -253,7 +253,7 @@ namespace TGS.CommandLine break; case "disconnect": SentVMMWarning = false; - ReplaceInterface(new ServerInterface()); + ReplaceInterface(new Client()); Console.WriteLine("Switch to local mode"); break; case "quit": diff --git a/TGS.CommandLine/RootCommands.cs b/TGS.CommandLine/RootCommands.cs index 99188d4009..0de21674cd 100644 --- a/TGS.CommandLine/RootCommands.cs +++ b/TGS.CommandLine/RootCommands.cs @@ -6,7 +6,7 @@ namespace TGS.CommandLine { class CLICommand : RootCommand { - public CLICommand(IServerInterface I) + public CLICommand(IClient I) { var tmp = new List { new UpdateCommand(), new TestmergeCommand(), new RepoCommand(), new BYONDCommand(), new DMCommand(), new DDCommand(), new ConfigCommand(), new IRCCommand(), new DiscordCommand(), new AutoUpdateCommand(), new SetAutoUpdateCommand() }; if (ConsoleCommand.Instance.Administration != null) diff --git a/TGS.ControlPanel/Login.cs b/TGS.ControlPanel/Login.cs index f4c44e9523..070ed683d5 100644 --- a/TGS.ControlPanel/Login.cs +++ b/TGS.ControlPanel/Login.cs @@ -92,7 +92,7 @@ namespace TGS.ControlPanel loginInfo.Password = PasswordTextBox.Text; } - var I = new ServerInterface(loginInfo); + var I = new Client(loginInfo); var Config = Properties.Settings.Default; //This needs to be read here because V&C Closing us will corrupt the data var savePassword = SavePasswordCheckBox.Checked; @@ -114,15 +114,15 @@ namespace TGS.ControlPanel void LocalLoginButton_Click(object sender, EventArgs e) { Properties.Settings.Default.RemoteDefault = false; - VerifyAndConnect(new ServerInterface()); + VerifyAndConnect(new Client()); } /// - /// Attempts a connection on a given + /// Attempts a connection on a given /// - /// The to attempt a connection on + /// The to attempt a connection on /// if the connection was made and authenticated, otherwise - bool VerifyAndConnect(IServerInterface I) + bool VerifyAndConnect(IClient I) { try { diff --git a/TGS.ControlPanel/Program.cs b/TGS.ControlPanel/Program.cs index c0472c87c4..50768d847a 100644 --- a/TGS.ControlPanel/Program.cs +++ b/TGS.ControlPanel/Program.cs @@ -7,7 +7,7 @@ namespace TGS.ControlPanel { static class Program { - public static IServerInterface ServerInterface; + public static IClient ServerInterface; [STAThread] static void Main(string[] args) { @@ -21,7 +21,7 @@ namespace TGS.ControlPanel } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Interface.ServerInterface.SetBadCertificateHandler(BadCertificateHandler); + Interface.Client.SetBadCertificateHandler(BadCertificateHandler); Application.Run(new Login()); if(ServerInterface != null) { diff --git a/TGS.ControlPanel/ServerOpForm.cs b/TGS.ControlPanel/ServerOpForm.cs index 19c083b0a5..5188cd2b31 100644 --- a/TGS.ControlPanel/ServerOpForm.cs +++ b/TGS.ControlPanel/ServerOpForm.cs @@ -5,7 +5,7 @@ using System.Windows.Forms; namespace TGS.ControlPanel { /// - /// Used to provide an ATP function for calls into an + /// Used to provide an ATP function for calls into an /// #if !DEBUG abstract @@ -13,9 +13,9 @@ namespace TGS.ControlPanel class ServerOpForm : Form { /// - /// Used to wrap calls in a non-blocking fashion while disabling the and enabling the wait cursor + /// Used to wrap calls in a non-blocking fashion while disabling the and enabling the wait cursor /// - /// The operation to wrap + /// The operation to wrap /// A wrapping protected Task WrapServerOp(Action action) { diff --git a/TGS.Installer.UI/Main.cs b/TGS.Installer.UI/Main.cs index caea2cf03c..955283ed10 100644 --- a/TGS.Installer.UI/Main.cs +++ b/TGS.Installer.UI/Main.cs @@ -26,7 +26,7 @@ namespace TGS.Installer.UI /// bool attemptNetSettingsMigration = false; - IServerInterface Interface; + IClient Interface; /// /// Construct an installer form @@ -75,7 +75,7 @@ namespace TGS.Installer.UI } void CheckForExistingVersion() { - Interface = new ServerInterface(); + Interface = new Client(); var verifiedConnection = Interface.ConnectionStatus().HasFlag(ConnectivityLevel.Administrator); try { diff --git a/TGS.Interface.Bridge/DreamDaemonBridge.cs b/TGS.Interface.Bridge/DreamDaemonBridge.cs index ac609f4060..8465beb682 100644 --- a/TGS.Interface.Bridge/DreamDaemonBridge.cs +++ b/TGS.Interface.Bridge/DreamDaemonBridge.cs @@ -25,7 +25,7 @@ namespace TGS.Interface.Bridge parsedArgs.AddRange(args); var instance = parsedArgs[0]; parsedArgs.RemoveAt(0); - using (var I = new ServerInterface()) + using (var I = new Client()) I.Server.GetInstance(instance).Interop.InteropMessage(String.Join(" ", parsedArgs)); } catch { } diff --git a/TGS.Interface/ServerInterface.cs b/TGS.Interface/Client.cs similarity index 94% rename from TGS.Interface/ServerInterface.cs rename to TGS.Interface/Client.cs index f233b70b4e..b13b16364b 100644 --- a/TGS.Interface/ServerInterface.cs +++ b/TGS.Interface/Client.cs @@ -12,7 +12,7 @@ using TGS.Interface.Components; namespace TGS.Interface { /// - sealed public class ServerInterface : IServerInterface + sealed public class Client : IClient { /// public IServer Server => server; @@ -97,19 +97,19 @@ namespace TGS.Interface } /// - /// Construct an for a local connection + /// Construct an for a local connection /// - public ServerInterface() + public Client() { ChannelFactoryCache = new Dictionary(); server = new Server(this); } /// - /// Construct an for a remote connection + /// Construct an for a remote connection /// /// The for a remote connection - public ServerInterface(RemoteLoginInfo loginInfo) : this() + public Client(RemoteLoginInfo loginInfo) : this() { if (!loginInfo.HasPassword) throw new InvalidOperationException("password must be set on loginInfo!"); @@ -158,7 +158,7 @@ namespace TGS.Interface } /// - /// Returns the requested component for the instance . This does not guarantee a successful connection. s created this way are recycled for minimum latency and bandwidth usage + /// Returns the requested component for the instance . This does not guarantee a successful connection. s created this way are recycled for minimum latency and bandwidth usage /// /// The component to retrieve /// The name of the to use diff --git a/TGS.Interface/IServerInterface.cs b/TGS.Interface/IClient.cs similarity index 63% rename from TGS.Interface/IServerInterface.cs rename to TGS.Interface/IClient.cs index 9848bcb588..02394200fa 100644 --- a/TGS.Interface/IServerInterface.cs +++ b/TGS.Interface/IClient.cs @@ -5,28 +5,28 @@ namespace TGS.Interface /// /// Main for communicating the /// - public interface IServerInterface : IDisposable + public interface IClient : IDisposable { /// - /// The the connects to + /// The the connects to /// IServer Server { get; } /// - /// The for the . Is for local connections + /// The for the . Is for local connections /// RemoteLoginInfo LoginInfo { get; } /// - /// Checks if the is setup for a remote connection + /// Checks if the is setup for a remote connection /// bool IsRemoteConnection { get; } /// - /// Returns if the interface being used to connect to a service does not have the same release version as the service + /// Returns if the interface being used to connect to a service does not have the same release version as the service /// /// An error message to display to the user should this function return - /// if the interface being used to connect to a service does not have the same release version as the service + /// if the interface being used to connect to a service does not have the same release version as the service bool VersionMismatch(out string errorMessage); /// diff --git a/TGS.Interface/Instance.cs b/TGS.Interface/Instance.cs index a02a833685..31d2c31a44 100644 --- a/TGS.Interface/Instance.cs +++ b/TGS.Interface/Instance.cs @@ -45,9 +45,9 @@ namespace TGS.Interface } /// - /// The backing + /// The backing /// - readonly ServerInterface serverInterface; + readonly Client serverInterface; /// /// The name of the /// @@ -60,9 +60,9 @@ namespace TGS.Interface /// /// Construct an /// - /// The to use + /// The to use /// The for the - public Instance(ServerInterface _serverInterface, InstanceMetadata _metadata) + public Instance(Client _serverInterface, InstanceMetadata _metadata) { serverInterface = _serverInterface; metadata = _metadata; diff --git a/TGS.Interface/Server.cs b/TGS.Interface/Server.cs index 0e0050022b..d934528832 100644 --- a/TGS.Interface/Server.cs +++ b/TGS.Interface/Server.cs @@ -64,9 +64,9 @@ namespace TGS.Interface } /// - /// The backing + /// The backing /// - readonly ServerInterface serverInterface; + readonly Client serverInterface; /// /// Result of a call to @@ -81,8 +81,8 @@ namespace TGS.Interface /// /// Construct an /// - /// The to use - public Server(ServerInterface _serverInterface) + /// The to use + public Server(Client _serverInterface) { serverInterface = _serverInterface; } diff --git a/TGS.Interface/TGS.Interface.csproj b/TGS.Interface/TGS.Interface.csproj index 5ef6e8a5af..42cb6b71b0 100644 --- a/TGS.Interface/TGS.Interface.csproj +++ b/TGS.Interface/TGS.Interface.csproj @@ -69,13 +69,13 @@ - + - + diff --git a/TGS.Server/Instance/Compiler.cs b/TGS.Server/Instance/Compiler.cs index 87e933ea33..90ae74a4eb 100644 --- a/TGS.Server/Instance/Compiler.cs +++ b/TGS.Server/Instance/Compiler.cs @@ -119,7 +119,7 @@ namespace TGS.Server //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(IServerInterface)).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(IClient)).GetName().Name + ".dll")))) //its a good tell, jim return CompilerStatus.Initialized; return CompilerStatus.Uninitialized; } diff --git a/TGS.Server/Instance/DreamDaemon.cs b/TGS.Server/Instance/DreamDaemon.cs index 805c315d09..9f7d13774f 100644 --- a/TGS.Server/Instance/DreamDaemon.cs +++ b/TGS.Server/Instance/DreamDaemon.cs @@ -535,7 +535,7 @@ namespace TGS.Server return; //Copy the interface dll to the static dir - var InterfacePath = Assembly.GetAssembly(typeof(IServerInterface)).Location; + var InterfacePath = Assembly.GetAssembly(typeof(IClient)).Location; //bridge is installed next to the interface var BridgePath = Path.Combine(Path.GetDirectoryName(InterfacePath), BridgeDLLName); #if DEBUG diff --git a/TGS.Tests/CommandLine/Commands/Repository/RepositoryCommandTest.cs b/TGS.Tests/CommandLine/Commands/Repository/RepositoryCommandTest.cs index 937c1780c5..4735b8ccd5 100644 --- a/TGS.Tests/CommandLine/Commands/Repository/RepositoryCommandTest.cs +++ b/TGS.Tests/CommandLine/Commands/Repository/RepositoryCommandTest.cs @@ -8,10 +8,10 @@ namespace TGS.CommandLine.Commands.Repository.Tests public abstract class RepositoryCommandTest : OutputProcOverriderTest { /// - /// Creates a mock that returns a specific when that component is requested + /// Creates a mock that returns a specific when that component is requested /// - /// The the resulting should return - /// A mock + /// The the resulting should return + /// A mock protected IInstance MockInterfaceToRepo(ITGRepository repo) { var mock = new Mock(); diff --git a/TGS.Tests/ServiceInterface/TestInterface.cs b/TGS.Tests/ServiceInterface/TestInterface.cs index 5afeaadc6e..1b51fa2b50 100644 --- a/TGS.Tests/ServiceInterface/TestInterface.cs +++ b/TGS.Tests/ServiceInterface/TestInterface.cs @@ -27,7 +27,7 @@ namespace TGS.Interface.Tests Assert.IsFalse(String.IsNullOrWhiteSpace(message)); return true; }; - ServerInterface.SetBadCertificateHandler(func); + Client.SetBadCertificateHandler(func); } /// @@ -37,7 +37,7 @@ namespace TGS.Interface.Tests public void TestBadCertificateHandler() { var ran = false; - ServerInterface.SetBadCertificateHandler(_ => + Client.SetBadCertificateHandler(_ => { ran = true; return true; @@ -50,9 +50,9 @@ namespace TGS.Interface.Tests /// Creates a remote configured pointing at an invalid address /// /// The created - ServerInterface CreateFakeRemoteInterface() + Client CreateFakeRemoteInterface() { - return new ServerInterface(new RemoteLoginInfo("some.fake.url.420", 34752, "user", "password")); + return new Client(new RemoteLoginInfo("some.fake.url.420", 34752, "user", "password")); } /// @@ -61,7 +61,7 @@ namespace TGS.Interface.Tests [TestMethod] public void TestLocalInstantiation() { - Assert.IsFalse(new ServerInterface().IsRemoteConnection); + Assert.IsFalse(new Client().IsRemoteConnection); } /// @@ -77,7 +77,7 @@ namespace TGS.Interface.Tests public void TestCopyRemoteInterface() { var first = CreateFakeRemoteInterface(); - var second = new ServerInterface(first.LoginInfo); + var second = new Client(first.LoginInfo); Assert.AreEqual(first.LoginInfo.IP, second.LoginInfo.IP); Assert.AreEqual(first.LoginInfo.Port, second.LoginInfo.Port); Assert.AreEqual(first.LoginInfo.Username, second.LoginInfo.Username); @@ -88,7 +88,7 @@ namespace TGS.Interface.Tests [TestMethod] public void TestLocalAccessInterfaceAllowsWindowsImpersonation() { - var inter = new ServerInterface(); + var inter = new Client(); var po = new PrivateObject(inter); var cf = (ChannelFactory)po.Invoke("CreateChannel", new Type[] { typeof(string) }, new object[] { TestInstanceName }, new Type[] { typeof(ITGConfig) }); Assert.AreEqual(cf.Credentials.Windows.AllowedImpersonationLevel, System.Security.Principal.TokenImpersonationLevel.Impersonation);