adjust displayed error on connection
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<Authors></Authors>
|
||||
<Company></Company>
|
||||
<Version>0.5.1</Version>
|
||||
<Version>0.5.3</Version>
|
||||
<Description></Description>
|
||||
<Copyright></Copyright>
|
||||
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>
|
||||
|
||||
@@ -631,11 +631,11 @@ public class CompactUi : Window, IDisposable
|
||||
return _apiController.ServerState switch
|
||||
{
|
||||
ServerState.Disconnected => "You are currently disconnected from the Mare Synchronos server.",
|
||||
ServerState.Unauthorized => "Your account is not present on the server anymore or you are banned.",
|
||||
ServerState.Unauthorized => "The account associated with your used secret key is not present on the server anymore or you are tempbanned. To check the latter disconnect and reconnect in 15 minutes.",
|
||||
ServerState.Offline => "Your selected Mare Synchronos server is currently offline.",
|
||||
ServerState.VersionMisMatch =>
|
||||
"Your plugin or the server you are connecting to is out of date. Please update your plugin now. If you already did so, contact the server provider to update their server to the latest version.",
|
||||
ServerState.RateLimited => "You are rate limited for (re)connecting too often. Wait and try again later.",
|
||||
ServerState.RateLimited => "You are rate limited for (re)connecting too often. Disconnect, wait 10 minutes and try again.",
|
||||
ServerState.Connected => string.Empty,
|
||||
_ => string.Empty
|
||||
};
|
||||
|
||||
@@ -205,6 +205,14 @@ public partial class ApiController : IDisposable, IMareHubClient
|
||||
}
|
||||
catch (HubException ex)
|
||||
{
|
||||
if (ex.Message.Contains("unauthorized", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Logger.Warn(ex.Message);
|
||||
ServerState = ServerState.Unauthorized;
|
||||
await StopConnection(token).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.Warn(ex.GetType().ToString());
|
||||
Logger.Warn(ex.Message);
|
||||
Logger.Warn(ex.StackTrace ?? string.Empty);
|
||||
|
||||
Reference in New Issue
Block a user