Make resolving the IP on startup optional.

Adds ResolveAddress boolean to regions.ini
melanie
Melanie Thielker 2016-12-12 10:08:31 +00:00
parent cdfdf6322d
commit 9ef9dde0f3
1 changed files with 19 additions and 0 deletions

View File

@ -147,6 +147,7 @@ namespace OpenSim.Framework
public string RemotingAddress;
public UUID ScopeID = UUID.Zero;
private UUID m_maptileStaticUUID = UUID.Zero;
private bool m_resolveAddress = false;
public uint WorldLocX = 0;
public uint WorldLocY = 0;
@ -686,6 +687,20 @@ namespace OpenSim.Framework
config.Set("AllowAlternatePorts", m_allow_alternate_ports.ToString());
}
// ResolveAddress
//
allKeys.Remove("ResolveAddress");
if (config.Contains("ResolveAddress"))
{
m_resolveAddress = config.GetBoolean("ResolveAddress", false);
}
else
{
m_resolveAddress = Convert.ToBoolean(MainConsole.Instance.CmdPrompt("Resolve hostname to IP on start (for running inside Docker)", "False"));
config.Set("ResolveAddress", m_resolveAddress.ToString());
}
// ExternalHostName
//
allKeys.Remove("ExternalHostName");
@ -706,6 +721,10 @@ namespace OpenSim.Framework
"[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}",
m_externalHostName, name);
}
else if (!m_resolveAddress)
{
m_externalHostName = externalName;
}
else
{
IPAddress[] addrs = Dns.GetHostAddresses(externalName);