diff options
author | Adam Frisby | 2007-07-30 21:12:29 +0000 |
---|---|---|
committer | Adam Frisby | 2007-07-30 21:12:29 +0000 |
commit | e172e37c58c1d4ab48e3dcccacb8707c25e0d2bf (patch) | |
tree | 44b75ae525cf5b4da3ef1baec3dc8d21f772277e /OpenSim/Framework | |
parent | mass update of files to have native line endings (diff) | |
download | opensim-SC-e172e37c58c1d4ab48e3dcccacb8707c25e0d2bf.zip opensim-SC-e172e37c58c1d4ab48e3dcccacb8707c25e0d2bf.tar.gz opensim-SC-e172e37c58c1d4ab48e3dcccacb8707c25e0d2bf.tar.bz2 opensim-SC-e172e37c58c1d4ab48e3dcccacb8707c25e0d2bf.tar.xz |
* Added GetLocalHost() to Util
* ExternalHostName supports "SYSTEMIP" again.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/General/Types/RegionInfo.cs | 9 | ||||
-rw-r--r-- | OpenSim/Framework/General/Util.cs | 20 |
2 files changed, 28 insertions, 1 deletions
diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index 57bb398..ef05534 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs | |||
@@ -207,7 +207,14 @@ namespace OpenSim.Framework.Types | |||
207 | this.m_internalEndPoint.Port = (int)configuration_result; | 207 | this.m_internalEndPoint.Port = (int)configuration_result; |
208 | break; | 208 | break; |
209 | case "external_host_name": | 209 | case "external_host_name": |
210 | this.m_externalHostName = (string)configuration_result; | 210 | if ((string)configuration_result != "SYSTEMIP") |
211 | { | ||
212 | this.m_externalHostName = (string)configuration_result; | ||
213 | } | ||
214 | else | ||
215 | { | ||
216 | this.m_externalHostName = Util.GetLocalHost().ToString(); | ||
217 | } | ||
211 | break; | 218 | break; |
212 | case "terrain_file": | 219 | case "terrain_file": |
213 | this.estateSettings.terrainFile = (string)configuration_result; | 220 | this.estateSettings.terrainFile = (string)configuration_result; |
diff --git a/OpenSim/Framework/General/Util.cs b/OpenSim/Framework/General/Util.cs index bbee4b2..9e687ba 100644 --- a/OpenSim/Framework/General/Util.cs +++ b/OpenSim/Framework/General/Util.cs | |||
@@ -256,6 +256,26 @@ namespace OpenSim.Framework.Utilities | |||
256 | return null; | 256 | return null; |
257 | } | 257 | } |
258 | 258 | ||
259 | public static IPAddress GetLocalHost() | ||
260 | { | ||
261 | string dnsAddress = "localhost"; | ||
262 | |||
263 | IPAddress[] hosts = Dns.GetHostEntry(dnsAddress).AddressList; | ||
264 | |||
265 | foreach (IPAddress host in hosts) | ||
266 | { | ||
267 | if (!IPAddress.IsLoopback(host) && host.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) | ||
268 | { | ||
269 | return host; | ||
270 | } | ||
271 | } | ||
272 | |||
273 | if (hosts.Length > 0) | ||
274 | return hosts[0]; | ||
275 | |||
276 | return null; | ||
277 | } | ||
278 | |||
259 | public Util() | 279 | public Util() |
260 | { | 280 | { |
261 | 281 | ||