diff options
author | UbitUmarov | 2016-08-29 12:18:01 +0100 |
---|---|---|
committer | UbitUmarov | 2016-08-29 12:18:01 +0100 |
commit | d96c05a1219a60183f5076f6c6f0bdd320611fd5 (patch) | |
tree | 4e0fbec610b11574bde78b2eb6556c9721f6b7c4 | |
parent | mantis 8006: AttachmentModule triggered OnAttach by SOG xengine expects by SOP (diff) | |
download | opensim-SC_OLD-d96c05a1219a60183f5076f6c6f0bdd320611fd5.zip opensim-SC_OLD-d96c05a1219a60183f5076f6c6f0bdd320611fd5.tar.gz opensim-SC_OLD-d96c05a1219a60183f5076f6c6f0bdd320611fd5.tar.bz2 opensim-SC_OLD-d96c05a1219a60183f5076f6c6f0bdd320611fd5.tar.xz |
change my previus fix, change xengine to expect SOG and not attachments module, this way not breaking other script engines or modules out there for no valid reason
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 16 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/EventManager.cs | 9 |
2 files changed, 11 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 1563f26..d227974 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -599,8 +599,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
599 | // this can't be done when creating scripts: | 599 | // this can't be done when creating scripts: |
600 | // scripts do internal enqueue of attach event | 600 | // scripts do internal enqueue of attach event |
601 | // and not all scripts are loaded at this point | 601 | // and not all scripts are loaded at this point |
602 | // m_scene.EventManager.TriggerOnAttach(group.LocalId, group.FromItemID, sp.UUID); | 602 | m_scene.EventManager.TriggerOnAttach(group.LocalId, group.FromItemID, sp.UUID); |
603 | TriggerGroupOnAttach(group, sp.UUID); | ||
604 | } | 603 | } |
605 | 604 | ||
606 | return true; | 605 | return true; |
@@ -760,8 +759,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
760 | sp.ControllingClient.SendRemoveInventoryItem(inventoryID); | 759 | sp.ControllingClient.SendRemoveInventoryItem(inventoryID); |
761 | } | 760 | } |
762 | 761 | ||
763 | //m_scene.EventManager.TriggerOnAttach(so.LocalId, so.UUID, UUID.Zero); | 762 | m_scene.EventManager.TriggerOnAttach(so.LocalId, so.UUID, UUID.Zero); |
764 | TriggerGroupOnAttach(so, UUID.Zero); | ||
765 | 763 | ||
766 | // Attach (NULL) stops scripts. We don't want that. Resume them. | 764 | // Attach (NULL) stops scripts. We don't want that. Resume them. |
767 | so.ResumeScripts(); | 765 | so.ResumeScripts(); |
@@ -1058,8 +1056,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
1058 | { | 1056 | { |
1059 | if (fireDetachEvent) | 1057 | if (fireDetachEvent) |
1060 | { | 1058 | { |
1061 | // m_scene.EventManager.TriggerOnAttach(grp.LocalId, grp.FromItemID, UUID.Zero); | 1059 | m_scene.EventManager.TriggerOnAttach(grp.LocalId, grp.FromItemID, UUID.Zero); |
1062 | TriggerGroupOnAttach(grp, UUID.Zero); | ||
1063 | // Allow detach event time to do some work before stopping the script | 1060 | // Allow detach event time to do some work before stopping the script |
1064 | Thread.Sleep(2); | 1061 | Thread.Sleep(2); |
1065 | } | 1062 | } |
@@ -1384,13 +1381,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
1384 | if (sp != null) | 1381 | if (sp != null) |
1385 | DetachSingleAttachmentToGround(sp, soLocalId); | 1382 | DetachSingleAttachmentToGround(sp, soLocalId); |
1386 | } | 1383 | } |
1387 | |||
1388 | private void TriggerGroupOnAttach(SceneObjectGroup grp, UUID avatarID) | ||
1389 | { | ||
1390 | UUID item = grp.FromItemID; // this maybe wrong but xengine ignores it | ||
1391 | foreach(SceneObjectPart part in grp.Parts) | ||
1392 | m_scene.EventManager.TriggerOnAttach(part.LocalId, item, avatarID); | ||
1393 | } | ||
1394 | #endregion | 1384 | #endregion |
1395 | } | 1385 | } |
1396 | } | 1386 | } |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index f1b1e66..301eada 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs | |||
@@ -408,10 +408,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
408 | 408 | ||
409 | public void attach(uint localID, UUID itemID, UUID avatar) | 409 | public void attach(uint localID, UUID itemID, UUID avatar) |
410 | { | 410 | { |
411 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 411 | SceneObjectGroup grp = myScriptEngine.World.GetSceneObjectGroup(localID); |
412 | if(grp == null) | ||
413 | return; | ||
414 | |||
415 | foreach(SceneObjectPart part in grp.Parts) | ||
416 | { | ||
417 | myScriptEngine.PostObjectEvent(part.LocalId, new EventParams( | ||
412 | "attach",new object[] { | 418 | "attach",new object[] { |
413 | new LSL_Types.LSLString(avatar.ToString()) }, | 419 | new LSL_Types.LSLString(avatar.ToString()) }, |
414 | new DetectParams[0])); | 420 | new DetectParams[0])); |
421 | } | ||
415 | } | 422 | } |
416 | 423 | ||
417 | // dataserver: not handled here | 424 | // dataserver: not handled here |