From dbeaa7699d9f3bbc716b72477232abd4405ba8df Mon Sep 17 00:00:00 2001
From: Brett Hewitson
Date: Wed, 15 Dec 2021 14:55:32 +1000
Subject: [PATCH] Fixed a bug when starting the server manager and it tries to
download steamcmd, but fails as steamcmd is unavailable for download.
---
.../Globalization/en-US/en-US.xaml | 1 +
src/ARKServerManager/VersionFeed.xml | 5 ++--
src/ARKServerManager/VersionFeedBeta.xml | 23 ++++++++++++++++
.../Windows/AutoUpdateWindow.xaml | 1 +
.../Windows/AutoUpdateWindow.xaml.cs | 17 +++++++-----
.../Globalization/en-US/en-US.xaml | 1 +
src/ConanServerManager/VersionFeed.xml | 5 ++--
src/ConanServerManager/VersionFeedBeta.xml | 23 ++++++++++++++++
.../Windows/AutoUpdateWindow.xaml | 1 +
.../Windows/AutoUpdateWindow.xaml.cs | 17 +++++++-----
.../Lib/SteamCmdUpdater.cs | 27 +++++++++++--------
11 files changed, 94 insertions(+), 27 deletions(-)
diff --git a/src/ARKServerManager/Globalization/en-US/en-US.xaml b/src/ARKServerManager/Globalization/en-US/en-US.xaml
index a24cf64c..7e85edde 100644
--- a/src/ARKServerManager/Globalization/en-US/en-US.xaml
+++ b/src/ARKServerManager/Globalization/en-US/en-US.xaml
@@ -127,6 +127,7 @@
Server download complete
Complete
Cancelled
+ Failed
Cancel
diff --git a/src/ARKServerManager/VersionFeed.xml b/src/ARKServerManager/VersionFeed.xml
index 4e7f90e7..f3ae23f4 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.3)
- 1.1.412.3
+ 1.1.412 (1.1.412.4)
+ 1.1.412.4
2021-12-15T00:00:00Z
@@ -22,6 +22,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' crash.
Added additional validation when setting directories in the global setting, to ensure they are rooted correctly.
+ Fixed a bug when starting the server manager and it tries to download steamcmd, but fails as steamcmd is unavailable for download.
CHANGE
diff --git a/src/ARKServerManager/VersionFeedBeta.xml b/src/ARKServerManager/VersionFeedBeta.xml
index 3fe29502..b26292e9 100644
--- a/src/ARKServerManager/VersionFeedBeta.xml
+++ b/src/ARKServerManager/VersionFeedBeta.xml
@@ -7,6 +7,29 @@
2021-12-15T00:00:00Z
+
+ urn:uuid:202642C9-3B71-4B90-8A43-EFA1C5272C81
+ 1.1.412 (1.1.412.4)
+ 1.1.412.4
+
+ 2021-12-15T00:00:00Z
+
+
+
+ BUGFIX
+
+
+ - Fixed a bug when starting the server manager and it tries to download steamcmd, but fails as steamcmd is unavailable for download.
+
+
+
+
+
+ bletch
+ bletch1971@hotmail.com
+
+
+
urn:uuid:B7DE873D-4FC3-4A7B-A531-3146B4D8639A
1.1.412 (1.1.412.3)
diff --git a/src/ARKServerManager/Windows/AutoUpdateWindow.xaml b/src/ARKServerManager/Windows/AutoUpdateWindow.xaml
index 0df8f2ca..011a4957 100644
--- a/src/ARKServerManager/Windows/AutoUpdateWindow.xaml
+++ b/src/ARKServerManager/Windows/AutoUpdateWindow.xaml
@@ -17,6 +17,7 @@
+
diff --git a/src/ARKServerManager/Windows/AutoUpdateWindow.xaml.cs b/src/ARKServerManager/Windows/AutoUpdateWindow.xaml.cs
index 4f998b70..6036ae8c 100644
--- a/src/ARKServerManager/Windows/AutoUpdateWindow.xaml.cs
+++ b/src/ARKServerManager/Windows/AutoUpdateWindow.xaml.cs
@@ -2,6 +2,7 @@
using ServerManagerTool.Common.Utils;
using System;
using System.Threading;
+using System.Threading.Tasks;
using System.Windows;
using WPFSharp.Globalizer;
@@ -12,15 +13,16 @@ namespace ServerManagerTool
///
public partial class AutoUpdateWindow : Window
{
- private GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
-
- private SteamCmdUpdater updater = new SteamCmdUpdater();
+ private readonly GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
+ private readonly SteamCmdUpdater updater = new SteamCmdUpdater();
private CancellationTokenSource cancelSource;
public AutoUpdateWindow()
{
InitializeComponent();
WindowUtils.RemoveDefaultResourceDictionary(this, Config.Default.DefaultGlobalizationFile);
+
+ this.ErrorLabel.Visibility = Visibility.Collapsed;
}
private void Window_Loaded(object sender, RoutedEventArgs e)
@@ -32,10 +34,13 @@ namespace ServerManagerTool
this.StatusLabel.Content = message;
this.CompletionProgress.Value = u.CompletionPercent;
- if(u.FailureText != null)
+ if (u.FailureText != null)
{
- // TODO: Report error through UI
- throw new Exception(u.FailureText);
+ this.ErrorLabel.Text = u.FailureText;
+ this.ErrorLabel.Visibility = Visibility.Visible;
+ await Task.Delay(10000);
+
+ Environment.Exit(1);
}
if (u.CompletionPercent >= 100 || u.Cancelled)
diff --git a/src/ConanServerManager/Globalization/en-US/en-US.xaml b/src/ConanServerManager/Globalization/en-US/en-US.xaml
index 1a4dddf1..bbc06aad 100644
--- a/src/ConanServerManager/Globalization/en-US/en-US.xaml
+++ b/src/ConanServerManager/Globalization/en-US/en-US.xaml
@@ -120,6 +120,7 @@
Server download complete
Complete
Cancelled
+ Failed
Cancel
diff --git a/src/ConanServerManager/VersionFeed.xml b/src/ConanServerManager/VersionFeed.xml
index 748d1233..e2898f59 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.2)
- 1.1.57.2
+ 1.1.57 (1.1.57.3)
+ 1.1.57.3
2021-12-15T00:00:00Z
@@ -22,6 +22,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' crash.
Added additional validation when setting directories in the global setting, to ensure they are rooted correctly.
+ Fixed a bug when starting the server manager and it tries to download steamcmd, but fails as steamcmd is unavailable for download.
diff --git a/src/ConanServerManager/VersionFeedBeta.xml b/src/ConanServerManager/VersionFeedBeta.xml
index d99c381a..ddee13a2 100644
--- a/src/ConanServerManager/VersionFeedBeta.xml
+++ b/src/ConanServerManager/VersionFeedBeta.xml
@@ -7,6 +7,29 @@
2021-12-15T00:00:00Z
+
+ urn:uuid:28487F4A-4D0F-4344-A19E-EBD71D230180
+ 1.1.57 (1.1.57.3)
+ 1.1.57.3
+
+ 2021-12-15T00:00:00Z
+
+
+
+ BUGFIX
+
+
+ - Fixed a bug when starting the server manager and it tries to download steamcmd, but fails as steamcmd is unavailable for download.
+
+
+
+
+
+ bletch
+ bletch1971@hotmail.com
+
+
+
urn:uuid:6383E79A-C31F-462B-9730-B26B28DC5EFF
1.1.57 (1.1.57.2)
diff --git a/src/ConanServerManager/Windows/AutoUpdateWindow.xaml b/src/ConanServerManager/Windows/AutoUpdateWindow.xaml
index 61072172..f6347054 100644
--- a/src/ConanServerManager/Windows/AutoUpdateWindow.xaml
+++ b/src/ConanServerManager/Windows/AutoUpdateWindow.xaml
@@ -18,6 +18,7 @@
+
diff --git a/src/ConanServerManager/Windows/AutoUpdateWindow.xaml.cs b/src/ConanServerManager/Windows/AutoUpdateWindow.xaml.cs
index fa852ba1..4b729f62 100644
--- a/src/ConanServerManager/Windows/AutoUpdateWindow.xaml.cs
+++ b/src/ConanServerManager/Windows/AutoUpdateWindow.xaml.cs
@@ -2,6 +2,7 @@
using ServerManagerTool.Common.Utils;
using System;
using System.Threading;
+using System.Threading.Tasks;
using System.Windows;
using WPFSharp.Globalizer;
@@ -12,15 +13,16 @@ namespace ServerManagerTool
///
public partial class AutoUpdateWindow : Window
{
- private GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
-
- private SteamCmdUpdater updater = new SteamCmdUpdater();
+ private readonly GlobalizedApplication _globalizer = GlobalizedApplication.Instance;
+ private readonly SteamCmdUpdater updater = new SteamCmdUpdater();
private CancellationTokenSource cancelSource;
public AutoUpdateWindow()
{
InitializeComponent();
WindowUtils.RemoveDefaultResourceDictionary(this, Config.Default.DefaultGlobalizationFile);
+
+ this.ErrorLabel.Visibility = Visibility.Collapsed;
}
private void Window_Loaded(object sender, RoutedEventArgs e)
@@ -32,10 +34,13 @@ namespace ServerManagerTool
this.StatusLabel.Content = message;
this.CompletionProgress.Value = u.CompletionPercent;
- if(u.FailureText != null)
+ if (u.FailureText != null)
{
- // TODO: Report error through UI
- throw new Exception(u.FailureText);
+ this.ErrorLabel.Text = u.FailureText;
+ this.ErrorLabel.Visibility = Visibility.Visible;
+ await Task.Delay(10000);
+
+ Environment.Exit(1);
}
if (u.CompletionPercent >= 100 || u.Cancelled)
diff --git a/src/ServerManager.Common/Lib/SteamCmdUpdater.cs b/src/ServerManager.Common/Lib/SteamCmdUpdater.cs
index 47bd926c..4a8936aa 100644
--- a/src/ServerManager.Common/Lib/SteamCmdUpdater.cs
+++ b/src/ServerManager.Common/Lib/SteamCmdUpdater.cs
@@ -23,15 +23,10 @@ namespace ServerManagerTool.Common.Lib
this.StatusKey = statusKey;
this.CompletionPercent = completionPercent;
this.Cancelled = false;
+ this.Failure = null;
this.FailureText = null;
}
- public Update SetFailed(string failureText)
- {
- this.FailureText = failureText;
- return this;
- }
-
public static Update AsCompleted(string statusKey)
{
return new Update { StatusKey = statusKey, CompletionPercent = 100, Cancelled = false };
@@ -42,9 +37,17 @@ namespace ServerManagerTool.Common.Lib
return new Update { StatusKey = statusKey, CompletionPercent = 100, Cancelled = true };
}
+ public Update SetFailed(Exception ex)
+ {
+ this.Failure = ex;
+ this.FailureText = ex.Message;
+ return this;
+ }
+
public string StatusKey;
public float CompletionPercent;
public bool Cancelled;
+ public Exception Failure;
public string FailureText;
}
@@ -56,10 +59,11 @@ namespace ServerManagerTool.Common.Lib
RunningSteamCmd,
InstallSteamCmdComplete,
Complete,
- Cancelled
+ Cancelled,
+ Failed,
}
- Dictionary statuses = new Dictionary()
+ readonly Dictionary statuses = new Dictionary()
{
{ Status.CleaningSteamCmd, new Update("AutoUpdater_Status_CleaningSteamCmd", 0) },
{ Status.DownloadingSteamCmd, new Update("AutoUpdater_Status_DownloadingSteamCmd", 10) },
@@ -67,7 +71,8 @@ namespace ServerManagerTool.Common.Lib
{ Status.RunningSteamCmd, new Update("AutoUpdater_Status_RunningSteamCmd", 50) },
{ Status.InstallSteamCmdComplete, new Update("AutoUpdater_Status_InstallSteamCmdComplete", 80) },
{ Status.Complete, Update.AsCompleted("AutoUpdater_Status_Complete") },
- { Status.Cancelled, Update.AsCancelled("AutoUpdater_Status_Cancelled") }
+ { Status.Cancelled, Update.AsCancelled("AutoUpdater_Status_Cancelled") },
+ { Status.Failed, Update.AsCancelled("AutoUpdater_Status_Failed") },
};
public static string GetSteamCmdFile(string dataPath) => IOUtils.NormalizePath(Path.Combine(dataPath, CommonConfig.Default.SteamCmdRelativePath, CommonConfig.Default.SteamCmdExeFile));
@@ -99,7 +104,7 @@ namespace ServerManagerTool.Common.Lib
}
catch (Exception ex)
{
- reporter?.Report(statuses[Status.Complete].SetFailed(ex.ToString()));
+ reporter?.Report(statuses[Status.Failed].SetFailed(ex));
}
}
@@ -189,7 +194,7 @@ namespace ServerManagerTool.Common.Lib
}
catch(Exception ex)
{
- reporter?.Report(statuses[Status.Complete].SetFailed(ex.ToString()));
+ reporter?.Report(statuses[Status.Failed].SetFailed(ex));
}
}
}