aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-09-10 01:09:17 +0100
committerJustin Clark-Casey (justincc)2011-09-10 01:09:17 +0100
commit728fd0b1b8e1c80f6961ec06efb34727645fdc3e (patch)
tree951b2b08e11a52b6c557d1ae19d2724cdb7fd329
parentAdd extra log information when attachments fail validation (diff)
downloadopensim-SC-728fd0b1b8e1c80f6961ec06efb34727645fdc3e.zip
opensim-SC-728fd0b1b8e1c80f6961ec06efb34727645fdc3e.tar.gz
opensim-SC-728fd0b1b8e1c80f6961ec06efb34727645fdc3e.tar.bz2
opensim-SC-728fd0b1b8e1c80f6961ec06efb34727645fdc3e.tar.xz
lock attachments when enumerating through them in ScenePresence.CopyTo().
May have some effect on http://opensimulator.org/mantis/view.php?id=5644
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs44
2 files changed, 24 insertions, 21 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index 53ec166..5a4811e 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -441,7 +441,6 @@ namespace OpenSim.Framework
441 args["controllers"] = controls; 441 args["controllers"] = controls;
442 } 442 }
443 443
444
445 if ((CallbackURI != null) && (!CallbackURI.Equals(""))) 444 if ((CallbackURI != null) && (!CallbackURI.Equals("")))
446 args["callback_uri"] = OSD.FromString(CallbackURI); 445 args["callback_uri"] = OSD.FromString(CallbackURI);
447 446
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 18ad715..d65d78d 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3141,26 +3141,30 @@ namespace OpenSim.Region.Framework.Scenes
3141 catch { } 3141 catch { }
3142 3142
3143 // Attachment objects 3143 // Attachment objects
3144 if (m_attachments != null && m_attachments.Count > 0) 3144 lock (m_attachments)
3145 { 3145 {
3146 cAgent.AttachmentObjects = new List<ISceneObject>(); 3146 if (m_attachments.Count > 0)
3147 cAgent.AttachmentObjectStates = new List<string>(); 3147 {
3148// IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>(); 3148 cAgent.AttachmentObjects = new List<ISceneObject>();
3149 m_InTransitScriptStates.Clear(); 3149 cAgent.AttachmentObjectStates = new List<string>();
3150 foreach (SceneObjectGroup sog in m_attachments) 3150 // IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>();
3151 { 3151 m_InTransitScriptStates.Clear();
3152 // We need to make a copy and pass that copy 3152
3153 // because of transfers withn the same sim 3153 foreach (SceneObjectGroup sog in m_attachments)
3154 ISceneObject clone = sog.CloneForNewScene(); 3154 {
3155 // Attachment module assumes that GroupPosition holds the offsets...! 3155 // We need to make a copy and pass that copy
3156 ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos; 3156 // because of transfers withn the same sim
3157 ((SceneObjectGroup)clone).IsAttachment = false; 3157 ISceneObject clone = sog.CloneForNewScene();
3158 cAgent.AttachmentObjects.Add(clone); 3158 // Attachment module assumes that GroupPosition holds the offsets...!
3159 string state = sog.GetStateSnapshot(); 3159 ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos;
3160 cAgent.AttachmentObjectStates.Add(state); 3160 ((SceneObjectGroup)clone).IsAttachment = false;
3161 m_InTransitScriptStates.Add(state); 3161 cAgent.AttachmentObjects.Add(clone);
3162 // Let's remove the scripts of the original object here 3162 string state = sog.GetStateSnapshot();
3163 sog.RemoveScriptInstances(true); 3163 cAgent.AttachmentObjectStates.Add(state);
3164 m_InTransitScriptStates.Add(state);
3165 // Let's remove the scripts of the original object here
3166 sog.RemoveScriptInstances(true);
3167 }
3164 } 3168 }
3165 } 3169 }
3166 } 3170 }