diff --git a/src/ARKServerManager/App.xaml.cs b/src/ARKServerManager/App.xaml.cs index 6d90dfff..c1345361 100644 --- a/src/ARKServerManager/App.xaml.cs +++ b/src/ARKServerManager/App.xaml.cs @@ -49,7 +49,45 @@ namespace ServerManagerTool public App() { if (string.IsNullOrWhiteSpace(Config.Default.ASMUniqueKey)) + { Config.Default.ASMUniqueKey = Guid.NewGuid().ToString(); + } + + if (!string.IsNullOrWhiteSpace(Config.Default.DataDir)) + { + var root = Path.GetPathRoot(Config.Default.DataDir); + if (!root.EndsWith("\\")) + { + Config.Default.DataDir = Config.Default.DataDir.Replace(root, root + "\\"); + } + } + + if (!string.IsNullOrWhiteSpace(Config.Default.ConfigDirectory)) + { + var root = Path.GetPathRoot(Config.Default.ConfigDirectory); + if (!root.EndsWith("\\")) + { + Config.Default.ConfigDirectory = Config.Default.ConfigDirectory.Replace(root, root + "\\"); + } + } + + if (!string.IsNullOrWhiteSpace(Config.Default.BackupPath)) + { + var root = Path.GetPathRoot(Config.Default.BackupPath); + if (!root.EndsWith("\\")) + { + Config.Default.BackupPath = Config.Default.BackupPath.Replace(root, root + "\\"); + } + } + + if (!string.IsNullOrWhiteSpace(Config.Default.AutoUpdate_CacheDir)) + { + var root = Path.GetPathRoot(Config.Default.AutoUpdate_CacheDir); + if (!root.EndsWith("\\")) + { + Config.Default.AutoUpdate_CacheDir = Config.Default.AutoUpdate_CacheDir.Replace(root, root + "\\"); + } + } App.Instance = this; ApplicationStarted = false; diff --git a/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml.cs b/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml.cs index 9dd9dc78..15cef31c 100644 --- a/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml.cs +++ b/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml.cs @@ -148,14 +148,24 @@ namespace ServerManagerTool if (result == CommonFileDialogResult.Ok) { - if (!String.Equals(dialog.FileName, Config.Default.DataDir)) + if (!string.Equals(dialog.FileName, Config.Default.DataDir)) { try { + var newDataDirectory = dialog.FileName; + if (!string.IsNullOrWhiteSpace(newDataDirectory)) + { + var root = Path.GetPathRoot(newDataDirectory); + if (!root.EndsWith("\\")) + { + newDataDirectory = newDataDirectory.Replace(root, root + "\\"); + } + } + // Set up the destination directories - string newConfigDirectory = Path.Combine(dialog.FileName, Config.Default.ProfilesDir); + string newConfigDirectory = Path.Combine(newDataDirectory, Config.Default.ProfilesDir); string oldSteamDirectory = Path.Combine(Config.Default.DataDir, Config.Default.SteamCmdDir); - string newSteamDirectory = Path.Combine(dialog.FileName, Config.Default.SteamCmdDir); + string newSteamDirectory = Path.Combine(newDataDirectory, Config.Default.SteamCmdDir); Directory.CreateDirectory(newConfigDirectory); Directory.CreateDirectory(newSteamDirectory); @@ -189,7 +199,7 @@ namespace ServerManagerTool Directory.Delete(oldSteamDirectory, true); // Update the config - Config.Default.DataDir = dialog.FileName; + Config.Default.DataDir = newDataDirectory; Config.Default.ConfigDirectory = newConfigDirectory; App.ReconfigureLogging(); } @@ -228,9 +238,18 @@ namespace ServerManagerTool if (result == CommonFileDialogResult.Ok) { - if (!String.Equals(dialog.FileName, Config.Default.BackupPath)) + if (!string.Equals(dialog.FileName, Config.Default.BackupPath)) { Config.Default.BackupPath = dialog.FileName; + + if (!string.IsNullOrWhiteSpace(Config.Default.BackupPath)) + { + var root = Path.GetPathRoot(Config.Default.BackupPath); + if (!root.EndsWith("\\")) + { + Config.Default.BackupPath = Config.Default.BackupPath.Replace(root, root + "\\"); + } + } } } } @@ -250,9 +269,18 @@ namespace ServerManagerTool if (result == CommonFileDialogResult.Ok) { - if (!String.Equals(dialog.FileName, Config.Default.AutoUpdate_CacheDir)) + if (!string.Equals(dialog.FileName, Config.Default.AutoUpdate_CacheDir)) { Config.Default.AutoUpdate_CacheDir = dialog.FileName; + + if (!string.IsNullOrWhiteSpace(Config.Default.AutoUpdate_CacheDir)) + { + var root = Path.GetPathRoot(Config.Default.AutoUpdate_CacheDir); + if (!root.EndsWith("\\")) + { + Config.Default.AutoUpdate_CacheDir = Config.Default.AutoUpdate_CacheDir.Replace(root, root + "\\"); + } + } } } } diff --git a/src/ARKServerManager/VersionFeed.xml b/src/ARKServerManager/VersionFeed.xml index a129b533..27ae3896 100644 --- a/src/ARKServerManager/VersionFeed.xml +++ b/src/ARKServerManager/VersionFeed.xml @@ -9,8 +9,8 @@ urn:uuid:18276A38-2C71-4BB8-9A83-96D5EBFE9C87 - 1.1.412 (1.1.412.2) - 1.1.412.2 + 1.1.412 (1.1.412.3) + 1.1.412.3 2021-12-15T00:00:00Z @@ -20,7 +20,8 @@
CHANGE
diff --git a/src/ARKServerManager/VersionFeedBeta.xml b/src/ARKServerManager/VersionFeedBeta.xml index 9a228082..afa85e96 100644 --- a/src/ARKServerManager/VersionFeedBeta.xml +++ b/src/ARKServerManager/VersionFeedBeta.xml @@ -7,6 +7,29 @@ 2021-12-15T00:00:00Z + + urn:uuid:B7DE873D-4FC3-4A7B-A531-3146B4D8639A + 1.1.412 (1.1.412.3) + 1.1.412.3 + + 2021-12-15T00:00:00Z + +
+

+ BUGFIX +
+

    +
  • Added additional validation when setting directories in the global setting, to ensure they are rooted correctly.
  • +
+

+
+
+ + bletch + bletch1971@hotmail.com + +
+ urn:uuid:B2056A54-0063-43A9-8E8E-8AD411FFC377 1.1.412 (1.1.412.2) @@ -43,7 +66,7 @@
  • Fixed a bug with the Server Shutdown when the CheckForOnlinePlayers option not selected.
  • -
  • Fixed a bug when the backup path was a root directory that caused a 'Invalid URI: A Dos path must be rooted, for example' crash.
  • +
  • Fixed a bug when the backup path was a root directory that caused a 'Invalid URI: A Dos path must be rooted' crash.
CHANGE
diff --git a/src/ConanServerManager/App.xaml.cs b/src/ConanServerManager/App.xaml.cs index 800b5408..495ec5b6 100644 --- a/src/ConanServerManager/App.xaml.cs +++ b/src/ConanServerManager/App.xaml.cs @@ -48,7 +48,45 @@ namespace ServerManagerTool public App() { if (string.IsNullOrWhiteSpace(Config.Default.ServerManagerUniqueKey)) + { Config.Default.ServerManagerUniqueKey = Guid.NewGuid().ToString(); + } + + if (!string.IsNullOrWhiteSpace(Config.Default.DataPath)) + { + var root = Path.GetPathRoot(Config.Default.DataPath); + if (!root.EndsWith("\\")) + { + Config.Default.DataPath = Config.Default.DataPath.Replace(root, root + "\\"); + } + } + + if (!string.IsNullOrWhiteSpace(Config.Default.ConfigPath)) + { + var root = Path.GetPathRoot(Config.Default.ConfigPath); + if (!root.EndsWith("\\")) + { + Config.Default.ConfigPath = Config.Default.ConfigPath.Replace(root, root + "\\"); + } + } + + if (!string.IsNullOrWhiteSpace(Config.Default.BackupPath)) + { + var root = Path.GetPathRoot(Config.Default.BackupPath); + if (!root.EndsWith("\\")) + { + Config.Default.BackupPath = Config.Default.BackupPath.Replace(root, root + "\\"); + } + } + + if (!string.IsNullOrWhiteSpace(Config.Default.AutoUpdate_CacheDir)) + { + var root = Path.GetPathRoot(Config.Default.AutoUpdate_CacheDir); + if (!root.EndsWith("\\")) + { + Config.Default.AutoUpdate_CacheDir = Config.Default.AutoUpdate_CacheDir.Replace(root, root + "\\"); + } + } App.Instance = this; ApplicationStarted = false; diff --git a/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs b/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs index dd9587f4..19119725 100644 --- a/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs +++ b/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs @@ -158,14 +158,24 @@ namespace ServerManagerTool if (result == CommonFileDialogResult.Ok) { - if (!String.Equals(dialog.FileName, Config.Default.DataPath)) + if (!string.Equals(dialog.FileName, Config.Default.DataPath)) { try { + var newDataDirectory = dialog.FileName; + if (!string.IsNullOrWhiteSpace(newDataDirectory)) + { + var root = Path.GetPathRoot(newDataDirectory); + if (!root.EndsWith("\\")) + { + newDataDirectory = newDataDirectory.Replace(root, root + "\\"); + } + } + // Set up the destination directories - string newConfigDirectory = Path.Combine(dialog.FileName, Config.Default.ProfilesRelativePath); + string newConfigDirectory = Path.Combine(newDataDirectory, Config.Default.ProfilesRelativePath); string oldSteamDirectory = Path.Combine(Config.Default.DataPath, CommonConfig.Default.SteamCmdRelativePath); - string newSteamDirectory = Path.Combine(dialog.FileName, CommonConfig.Default.SteamCmdRelativePath); + string newSteamDirectory = Path.Combine(newDataDirectory, CommonConfig.Default.SteamCmdRelativePath); Directory.CreateDirectory(newConfigDirectory); Directory.CreateDirectory(newSteamDirectory); @@ -199,7 +209,7 @@ namespace ServerManagerTool Directory.Delete(oldSteamDirectory, true); // Update the config - Config.Default.DataPath = dialog.FileName; + Config.Default.DataPath = newDataDirectory; Config.Default.ConfigPath = newConfigDirectory; App.ReconfigureLogging(); } @@ -238,9 +248,18 @@ namespace ServerManagerTool if (result == CommonFileDialogResult.Ok) { - if (!String.Equals(dialog.FileName, Config.Default.BackupPath)) + if (!string.Equals(dialog.FileName, Config.Default.BackupPath)) { Config.Default.BackupPath = dialog.FileName; + + if (!string.IsNullOrWhiteSpace(Config.Default.BackupPath)) + { + var root = Path.GetPathRoot(Config.Default.BackupPath); + if (!root.EndsWith("\\")) + { + Config.Default.BackupPath = Config.Default.BackupPath.Replace(root, root + "\\"); + } + } } } } @@ -260,9 +279,18 @@ namespace ServerManagerTool if (result == CommonFileDialogResult.Ok) { - if (!String.Equals(dialog.FileName, Config.Default.AutoUpdate_CacheDir)) + if (!string.Equals(dialog.FileName, Config.Default.AutoUpdate_CacheDir)) { Config.Default.AutoUpdate_CacheDir = dialog.FileName; + + if (!string.IsNullOrWhiteSpace(Config.Default.AutoUpdate_CacheDir)) + { + var root = Path.GetPathRoot(Config.Default.AutoUpdate_CacheDir); + if (!root.EndsWith("\\")) + { + Config.Default.AutoUpdate_CacheDir = Config.Default.AutoUpdate_CacheDir.Replace(root, root + "\\"); + } + } } } } diff --git a/src/ConanServerManager/VersionFeed.xml b/src/ConanServerManager/VersionFeed.xml index 148a9292..748d1233 100644 --- a/src/ConanServerManager/VersionFeed.xml +++ b/src/ConanServerManager/VersionFeed.xml @@ -9,8 +9,8 @@ urn:uuid:6383E79A-C31F-462B-9730-B26B28DC5EFF - 1.1.57 (1.1.57.1) - 1.1.57.1 + 1.1.57 (1.1.57.2) + 1.1.57.2 2021-12-15T00:00:00Z @@ -20,7 +20,8 @@
  • Fixed a bug with the Server Shutdown when the CheckForOnlinePlayers option not selected.
  • -
  • Fixed a bug when the backup path was a root directory that caused a 'Invalid URI: A Dos path must be rooted, for example' crash.
  • +
  • Fixed a bug when the backup path was a root directory that caused a 'Invalid URI: A Dos path must be rooted' crash.
  • +
  • Added additional validation when setting directories in the global setting, to ensure they are rooted correctly.

diff --git a/src/ConanServerManager/VersionFeedBeta.xml b/src/ConanServerManager/VersionFeedBeta.xml index 3c2031b5..d99c381a 100644 --- a/src/ConanServerManager/VersionFeedBeta.xml +++ b/src/ConanServerManager/VersionFeedBeta.xml @@ -7,6 +7,29 @@ 2021-12-15T00:00:00Z + + urn:uuid:6383E79A-C31F-462B-9730-B26B28DC5EFF + 1.1.57 (1.1.57.2) + 1.1.57.2 + + 2021-12-15T00:00:00Z + +
+

+ BUGFIX +
+

    +
  • Added additional validation when setting directories in the global setting, to ensure they are rooted correctly.
  • +
+

+
+
+ + bletch + bletch1971@hotmail.com + +
+ urn:uuid:6383E79A-C31F-462B-9730-B26B28DC5EFF 1.1.57 (1.1.57.1) @@ -20,7 +43,7 @@
  • Fixed a bug with the Server Shutdown when the CheckForOnlinePlayers option not selected.
  • -
  • Fixed a bug when the backup path was a root directory that caused a 'Invalid URI: A Dos path must be rooted, for example' crash.
  • +
  • Fixed a bug when the backup path was a root directory that caused a 'Invalid URI: A Dos path must be rooted' crash.