From af265e001d3bf043590e480cd6574a14193f6de0 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 15 Feb 2010 19:15:03 +0900 Subject: Formatting cleanup. --- OpenSim/Framework/AvatarAppearance.cs | 4 ++-- OpenSim/Framework/Console/LocalConsole.cs | 14 +++++++------- OpenSim/Framework/Console/RemoteConsole.cs | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index b2c4d8e..a2a5c84 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -69,7 +69,7 @@ namespace OpenSim.Framework private static UUID HAIR_ASSET = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66"); private static UUID HAIR_ITEM = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66"); - public readonly static int VISUALPARAM_COUNT = 218; + public readonly static int VISUALPARAM_COUNT = 218; protected UUID m_owner; @@ -361,7 +361,7 @@ namespace OpenSim.Framework // This sets Visual Params with *less* weirder values then default. Instead of a ugly alien, it looks like a fat scientist SetDefaultParams(m_visualparams); SetDefaultWearables(); - m_texture = GetDefaultTexture(); + m_texture = GetDefaultTexture(); } public AvatarAppearance(UUID avatarID, AvatarWearable[] wearables, byte[] visualParams) diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs index b7e191b..be936b6 100644 --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs @@ -38,7 +38,7 @@ namespace OpenSim.Framework.Console { /// /// A console that uses cursor control and color - /// + /// public class LocalConsole : CommandConsole { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -100,8 +100,8 @@ namespace OpenSim.Framework.Console private int SetCursorTop(int top) { // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try - // to set a cursor row position with a currently invalid column, mono will throw an exception. - // Therefore, we need to make sure that the column position is valid first. + // to set a cursor row position with a currently invalid column, mono will throw an exception. + // Therefore, we need to make sure that the column position is valid first. int left = System.Console.CursorLeft; if (left < 0) @@ -129,12 +129,12 @@ namespace OpenSim.Framework.Console /// /// /// The new cursor column. - /// + /// private int SetCursorLeft(int left) { // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try - // to set a cursor column position with a currently invalid row, mono will throw an exception. - // Therefore, we need to make sure that the row position is valid first. + // to set a cursor column position with a currently invalid row, mono will throw an exception. + // Therefore, we need to make sure that the row position is valid first. int top = System.Console.CursorTop; if (top < 0) @@ -183,7 +183,7 @@ namespace OpenSim.Framework.Console System.Console.Write("{0}", prompt); SetCursorTop(new_y); - SetCursorLeft(new_x); + SetCursorLeft(new_x); } } diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs index 9fdd1b8..6f8348d 100644 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs @@ -302,9 +302,9 @@ namespace OpenSim.Framework.Console if (!UUID.TryParse(post["ID"].ToString(), out id)) return reply; - lock(m_Connections) + lock (m_Connections) { - if(!m_Connections.ContainsKey(id)) + if (!m_Connections.ContainsKey(id)) return reply; } -- cgit v1.1 From c62a6adb2b234fcbe99e352f4bd2af0cbf683a99 Mon Sep 17 00:00:00 2001 From: dahlia Date: Wed, 17 Feb 2010 19:56:30 -0800 Subject: change "SYSTEMIP" to "localhost" in the create region console command prompt --- OpenSim/Framework/RegionInfo.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 88b62e0..ee5dd37 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -474,15 +474,15 @@ namespace OpenSim.Framework if (config.Contains("ExternalHostName")) { - externalName = config.GetString("ExternalHostName", "SYSTEMIP"); + externalName = config.GetString("ExternalHostName", "localhost"); } else { - externalName = MainConsole.Instance.CmdPrompt("External host name", "SYSTEMIP"); + externalName = MainConsole.Instance.CmdPrompt("External host name", "localhost"); config.Set("ExternalHostName", externalName); } - if (externalName == "SYSTEMIP") + if (externalName == "localhost") m_externalHostName = Util.GetLocalHost().ToString(); else m_externalHostName = externalName; @@ -788,7 +788,7 @@ namespace OpenSim.Framework m_allow_alternate_ports = (bool) configuration_result; break; case "external_host_name": - if ((string) configuration_result != "SYSTEMIP") + if ((string) configuration_result != "localhost") { m_externalHostName = (string) configuration_result; } -- cgit v1.1 From 92f8f3e9d278455aca1e36e40c58ac529069bdef Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 18 Feb 2010 03:31:06 +0000 Subject: Revert "change "SYSTEMIP" to "localhost" in the create region console command prompt" after speaking to Dahlia This reverts commit c62a6adb2b234fcbe99e352f4bd2af0cbf683a99. --- OpenSim/Framework/RegionInfo.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index ee5dd37..88b62e0 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -474,15 +474,15 @@ namespace OpenSim.Framework if (config.Contains("ExternalHostName")) { - externalName = config.GetString("ExternalHostName", "localhost"); + externalName = config.GetString("ExternalHostName", "SYSTEMIP"); } else { - externalName = MainConsole.Instance.CmdPrompt("External host name", "localhost"); + externalName = MainConsole.Instance.CmdPrompt("External host name", "SYSTEMIP"); config.Set("ExternalHostName", externalName); } - if (externalName == "localhost") + if (externalName == "SYSTEMIP") m_externalHostName = Util.GetLocalHost().ToString(); else m_externalHostName = externalName; @@ -788,7 +788,7 @@ namespace OpenSim.Framework m_allow_alternate_ports = (bool) configuration_result; break; case "external_host_name": - if ((string) configuration_result != "localhost") + if ((string) configuration_result != "SYSTEMIP") { m_externalHostName = (string) configuration_result; } -- cgit v1.1 From 842b68eeff7571d3c82415c65065bec3c95f34ea Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 18 Feb 2010 04:19:33 +0000 Subject: Change handling of the SYSTEMIP constant to be more sane. This will now choose the first network interface IP address, or the loopback interface if no external interfaces are found. It will log the IP address used as [NETWORK]: Using x.x.x.x for SYSTEMIP. --- OpenSim/Framework/RegionInfo.cs | 1 - OpenSim/Framework/Util.cs | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 88b62e0..baef32a 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -487,7 +487,6 @@ namespace OpenSim.Framework else m_externalHostName = externalName; - // Master avatar cruft // string masterAvatarUUID; diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 7215086..48435cb 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -589,11 +589,17 @@ namespace OpenSim.Framework public static IPAddress GetLocalHost() { - string dnsAddress = "localhost"; + IPAddress[] iplist = GetLocalHosts(); - IPAddress[] hosts = Dns.GetHostEntry(dnsAddress).AddressList; + if (iplist.Length == 0) // No accessible external interfaces + { + IPAddress[] loopback = Dns.GetHostAddresses("localhost"); + IPAddress localhost = loopback[0]; - foreach (IPAddress host in hosts) + return localhost; + } + + foreach (IPAddress host in iplist) { if (!IPAddress.IsLoopback(host) && host.AddressFamily == AddressFamily.InterNetwork) { @@ -601,15 +607,15 @@ namespace OpenSim.Framework } } - if (hosts.Length > 0) + if (iplist.Length > 0) { - foreach (IPAddress host in hosts) + foreach (IPAddress host in iplist) { if (host.AddressFamily == AddressFamily.InterNetwork) return host; } // Well all else failed... - return hosts[0]; + return iplist[0]; } return null; -- cgit v1.1