From b089ccfa3d351b4dba43bcbc284d87d7c4963dae Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sat, 2 Feb 2008 06:34:07 +0000 Subject: Hopefully fixed MySQL DB crash on startup issue (so we can remove 3 sec wait). Added option to try alternate UDP ports if the one configured is in use. UDP packets are now bound to the actual outside IP address and hopefully won't "randomly" select IP on multihomed systems. --- OpenSim/Framework/Console/LogBase.cs | 14 +++++++++++++- OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | 5 +++-- OpenSim/Framework/RegionInfo.cs | 16 +++++++++++++++- OpenSim/Framework/SerializableRegionInfo.cs | 2 ++ 4 files changed, 33 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/LogBase.cs b/OpenSim/Framework/Console/LogBase.cs index 0036921..f7d0d1f 100644 --- a/OpenSim/Framework/Console/LogBase.cs +++ b/OpenSim/Framework/Console/LogBase.cs @@ -67,7 +67,19 @@ namespace OpenSim.Framework.Console System.Console.WriteLine("Logs will be saved to current directory in " + LogFile); - Log = File.AppendText(LogFile); + try + { + Log = File.AppendText(LogFile); + } + catch (Exception ex) + { + System.Console.WriteLine("Unable to open log file. Do you already have another copy of OpenSim running? Permission problem?"); + System.Console.WriteLine(ex.Message); + System.Console.WriteLine(""); + System.Console.WriteLine("Application is terminating."); + System.Console.WriteLine(""); + System.Threading.Thread.CurrentThread.Abort(); + } Log.WriteLine("========================================================================"); Log.WriteLine(componentname + " Started at " + DateTime.Now.ToString()); } diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs index 7ac4bde..45d0720 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs @@ -417,8 +417,9 @@ namespace OpenSim.Framework.Data.MySQL public void StoreLandObject(Land parcel, LLUUID regionUUID) { - MainLog.Instance.Verbose("DATASTORE", "Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))"); - System.Threading.Thread.Sleep(3000); + // Does the new locking fix it? + //MainLog.Instance.Verbose("DATASTORE", "Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))"); + //System.Threading.Thread.Sleep(3000); lock (DBAccessLock) { diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 8d4e905..b843774 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -67,6 +67,7 @@ namespace OpenSim.Framework m_internalEndPoint = ConvertFrom.InternalEndPoint; m_externalHostName = ConvertFrom.ExternalHostName; m_remotingPort = ConvertFrom.RemotingPort; + m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports; RemotingAddress = ConvertFrom.RemotingAddress; RegionID = LLUUID.Zero; } @@ -80,6 +81,7 @@ namespace OpenSim.Framework get { return m_remotingPort; } set { m_remotingPort = value; } } + public bool m_allow_alternate_ports; public string RemotingAddress; @@ -125,6 +127,8 @@ namespace OpenSim.Framework set { m_externalHostName = value; } } + protected bool Allow_Alternate_Ports; + protected IPEndPoint m_internalEndPoint; public IPEndPoint InternalEndPoint @@ -163,6 +167,8 @@ namespace OpenSim.Framework public bool isSandbox = false; public bool commFailTF = false; + public bool m_allow_alternate_ports; + public LLUUID MasterAvatarAssignedUUID = LLUUID.Zero; public LLUUID CovenantID = LLUUID.Zero; public string MasterAvatarFirstName = String.Empty; @@ -217,6 +223,7 @@ namespace OpenSim.Framework m_internalEndPoint = ConvertFrom.InternalEndPoint; m_externalHostName = ConvertFrom.ExternalHostName; m_remotingPort = ConvertFrom.RemotingPort; + m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports; RemotingAddress = ConvertFrom.RemotingAddress; RegionID = LLUUID.Zero; } @@ -228,6 +235,7 @@ namespace OpenSim.Framework m_internalEndPoint = ConvertFrom.InternalEndPoint; m_externalHostName = ConvertFrom.ExternalHostName; m_remotingPort = ConvertFrom.RemotingPort; + m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports; RemotingAddress = ConvertFrom.RemotingAddress; RegionID = LLUUID.Zero; } @@ -300,6 +308,9 @@ namespace OpenSim.Framework configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", NetworkServersInfo.DefaultHttpListenerPort.ToString(), false); + configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, + "Allow sim to find alternate UDP ports when ports are in use?", + "false", false); configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", "127.0.0.1", false); @@ -357,7 +368,10 @@ namespace OpenSim.Framework m_internalEndPoint = new IPEndPoint(address, 0); break; case "internal_ip_port": - m_internalEndPoint.Port = (int) configuration_result; + m_internalEndPoint.Port = (int)configuration_result; + break; + case "allow_alternate_ports": + m_allow_alternate_ports = (bool)configuration_result; break; case "external_host_name": if ((string) configuration_result != "SYSTEMIP") diff --git a/OpenSim/Framework/SerializableRegionInfo.cs b/OpenSim/Framework/SerializableRegionInfo.cs index 18a3829..0097fe4 100644 --- a/OpenSim/Framework/SerializableRegionInfo.cs +++ b/OpenSim/Framework/SerializableRegionInfo.cs @@ -49,6 +49,7 @@ namespace OpenSim.Framework m_internalEndPoint = ConvertFrom.InternalEndPoint; m_externalHostName = ConvertFrom.ExternalHostName; m_remotingPort = ConvertFrom.RemotingPort; + m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports; RemotingAddress = ConvertFrom.RemotingAddress; } @@ -80,6 +81,7 @@ namespace OpenSim.Framework get { return m_remotingPort; } set { m_remotingPort = value; } } + public bool m_allow_alternate_ports; public string RemotingAddress; -- cgit v1.1