From 30ffefb67bf3d74b6355113bc121437d0bdbba14 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 27 Mar 2009 20:41:35 +0000 Subject: * refactor: call some EventManager triggers directly rather than through scene --- OpenSim/Region/Framework/Scenes/Scene.cs | 16 ---------------- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 10 ++++++++-- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 7 ++----- 3 files changed, 10 insertions(+), 23 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 1891f9d..2687422 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -534,7 +534,6 @@ namespace OpenSim.Region.Framework.Scenes return found; } - // Alias IncomingHelloNeighbour OtherRegionUp, for now public bool IncomingHelloNeighbour(RegionInfo neighbour) { @@ -3065,21 +3064,6 @@ namespace OpenSim.Region.Framework.Scenes scriptEngine.InitializeEngine(this); } - public void TriggerObjectChanged(uint localID, uint change) - { - m_eventManager.TriggerOnScriptChangedEvent(localID, change); - } - - public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos) - { - m_eventManager.TriggerAtTargetEvent(localID, handle, targetpos, currentpos); - } - - public void TriggerNotAtTargetEvent(uint localID) - { - m_eventManager.TriggerNotAtTargetEvent(localID); - } - private bool ScriptDanger(SceneObjectPart part,Vector3 pos) { ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 968f94b..1834215 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2939,6 +2939,7 @@ namespace OpenSim.Region.Framework.Scenes } } } + if (atTargets.Count > 0) { uint[] localids = new uint[0]; @@ -2952,16 +2953,20 @@ namespace OpenSim.Region.Framework.Scenes cntr++; } } + for (int ctr = 0; ctr < localids.Length; ctr++) { foreach (uint target in atTargets.Keys) { scriptPosTarget att = atTargets[target]; - m_scene.TriggerAtTargetEvent(localids[ctr], att.handle, att.targetPos, m_rootPart.GroupPosition); + m_scene.EventManager.TriggerAtTargetEvent( + localids[ctr], att.handle, att.targetPos, m_rootPart.GroupPosition); } } + return; } + if (m_scriptListens_notAtTarget && !at_target) { //trigger not_at_target @@ -2976,9 +2981,10 @@ namespace OpenSim.Region.Framework.Scenes cntr++; } } + for (int ctr = 0; ctr < localids.Length; ctr++) { - m_scene.TriggerNotAtTargetEvent(localids[ctr]); + m_scene.EventManager.TriggerNotAtTargetEvent(localids[ctr]); } } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index f178550..d30a45f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3101,11 +3101,8 @@ if (m_shape != null) { public void TriggerScriptChangedEvent(Changed val) { - if (m_parentGroup != null) - { - if (m_parentGroup.Scene != null) - m_parentGroup.Scene.TriggerObjectChanged(LocalId, (uint)val); - } + if (m_parentGroup != null && m_parentGroup.Scene != null) + m_parentGroup.Scene.EventManager.TriggerOnScriptChangedEvent(LocalId, (uint)val); } public void TrimPermissions() -- cgit v1.1