mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
fix issue on about page with duplicate server names or inactive servers
This commit is contained in:
@ -27,14 +27,20 @@ namespace WebfrontCore.Controllers
|
||||
? Localization["WEBFRONT_NAV_ABOUT"]
|
||||
: _appConfig.CommunityInformation.Name;
|
||||
|
||||
var activeServers = _appConfig.Servers.Where(server =>
|
||||
Manager.GetServers().FirstOrDefault(s => s.IP == server.IPAddress && s.Port == server.Port) != null);
|
||||
|
||||
var info = new CommunityInfo
|
||||
{
|
||||
GlobalRules = _appConfig.GlobalRules,
|
||||
ServerRules =
|
||||
_appConfig.Servers.ToDictionary(
|
||||
config => Manager.GetServers().FirstOrDefault(server =>
|
||||
server.IP == config.IPAddress && server.Port == config.Port)?.Hostname,
|
||||
config => config.Rules),
|
||||
ServerRules = activeServers.ToDictionary(
|
||||
config =>
|
||||
{
|
||||
var server = Manager.GetServers().FirstOrDefault(server =>
|
||||
server.IP == config.IPAddress && server.Port == config.Port);
|
||||
return (server.Hostname, server.EndPoint);
|
||||
},
|
||||
config => config.Rules),
|
||||
CommunityInformation = _appConfig.CommunityInformation
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user