mantis 8006: AttachmentModule triggered OnAttach by SOG xengine expects by SOP

LSLKeyTest
UbitUmarov 2016-08-29 11:53:07 +01:00
parent 9a67c9fd78
commit a4bf78fa19
1 changed files with 12 additions and 4 deletions

View File

@ -599,7 +599,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
// this can't be done when creating scripts:
// scripts do internal enqueue of attach event
// and not all scripts are loaded at this point
m_scene.EventManager.TriggerOnAttach(group.LocalId, group.FromItemID, sp.UUID);
// m_scene.EventManager.TriggerOnAttach(group.LocalId, group.FromItemID, sp.UUID);
TriggerGroupOnAttach(group, sp.UUID);
}
return true;
@ -759,7 +760,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
sp.ControllingClient.SendRemoveInventoryItem(inventoryID);
}
m_scene.EventManager.TriggerOnAttach(so.LocalId, so.UUID, UUID.Zero);
//m_scene.EventManager.TriggerOnAttach(so.LocalId, so.UUID, UUID.Zero);
TriggerGroupOnAttach(so, UUID.Zero);
// Attach (NULL) stops scripts. We don't want that. Resume them.
so.ResumeScripts();
@ -1056,8 +1058,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
{
if (fireDetachEvent)
{
m_scene.EventManager.TriggerOnAttach(grp.LocalId, grp.FromItemID, UUID.Zero);
// m_scene.EventManager.TriggerOnAttach(grp.LocalId, grp.FromItemID, UUID.Zero);
TriggerGroupOnAttach(grp, UUID.Zero);
// Allow detach event time to do some work before stopping the script
Thread.Sleep(2);
}
@ -1383,6 +1385,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
DetachSingleAttachmentToGround(sp, soLocalId);
}
private void TriggerGroupOnAttach(SceneObjectGroup grp, UUID avatarID)
{
UUID item = grp.FromItemID; // this maybe wrong but xengine ignores it
foreach(SceneObjectPart part in grp.Parts)
m_scene.EventManager.TriggerOnAttach(part.LocalId, item, avatarID);
}
#endregion
}
}