From 25356c60a487795e0ecebc86fb9a9f0ec443720c Mon Sep 17 00:00:00 2001 From: Stanley Dimant Date: Tue, 5 Jul 2022 20:32:25 +0200 Subject: [PATCH] fix connection for registration maybe --- MareSynchronos/WebAPI/ApiController.Connectivity.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/MareSynchronos/WebAPI/ApiController.Connectivity.cs b/MareSynchronos/WebAPI/ApiController.Connectivity.cs index 1302ee7..b6932e6 100644 --- a/MareSynchronos/WebAPI/ApiController.Connectivity.cs +++ b/MareSynchronos/WebAPI/ApiController.Connectivity.cs @@ -20,7 +20,8 @@ namespace MareSynchronos.WebAPI Disconnected, Connected, Unauthorized, - VersionMisMatch + VersionMisMatch, + NoAccount } public partial class ApiController : IDisposable @@ -134,12 +135,13 @@ namespace MareSynchronos.WebAPI return ServerState.Disconnected; if (!ServerAlive) return ServerState.Offline; + if (ServerAlive && SupportedServerVersions.Contains(_connectionDto?.ServerVersion ?? 0) && string.IsNullOrEmpty(UID)) + return ServerState.Unauthorized; if (ServerAlive && !SupportedServerVersions.Contains(_connectionDto?.ServerVersion ?? 0) && !string.IsNullOrEmpty(UID)) return ServerState.VersionMisMatch; - if (ServerAlive && SupportedServerVersions.Contains(_connectionDto?.ServerVersion ?? 0) - && string.IsNullOrEmpty(UID)) - return ServerState.Unauthorized; - return ServerState.Connected; + if (ServerAlive && SupportedServerVersions.Contains(_connectionDto?.ServerVersion ?? 0) && !string.IsNullOrEmpty(UID)) + return ServerState.Connected; + return ServerState.NoAccount; } }