diff options
author | Justin Clark-Casey (justincc) | 2011-09-10 01:09:17 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-09-10 01:09:17 +0100 |
commit | 728fd0b1b8e1c80f6961ec06efb34727645fdc3e (patch) | |
tree | 951b2b08e11a52b6c557d1ae19d2724cdb7fd329 /OpenSim/Region | |
parent | Add extra log information when attachments fail validation (diff) | |
download | opensim-SC_OLD-728fd0b1b8e1c80f6961ec06efb34727645fdc3e.zip opensim-SC_OLD-728fd0b1b8e1c80f6961ec06efb34727645fdc3e.tar.gz opensim-SC_OLD-728fd0b1b8e1c80f6961ec06efb34727645fdc3e.tar.bz2 opensim-SC_OLD-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
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 44 |
1 files changed, 24 insertions, 20 deletions
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 | } |