update references from IP to ListenAddress

This commit is contained in:
RaidMax
2023-04-04 22:21:18 -05:00
parent 6fa172d757
commit 2e726ea9ed
9 changed files with 86 additions and 101 deletions

View File

@ -85,9 +85,14 @@ namespace SharedLibraryCore
InitializeAutoMessages();
}
public long EndPoint => IPAddress.TryParse(IP, out _)
? Convert.ToInt64($"{IP.Replace(".", "")}{Port}")
: $"{IP.Replace(".", "")}{Port}".GetStableHashCode();
public long EndPoint => IPAddress.TryParse(ListenAddress, out _)
? Convert.ToInt64($"{ListenAddress!.Replace(".", "")}{ListenPort}")
: $"{ListenAddress!.Replace(".", "")}{ListenPort}".GetStableHashCode();
public long LegacyEndpoint => EndPoint;
public abstract long LegacyDatabaseId { get; }
public string Id => $"{ListenAddress}:{ListenPort}";
// Objects
public IManager Manager { get; protected set; }
@ -142,6 +147,8 @@ namespace SharedLibraryCore
/// </summary>
public string IP { get; protected set; }
public string ListenAddress => IP;
public IPEndPoint ResolvedIpEndPoint { get; protected set; }
public string Version { get; protected set; }
public bool IsInitialized { get; set; }
@ -391,7 +398,7 @@ namespace SharedLibraryCore
public override string ToString()
{
return $"{IP}:{Port}";
return $"{ListenAddress}:{ListenPort}";
}
protected async Task<bool> ScriptLoaded()

View File

@ -1242,7 +1242,7 @@ namespace SharedLibraryCore
var serverConfig = appConfig.Servers?
.FirstOrDefault(configServer =>
configServer.IPAddress == server.IP && configServer.Port == server.Port);
configServer.IPAddress == server.ListenAddress && configServer.Port == server.ListenPort);
var allRules = appConfig.GlobalRules?.ToList() ?? new List<string>();
if (serverConfig?.Rules != null)