Banner Support for profiles, Some cleanup/refactoring. Country for metrics. #22

Merged
defnotken merged 13 commits from server-changes into master 2025-10-21 20:50:55 +00:00
2 changed files with 11 additions and 2 deletions
Showing only changes of commit b142329d09 - Show all commits

View File

@@ -166,6 +166,10 @@ public class GeoIPService : IHostedService
if (_dbReader!.TryCity(ip, out var response))
{
_logger.LogInformation(ip.ToString());
_logger.LogInformation(response?.Country?.ToString());
_logger.LogInformation(response?.Country?.IsoCode);
var country = response?.Country?.IsoCode;
return !string.IsNullOrEmpty(country) ? country : "*";
}

View File

@@ -190,8 +190,13 @@ public partial class LightlessHub : Hub<ILightlessHub>, ILightlessHub
if (_userConnections.TryGetValue(UserUID, out var connectionId)
&& string.Equals(connectionId, Context.ConnectionId, StringComparison.Ordinal))
{
_lightlessMetrics.DecGaugeWithLabels(MetricsAPI.GaugeConnections, labels: Continent);
_lightlessMetrics.DecGaugeWithLabels(MetricsAPI.GaugeConnections, labels: Country);
var ResultLabels = new List<string>
{
Continent,
Country,
};
_lightlessMetrics.DecGaugeWithLabels(MetricsAPI.GaugeConnections, labels: [.. ResultLabels]);
try
{
await GposeLobbyLeave().ConfigureAwait(false);