diff --git a/Application/API/Master/ApiServer.cs b/Application/API/Master/ApiServer.cs index 4c2fe3ca..212c149c 100644 --- a/Application/API/Master/ApiServer.cs +++ b/Application/API/Master/ApiServer.cs @@ -24,5 +24,7 @@ namespace IW4MAdmin.Application.API.Master public int ClientNum { get; set; } [JsonPropertyName("maxclientnum")] public int MaxClientNum { get; set; } + [JsonPropertyName("resolved_external_ip_address")] + public string? ResolvedExternalIPAddress { get; set; } } } diff --git a/Application/Misc/MasterCommunication.cs b/Application/Misc/MasterCommunication.cs index 86adc1a6..5b537411 100644 --- a/Application/Misc/MasterCommunication.cs +++ b/Application/Misc/MasterCommunication.cs @@ -149,7 +149,8 @@ namespace IW4MAdmin.Application.Misc MaxClientNum = s.MaxClients, Id = s.EndPoint, Port = (short)s.ListenPort, - IPAddress = s.ListenAddress + IPAddress = s.ListenAddress, + ResolvedExternalIPAddress = s.ResolvedIpEndPoint.Address.IsInternal() ? _manager.ExternalIPAddress : null }).ToList(), WebfrontUrl = _appConfig.WebfrontUrl }; diff --git a/SharedLibraryCore/Dtos/ServerInfo.cs b/SharedLibraryCore/Dtos/ServerInfo.cs index 5b4c304c..3b3a0125 100644 --- a/SharedLibraryCore/Dtos/ServerInfo.cs +++ b/SharedLibraryCore/Dtos/ServerInfo.cs @@ -25,6 +25,7 @@ namespace SharedLibraryCore.Dtos public string IPAddress { get; set; } public string ExternalIPAddress { get; set; } public bool IsPasswordProtected { get; set; } + public string? ResolvedExternalIPAddress { get; set; } public string Endpoint => $"{IPAddress}:{Port}"; public double? LobbyZScore diff --git a/WebfrontCore/Controllers/API/Server.cs b/WebfrontCore/Controllers/API/Server.cs index 519744fa..83e76701 100644 --- a/WebfrontCore/Controllers/API/Server.cs +++ b/WebfrontCore/Controllers/API/Server.cs @@ -39,6 +39,7 @@ namespace WebfrontCore.Controllers.API name = server.GametypeName }, Parser = server.RconParser.Name, + ResolvedExternalIPAddress = server.ResolvedIpEndPoint.Address.IsInternal() ? Manager.ExternalIPAddress : null, })); } @@ -68,6 +69,7 @@ namespace WebfrontCore.Controllers.API name = foundServer.GametypeName }, Parser = foundServer.RconParser.Name, + ResolvedExternalIPAddress = foundServer.ResolvedIpEndPoint.Address.IsInternal() ? Manager.ExternalIPAddress : null }); }