From 00bcbbf8f4a22ee096dd77d52ba2dbf8e8b9c284 Mon Sep 17 00:00:00 2001 From: defnotken Date: Thu, 20 Nov 2025 19:33:53 +0100 Subject: [PATCH] Western Canadians will now filter to NA-East where servers are located in Canada. Co-authored-by: defnotken Reviewed-on: https://git.lightless-sync.org/Lightless-Sync/LightlessServer/pulls/35 --- .../LightlessSyncAuthService/Services/GeoIPService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/LightlessSyncServer/LightlessSyncAuthService/Services/GeoIPService.cs b/LightlessSyncServer/LightlessSyncAuthService/Services/GeoIPService.cs index a60a20f..15aa928 100644 --- a/LightlessSyncServer/LightlessSyncAuthService/Services/GeoIPService.cs +++ b/LightlessSyncServer/LightlessSyncAuthService/Services/GeoIPService.cs @@ -44,12 +44,14 @@ public class GeoIPService : IHostedService if (_dbReader!.TryCity(ip, out var response)) { string? continent = response?.Continent.Code; + string? countryIso = response?.Country.IsoCode; if (!string.IsNullOrEmpty(continent) && string.Equals(continent, "NA", StringComparison.Ordinal) && response?.Location.Longitude != null) { - if (response.Location.Longitude < -102) + if (response.Location.Longitude < -102 && + !string.Equals(countryIso, "CA", StringComparison.OrdinalIgnoreCase)) { continent = "NA-W"; } @@ -57,6 +59,8 @@ public class GeoIPService : IHostedService { continent = "NA-E"; } + + _logger.LogDebug("Connecting {countryIso} to {continent}", countryIso, continent); } return continent ?? "*";