Fixed a bug when starting the server manager and it tries to download steamcmd, but fails as steamcmd is unavailable for download.

This commit is contained in:
Brett Hewitson 2021-12-15 14:55:32 +10:00
parent 8ed965307a
commit dbeaa7699d
11 changed files with 94 additions and 27 deletions

View file

@ -127,6 +127,7 @@
<sys:String x:Key="AutoUpdater_Status_DownloadNewServerComplete">Server download complete</sys:String>
<sys:String x:Key="AutoUpdater_Status_Complete">Complete</sys:String>
<sys:String x:Key="AutoUpdater_Status_Cancelled">Cancelled</sys:String>
<sys:String x:Key="AutoUpdater_Status_Failed">Failed</sys:String>
<sys:String x:Key="AutoUpdater_CancelButtonLabel">Cancel</sys:String>
<!--#endregion-->

View file

@ -9,8 +9,8 @@
<entry>
<id>urn:uuid:18276A38-2C71-4BB8-9A83-96D5EBFE9C87</id>
<title>1.1.412 (1.1.412.3)</title>
<summary>1.1.412.3</summary>
<title>1.1.412 (1.1.412.4)</title>
<summary>1.1.412.4</summary>
<link href="" />
<updated>2021-12-15T00:00:00Z</updated>
<content type="xhtml">
@ -22,6 +22,7 @@
<li>Fixed a bug with the Server Shutdown when the CheckForOnlinePlayers option not selected.</li>
<li>Fixed a bug when the backup path was a root directory that caused a 'Invalid URI: A Dos path must be rooted' crash.</li>
<li>Added additional validation when setting directories in the global setting, to ensure they are rooted correctly.</li>
<li>Fixed a bug when starting the server manager and it tries to download steamcmd, but fails as steamcmd is unavailable for download.</li>
</ul>
<u style="font-size: .9em;">CHANGE</u>
<br/>

View file

@ -7,6 +7,29 @@
<link href="http://arkservermanager.freeforums.net/" />
<updated>2021-12-15T00:00:00Z</updated>
<entry>
<id>urn:uuid:202642C9-3B71-4B90-8A43-EFA1C5272C81</id>
<title>1.1.412 (1.1.412.4)</title>
<summary>1.1.412.4</summary>
<link href="" />
<updated>2021-12-15T00:00:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
<p>
<u style="font-size: .9em;">BUGFIX</u>
<br/>
<ul>
<li>Fixed a bug when starting the server manager and it tries to download steamcmd, but fails as steamcmd is unavailable for download.</li>
</ul>
</p>
</div>
</content>
<author>
<name>bletch</name>
<email>bletch1971@hotmail.com</email>
</author>
</entry>
<entry>
<id>urn:uuid:B7DE873D-4FC3-4A7B-A531-3146B4D8639A</id>
<title>1.1.412 (1.1.412.3)</title>

View file

@ -17,6 +17,7 @@
<ProgressBar x:Name="CompletionProgress" Height="10"/>
<Label x:Name="StatusLabel" Content="{DynamicResource AutoUpdater_Status}" HorizontalContentAlignment="Center"/>
<Button Content="{DynamicResource AutoUpdater_CancelButtonLabel}" Width="75" HorizontalAlignment="Center" IsCancel="True" Click="Button_Click"/>
<TextBlock x:Name="ErrorLabel" Text="Error Text" Margin="0,2,0,0" TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Foreground="{DynamicResource WarningMessage}"/>
</StackPanel>
</Grid>
</Window>

View file

@ -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
/// </summary>
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)