From 99b35d3ca63bb5d1cd8d02087675b97c092c6ecb Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 30 Apr 2011 16:01:54 +0200 Subject: [PATCH 1/5] When coming in from a legacy region without fatpacks, start scripts the usual way --- OpenSim/Region/Framework/Scenes/Scene.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2cbe4dc7fd..7c5e24652c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2342,6 +2342,22 @@ namespace OpenSim.Region.Framework.Scenes newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); newObject.ResumeScripts(); } + else + { + ScenePresence sp; + if (TryGetScenePresence(newObject.OwnerID, out sp)) + { + // If the scene presence is here and already a root + // agent, we came from a ;egacy region. Start the scripts + // here as they used to start. + // TODO: Remove in 0.7.3 + if (!sp.IsChildAgent) + { + newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); + newObject.ResumeScripts(); + } + } + } // Do this as late as possible so that listeners have full access to the incoming object EventManager.TriggerOnIncomingSceneObject(newObject); From 00e94b0ba8e22b1bfdcbebc7c3d5c879d22b52a4 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 30 Apr 2011 16:53:11 -0700 Subject: [PATCH 2/5] Check for RegionID instead of RegionHandle. Other minor tweaks --- .../Simulation/RemoteSimulationConnector.cs | 4 ++-- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 7858f2afd3..f8cea71b43 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs @@ -179,7 +179,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation return true; // else do the remote thing - if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) + if (!m_localBackend.IsLocalRegion(destination.RegionID)) { return m_remoteConnector.CreateAgent(destination, aCircuit, teleportFlags, out reason); } @@ -241,7 +241,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation return true; // else do the remote thing - if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) + if (!m_localBackend.IsLocalRegion(destination.RegionID)) return m_remoteConnector.QueryAccess(destination, id, position, out version, out reason); return false; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 1aac09ddbf..5b86735ef3 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -937,7 +937,7 @@ namespace OpenSim.Region.Framework.Scenes // and it has already rezzed the attachments and started their scripts. // We do the following only for non-login agents, because their scripts // haven't started yet. - if (wasChild) + if (wasChild && Attachments != null && Attachments.Count > 0) { m_log.DebugFormat("[SCENE PRESENCE]: Restarting scripts in attachments..."); // Resume scripts From 56df7461330b1d193f3f60274525eb1b128315ef Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 30 Apr 2011 16:53:43 -0700 Subject: [PATCH 3/5] XXX DEBUGGING! --- OpenSim/Framework/ChildAgentDataUpdate.cs | 3 ++- OpenSim/Framework/WebUtil.cs | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index a626b82302..c4b5ddecb1 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -454,6 +454,7 @@ namespace OpenSim.Framework { OSDMap info = new OSDMap(4); info["sog"] = OSD.FromString(so.ToXml2()); + m_log.DebugFormat("[XXX] {0}", so.ToXml2()); info["extra"] = OSD.FromString(so.ExtraToXmlString()); info["modified"] = OSD.FromBoolean(so.HasGroupChanged); try @@ -462,7 +463,7 @@ namespace OpenSim.Framework } catch (IndexOutOfRangeException e) { - m_log.WarnFormat("[CHILD AGENT DATA]: scrtips list is shorter than object list."); + m_log.WarnFormat("[CHILD AGENT DATA]: scripts list is shorter than object list."); } attObjs.Add(info); diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 9d70f63189..5449a6faf9 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -177,7 +177,16 @@ namespace OpenSim.Framework // If there is some input, write it into the request if (data != null) { - string strBuffer = OSDParser.SerializeJsonString(data); + string strBuffer = string.Empty; + try + { + strBuffer = OSDParser.SerializeJsonString(data); + } + catch (Exception e) + { + m_log.DebugFormat("[WEB UTIL]: Exception serializing data {0}", e.Message); + throw e; + } byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer); request.ContentType = "application/json"; From 91a604d4b6822130871f35ddbc2c53f3468c2a01 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 30 Apr 2011 17:40:21 -0700 Subject: [PATCH 4/5] Removed XXX Debug. Increased ReadWriteTimeout on ServiceOSDRequest, because it was _way_ too low and is probably making writes abort in the middle. --- OpenSim/Framework/ChildAgentDataUpdate.cs | 1 - OpenSim/Framework/WebUtil.cs | 15 +++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index c4b5ddecb1..28fe3ba889 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -454,7 +454,6 @@ namespace OpenSim.Framework { OSDMap info = new OSDMap(4); info["sog"] = OSD.FromString(so.ToXml2()); - m_log.DebugFormat("[XXX] {0}", so.ToXml2()); info["extra"] = OSD.FromString(so.ExtraToXmlString()); info["modified"] = OSD.FromBoolean(so.HasGroupChanged); try diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 5449a6faf9..f6fed33d69 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -171,24 +171,15 @@ namespace OpenSim.Framework request.Timeout = timeout; request.KeepAlive = false; request.MaximumAutomaticRedirections = 10; - request.ReadWriteTimeout = timeout / 4; + request.ReadWriteTimeout = timeout * 8; request.Headers[OSHeaderRequestID] = reqnum.ToString(); // If there is some input, write it into the request if (data != null) { - string strBuffer = string.Empty; - try - { - strBuffer = OSDParser.SerializeJsonString(data); - } - catch (Exception e) - { - m_log.DebugFormat("[WEB UTIL]: Exception serializing data {0}", e.Message); - throw e; - } + string strBuffer = OSDParser.SerializeJsonString(data); byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer); - + request.ContentType = "application/json"; request.ContentLength = buffer.Length; //Count bytes to send using (Stream requestStream = request.GetRequestStream()) From d4323dd7530734ed2c35138722ed8c9c01d53d4e Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 30 Apr 2011 18:08:48 -0700 Subject: [PATCH 5/5] Increased Timeout to 30 secs. --- OpenSim/Framework/WebUtil.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index f6fed33d69..ac0828b90e 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -142,17 +142,17 @@ namespace OpenSim.Framework /// public static OSDMap PutToService(string url, OSDMap data) { - return ServiceOSDRequest(url,data,"PUT",10000); + return ServiceOSDRequest(url,data,"PUT",30000); } public static OSDMap PostToService(string url, OSDMap data) { - return ServiceOSDRequest(url,data,"POST",10000); + return ServiceOSDRequest(url,data,"POST",30000); } public static OSDMap GetFromService(string url) { - return ServiceOSDRequest(url,null,"GET",10000); + return ServiceOSDRequest(url,null,"GET",30000); } public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout)