From dcec5c4c596b0ac21fed40edf34cf2175d0e18f1 Mon Sep 17 00:00:00 2001 From: Vasilis The Pikachu Date: Thu, 31 Oct 2024 23:38:13 +0100 Subject: [PATCH] Add exception message to the failed update prompt. This will make giving support out to players easier without the need to do the logs procedure all the time. --- SS14.Launcher/Assets/Locale/en-US/text.ftl | 5 ++++- SS14.Launcher/Models/Updater.cs | 3 +++ SS14.Launcher/ViewModels/ConnectingViewModel.cs | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/SS14.Launcher/Assets/Locale/en-US/text.ftl b/SS14.Launcher/Assets/Locale/en-US/text.ftl index 7cc5b43c..4502844d 100644 --- a/SS14.Launcher/Assets/Locale/en-US/text.ftl +++ b/SS14.Launcher/Assets/Locale/en-US/text.ftl @@ -23,7 +23,10 @@ connecting-title-connecting = Connecting… connecting-title-content-bundle = Loading… connecting-cancel = Cancel connecting-status-none = Starting connection… -connecting-status-update-error = There was an error while downloading server content. Please ask on Discord for support if the problem persists. +connecting-status-update-error = + There was an error while downloading server content. Please ask on Discord for support if the problem persists. + + Technical error: { $err } connecting-status-updating = Updating: { $status } connecting-status-connecting = Fetching connection info from server… connecting-status-connection-failed = Failed to connect to server! diff --git a/SS14.Launcher/Models/Updater.cs b/SS14.Launcher/Models/Updater.cs index 50d6b963..f333657e 100644 --- a/SS14.Launcher/Models/Updater.cs +++ b/SS14.Launcher/Models/Updater.cs @@ -103,6 +103,7 @@ public Updater() catch (Exception e) { Status = UpdateStatus.Error; + ExceptionMessage = e.Message; Log.Error(e, "Exception while trying to run updates"); } finally @@ -1444,6 +1445,8 @@ public sealed class ResourceManifestData public bool MultiWindow = false; } + public string ExceptionMessage; + public enum UpdateStatus { CheckingClientUpdate, diff --git a/SS14.Launcher/ViewModels/ConnectingViewModel.cs b/SS14.Launcher/ViewModels/ConnectingViewModel.cs index 4d446756..490d4c46 100644 --- a/SS14.Launcher/ViewModels/ConnectingViewModel.cs +++ b/SS14.Launcher/ViewModels/ConnectingViewModel.cs @@ -161,7 +161,8 @@ public string SpeedText _connectorStatus switch { Connector.ConnectionStatus.None => _loc.GetString("connecting-status-none") + _reasonSuffix, - Connector.ConnectionStatus.UpdateError => _loc.GetString("connecting-status-update-error"), + Connector.ConnectionStatus.UpdateError => _loc.GetString("connecting-status-update-error", + ("err", _updater.ExceptionMessage)), Connector.ConnectionStatus.Updating => _loc.GetString("connecting-status-updating", ("status", _loc.GetString(_updaterStatus switch { Updater.UpdateStatus.CheckingClientUpdate => "connecting-update-status-checking-client-update",