lock attachments when enumerating through them in ScenePresence.CopyTo().
May have some effect on http://opensimulator.org/mantis/view.php?id=5644remove-scene-viewer
parent
9c32b131fd
commit
728fd0b1b8
|
@ -441,7 +441,6 @@ namespace OpenSim.Framework
|
||||||
args["controllers"] = controls;
|
args["controllers"] = controls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((CallbackURI != null) && (!CallbackURI.Equals("")))
|
if ((CallbackURI != null) && (!CallbackURI.Equals("")))
|
||||||
args["callback_uri"] = OSD.FromString(CallbackURI);
|
args["callback_uri"] = OSD.FromString(CallbackURI);
|
||||||
|
|
||||||
|
|
|
@ -3141,26 +3141,30 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
catch { }
|
catch { }
|
||||||
|
|
||||||
// Attachment objects
|
// Attachment objects
|
||||||
if (m_attachments != null && m_attachments.Count > 0)
|
lock (m_attachments)
|
||||||
{
|
{
|
||||||
cAgent.AttachmentObjects = new List<ISceneObject>();
|
if (m_attachments.Count > 0)
|
||||||
cAgent.AttachmentObjectStates = new List<string>();
|
|
||||||
// IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>();
|
|
||||||
m_InTransitScriptStates.Clear();
|
|
||||||
foreach (SceneObjectGroup sog in m_attachments)
|
|
||||||
{
|
{
|
||||||
// We need to make a copy and pass that copy
|
cAgent.AttachmentObjects = new List<ISceneObject>();
|
||||||
// because of transfers withn the same sim
|
cAgent.AttachmentObjectStates = new List<string>();
|
||||||
ISceneObject clone = sog.CloneForNewScene();
|
// IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>();
|
||||||
// Attachment module assumes that GroupPosition holds the offsets...!
|
m_InTransitScriptStates.Clear();
|
||||||
((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos;
|
|
||||||
((SceneObjectGroup)clone).IsAttachment = false;
|
foreach (SceneObjectGroup sog in m_attachments)
|
||||||
cAgent.AttachmentObjects.Add(clone);
|
{
|
||||||
string state = sog.GetStateSnapshot();
|
// We need to make a copy and pass that copy
|
||||||
cAgent.AttachmentObjectStates.Add(state);
|
// because of transfers withn the same sim
|
||||||
m_InTransitScriptStates.Add(state);
|
ISceneObject clone = sog.CloneForNewScene();
|
||||||
// Let's remove the scripts of the original object here
|
// Attachment module assumes that GroupPosition holds the offsets...!
|
||||||
sog.RemoveScriptInstances(true);
|
((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos;
|
||||||
|
((SceneObjectGroup)clone).IsAttachment = false;
|
||||||
|
cAgent.AttachmentObjects.Add(clone);
|
||||||
|
string state = sog.GetStateSnapshot();
|
||||||
|
cAgent.AttachmentObjectStates.Add(state);
|
||||||
|
m_InTransitScriptStates.Add(state);
|
||||||
|
// Let's remove the scripts of the original object here
|
||||||
|
sog.RemoveScriptInstances(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue