diff --git a/TGS.Server/DeprecatedInstanceConfig.cs b/TGS.Server/DeprecatedInstanceConfig.cs index 3cac746331..33b3b1c8c9 100644 --- a/TGS.Server/DeprecatedInstanceConfig.cs +++ b/TGS.Server/DeprecatedInstanceConfig.cs @@ -19,7 +19,7 @@ namespace TGS.Server /// An based off the old .NET setting file public static IInstanceConfig CreateFromNETSettings() { - var Config = TGServerService.Properties.Settings.Default; + var Config = Properties.Settings.Default; var result = new DeprecatedInstanceConfig(Helpers.NormalizePath(LoadPreviousNetPropertyOrDefault("ServerDirectory", "C:\\tgstation-server-3"))); // using nameof for sanity where possible result.ProjectName = LoadPreviousNetPropertyOrDefault(nameof(ProjectName), result.ProjectName); @@ -53,7 +53,7 @@ namespace TGS.Server //try it the simple way first try { - var result = (T)TGServerService.Properties.Settings.Default.GetPreviousVersion(property); + var result = (T)Properties.Settings.Default.GetPreviousVersion(property); return result == null ? defaultValue : result; } catch @@ -65,7 +65,7 @@ namespace TGS.Server //Which means we can never fucking delete config settings //Which is fucking retarded //This hooks into the settings provider and forces it to load it anyway - var Config = TGServerService.Properties.Settings.Default; + var Config = Properties.Settings.Default; var Provider = Config.Properties[nameof(Config.SettingsVersion)].Provider; //nameof for sanity var sp = new SettingsProperty(property) diff --git a/TGS.Server/Properties/Settings.Designer.cs b/TGS.Server/Properties/Settings.Designer.cs index 1bbb0d95f0..49ea4aae51 100644 --- a/TGS.Server/Properties/Settings.Designer.cs +++ b/TGS.Server/Properties/Settings.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace TGServerService.Properties { +namespace TGS.Server.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] diff --git a/TGS.Server/Server.cs b/TGS.Server/Server.cs index 71278e7ec8..2f7351ce31 100644 --- a/TGS.Server/Server.cs +++ b/TGS.Server/Server.cs @@ -93,7 +93,7 @@ namespace TGS.Server /// The version to migrate from void MigrateSettings(int oldVersion) { - var Config = TGServerService.Properties.Settings.Default; + var Config = Properties.Settings.Default; switch (oldVersion) { case 6: //switch to per-instance configs @@ -113,7 +113,7 @@ namespace TGS.Server var pathsToRemove = new List(); lock (this) { - var IPS = TGServerService.Properties.Settings.Default.InstancePaths; + var IPS = Properties.Settings.Default.InstancePaths; foreach (var I in IPS) { IInstanceConfig ic; @@ -135,12 +135,12 @@ namespace TGS.Server } /// - /// Overrides and saves the configured if requested by command line parameters + /// Overrides and saves the configured if requested by command line parameters /// /// The command line parameters for the void ChangePortFromCommandLine(string[] args) { - var Config = TGServerService.Properties.Settings.Default; + var Config = Properties.Settings.Default; for (var I = 0; I < args.Length - 1; ++I) if (args[I].ToLower() == "-port") @@ -162,11 +162,11 @@ namespace TGS.Server } /// - /// Writes some changes to the that always need to be done. + /// Writes some changes to the that always need to be done. /// void PrePrepConfig() { - var Config = TGServerService.Properties.Settings.Default; + var Config = Properties.Settings.Default; if (Config.InstancePaths == null) Config.InstancePaths = new StringCollection(); @@ -177,7 +177,7 @@ namespace TGS.Server /// void SetupConfig() { - var Config = TGServerService.Properties.Settings.Default; + var Config = Properties.Settings.Default; if (Config.UpgradeRequired) { var newVersion = Config.SettingsVersion; @@ -219,21 +219,21 @@ namespace TGS.Server } /// - /// Creates a for using the default pipe, CloseTimeout for the , and the configured + /// Creates a for using the default pipe, CloseTimeout for the , and the configured /// /// The /// The URL to access components on the /// The created static ServiceHost CreateHost(object singleton, string endpointPostfix) { - return new ServiceHost(singleton, new Uri[] { new Uri(String.Format("net.pipe://localhost/{0}", endpointPostfix)), new Uri(String.Format("https://localhost:{0}/{1}", TGServerService.Properties.Settings.Default.RemoteAccessPort, endpointPostfix)) }) + return new ServiceHost(singleton, new Uri[] { new Uri(String.Format("net.pipe://localhost/{0}", endpointPostfix)), new Uri(String.Format("https://localhost:{0}/{1}", Properties.Settings.Default.RemoteAccessPort, endpointPostfix)) }) { CloseTimeout = new TimeSpan(0, 0, 5) }; } /// - /// Creates s for all s as listed in , detaches bad ones + /// Creates s for all s as listed in , detaches bad ones /// void SetupInstances() { @@ -253,7 +253,7 @@ namespace TGS.Server seenNames.Add(I.Name); } foreach (var I in pathsToRemove) - TGServerService.Properties.Settings.Default.InstancePaths.Remove(I); + Properties.Settings.Default.InstancePaths.Remove(I); } /// @@ -371,7 +371,7 @@ namespace TGS.Server } serviceHost.Close(); } - TGServerService.Properties.Settings.Default.Save(); + Properties.Settings.Default.Save(); } /// @@ -387,7 +387,7 @@ namespace TGS.Server /// public ushort RemoteAccessPort() { - return TGServerService.Properties.Settings.Default.RemoteAccessPort; + return Properties.Settings.Default.RemoteAccessPort; } /// @@ -395,7 +395,7 @@ namespace TGS.Server { if (port == 0) return "Cannot bind to port 0"; - TGServerService.Properties.Settings.Default.RemoteAccessPort = port; + Properties.Settings.Default.RemoteAccessPort = port; return null; } @@ -410,14 +410,14 @@ namespace TGS.Server { if (!Directory.Exists(path)) return false; - TGServerService.Properties.Settings.Default.PythonPath = Path.GetFullPath(path); + Properties.Settings.Default.PythonPath = Path.GetFullPath(path); return true; } /// public string PythonPath() { - return TGServerService.Properties.Settings.Default.PythonPath; + return Properties.Settings.Default.PythonPath; } /// @@ -445,7 +445,7 @@ namespace TGS.Server return res; if (File.Exists(path) || Directory.Exists(path)) return "Cannot create instance at pre-existing path!"; - var Config = TGServerService.Properties.Settings.Default; + var Config = Properties.Settings.Default; lock (this) { if (Config.InstancePaths.Contains(path)) @@ -462,7 +462,7 @@ namespace TGS.Server }; Directory.CreateDirectory(path); ic.Save(); - TGServerService.Properties.Settings.Default.InstancePaths.Add(path); + Properties.Settings.Default.InstancePaths.Add(path); } catch (Exception e) { @@ -488,7 +488,7 @@ namespace TGS.Server host.Open(); else lock (this) - TGServerService.Properties.Settings.Default.InstancePaths.Remove(config.Directory); + Properties.Settings.Default.InstancePaths.Remove(config.Directory); return null; } catch (Exception e) @@ -501,7 +501,7 @@ namespace TGS.Server public string ImportInstance(string path) { path = Helpers.NormalizePath(path); - var Config = TGServerService.Properties.Settings.Default; + var Config = Properties.Settings.Default; lock (this) { if (Config.InstancePaths.Contains(path)) @@ -516,7 +516,7 @@ namespace TGS.Server if(ic.Name == oic.Name) return String.Format("Instance named {0} already exists!", oic.Name); ic.Save(); - TGServerService.Properties.Settings.Default.InstancePaths.Add(path); + Properties.Settings.Default.InstancePaths.Add(path); } catch (Exception e) { @@ -652,7 +652,7 @@ namespace TGS.Server } if (path == null) return String.Format("No instance named {0} exists!", name); - TGServerService.Properties.Settings.Default.InstancePaths.Remove(path); + Properties.Settings.Default.InstancePaths.Remove(path); return null; } } diff --git a/TGS.Server/ServerInstance/Repository.cs b/TGS.Server/ServerInstance/Repository.cs index 70b7bd89a0..339a7c592c 100644 --- a/TGS.Server/ServerInstance/Repository.cs +++ b/TGS.Server/ServerInstance/Repository.cs @@ -1271,7 +1271,7 @@ namespace TGS.Server return null; } - var Config = TGServerService.Properties.Settings.Default; + var Config = Properties.Settings.Default; var PythonFile = Path.Combine(Config.PythonPath, "python.exe"); if (!File.Exists(PythonFile))