From cf3ffe5bb4c6a8bea9599b6143c2f7793500c984 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 24 Aug 2011 20:49:23 +0100 Subject: Fix llAttachToAvatar() Apart from one obvious bug, this was failing because attempting to serialize the script from inside the script (as part of saving the attachment as an inventory asset) was triggering an extremely long delay. So we now don't do this. The state will be serialized anyway when the avatar normally logs out. The worst that can happen is that if the client/server crashes, the attachment scripts start without previous state. --- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index d253c6a..c443669 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -1294,9 +1294,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine public string GetXMLState(UUID itemID) { +// m_log.DebugFormat("[XEngine]: Getting XML state for {0}", itemID); + IScriptInstance instance = GetInstance(itemID); if (instance == null) + { +// m_log.DebugFormat("[XEngine]: Found no script for {0}, returning empty string", itemID); return ""; + } + string xml = instance.GetXMLState(); XmlDocument sdoc = new XmlDocument(); @@ -1437,6 +1443,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine mapData.InnerText = map; stateData.AppendChild(mapData); + +// m_log.DebugFormat("[XEngine]: Got XML state for {0}", itemID); + return doc.InnerXml; } -- cgit v1.1 From 095b3e5756bb3160b30c9c5670ba008fa13d2e66 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 1 Sep 2011 01:22:28 +0100 Subject: Remove pointless cluttering SOP.ParentGroup != null checks. The only times when ParentGroup might be null is during regression tests (which might not be a valid thing) and when scene objects are being constructed from the database. At all other times it's not possible for a SOP not to have a SOG parent. --- OpenSim/Region/ScriptEngine/XEngine/EventManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index 0ac8b5c..08dc71e 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -97,8 +97,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine return; m_log.Debug("Paid: " + objectID + " from " + agentID + ", amount " + amount); - if (part.ParentGroup != null) - part = part.ParentGroup.RootPart; + + part = part.ParentGroup.RootPart; if (part != null) { -- cgit v1.1 From 7eca929686bd2db1cb42f5c9740fd1d186cdc8b1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 1 Sep 2011 02:09:41 +0100 Subject: Eliminate pointless checks of SOG.RootPart != null It's never possible for SOG to have no RootPart, except in the first few picosends of the big bang when it's pulled from region persistence or deserialized --- OpenSim/Region/ScriptEngine/XEngine/EventManager.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index 08dc71e..5c4174e 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -99,11 +99,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_log.Debug("Paid: " + objectID + " from " + agentID + ", amount " + amount); part = part.ParentGroup.RootPart; - - if (part != null) - { - money(part.LocalId, agentID, amount); - } + money(part.LocalId, agentID, amount); } /// -- cgit v1.1