internal static bool ValidatePeer(string ipAddress)
{
try
{
if (GameConfig.EnableNat)
{
return true;
}
var hostEntry = Dns.GetHostEntry(Dns.GetHostName());
foreach (var ip in hostEntry.AddressList)
{
if (ip.ToString() == ipAddress)
{
return true;
}
}
}
catch (Exception ex)
{
ErrorLog.LogHandledException(ex);
}
return false;
}