parent
74bb5282a0
commit
e172e37c58
|
@ -207,7 +207,14 @@ namespace OpenSim.Framework.Types
|
||||||
this.m_internalEndPoint.Port = (int)configuration_result;
|
this.m_internalEndPoint.Port = (int)configuration_result;
|
||||||
break;
|
break;
|
||||||
case "external_host_name":
|
case "external_host_name":
|
||||||
|
if ((string)configuration_result != "SYSTEMIP")
|
||||||
|
{
|
||||||
this.m_externalHostName = (string)configuration_result;
|
this.m_externalHostName = (string)configuration_result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.m_externalHostName = Util.GetLocalHost().ToString();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "terrain_file":
|
case "terrain_file":
|
||||||
this.estateSettings.terrainFile = (string)configuration_result;
|
this.estateSettings.terrainFile = (string)configuration_result;
|
||||||
|
|
|
@ -256,6 +256,26 @@ namespace OpenSim.Framework.Utilities
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IPAddress GetLocalHost()
|
||||||
|
{
|
||||||
|
string dnsAddress = "localhost";
|
||||||
|
|
||||||
|
IPAddress[] hosts = Dns.GetHostEntry(dnsAddress).AddressList;
|
||||||
|
|
||||||
|
foreach (IPAddress host in hosts)
|
||||||
|
{
|
||||||
|
if (!IPAddress.IsLoopback(host) && host.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
|
||||||
|
{
|
||||||
|
return host;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hosts.Length > 0)
|
||||||
|
return hosts[0];
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public Util()
|
public Util()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue