From e901253b49668f1e1d8f135f2d05aaec7baad40a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 17 Dec 2014 00:21:58 +0000 Subject: Fix recent regression where a race condition meant SP.MakeRootAgent() would sometimes look to start attachment scripts before ETM.HandleIncomingSceneObject() had added them. Probably a regression since ghosts branch merge on Nov 26 2014 --- .../CoreModules/Avatar/Attachments/AttachmentsModule.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index ff7a062..4af4ddb 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -341,11 +341,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (!Enabled) return; - if (DebugLevel > 0) - m_log.DebugFormat("[ATTACHMENTS MODULE]: Saving changed attachments for {0}", sp.Name); - List attachments = sp.GetAttachments(); + if (DebugLevel > 0) + m_log.DebugFormat( + "[ATTACHMENTS MODULE]: Saving for {0} attachments for {1} in {2}", + attachments.Count, sp.Name, m_scene.Name); + if (attachments.Count <= 0) return; @@ -359,6 +361,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // This must be done outside the sp.AttachmentSyncLock so that there is no risk of a deadlock from // scripts performing attachment operations at the same time. Getting object states stops the scripts. scriptStates[so] = PrepareScriptInstanceForSave(so, false); + +// m_log.DebugFormat( +// "[ATTACHMENTS MODULE]: For object {0} for {1} in {2} got saved state {3}", +// so.Name, sp.Name, m_scene.Name, scriptStates[so]); } lock (sp.AttachmentsSyncLock) @@ -826,8 +832,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments { if (DebugLevel > 0) m_log.DebugFormat( - "[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}", - so.Name, sp.Name, attachmentpoint, attachOffset, so.RootPart.AttachedPos); + "[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} at pt {2} pos {3} {4} in {5}", + so.Name, sp.Name, attachmentpoint, attachOffset, so.RootPart.AttachedPos, m_scene.Name); // Remove from database and parcel prim count m_scene.DeleteFromStorage(so.UUID); -- cgit v1.1