From a2866b85f3674b0f63b962f46f23490cd198515e Mon Sep 17 00:00:00 2001 From: dahlia Date: Thu, 20 Feb 2014 00:18:28 -0800 Subject: add newRegion parameter to CrossAgentToNewRegion event and trigger the event after crossing thread is invoked --- .../CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 2 ++ OpenSim/Region/Framework/Scenes/EventManager.cs | 6 +++--- OpenSim/Region/Framework/Scenes/Scene.cs | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index f1d69b0..c9adc37 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1531,6 +1531,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer CrossAgentToNewRegionDelegate d = CrossAgentToNewRegionAsync; d.BeginInvoke(agent, newpos, neighbourRegion, isFlying, version, CrossAgentToNewRegionCompleted, d); + Scene.EventManager.TriggerCrossAgentToNewRegion(agent, isFlying, neighbourRegion); + return true; } diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 1981a25..ba79964 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -430,7 +430,7 @@ namespace OpenSim.Region.Framework.Scenes public delegate void IncomingInstantMessage(GridInstantMessage message); public event IncomingInstantMessage OnIncomingInstantMessage; - public delegate void CrossAgentToNewRegion(ScenePresence sp, bool isFlying); + public delegate void CrossAgentToNewRegion(ScenePresence sp, bool isFlying, GridRegion newRegion); public event CrossAgentToNewRegion OnCrossAgentToNewRegion; public event IncomingInstantMessage OnUnhandledInstantMessage; @@ -1963,7 +1963,7 @@ namespace OpenSim.Region.Framework.Scenes } } - public void TriggerCrossAgentToNewRegion(ScenePresence agent, bool isFlying) + public void TriggerCrossAgentToNewRegion(ScenePresence agent, bool isFlying, GridRegion newRegion) { CrossAgentToNewRegion handlerCrossAgentToNewRegion = OnCrossAgentToNewRegion; if (handlerCrossAgentToNewRegion != null) @@ -1972,7 +1972,7 @@ namespace OpenSim.Region.Framework.Scenes { try { - d(agent, isFlying); + d(agent, isFlying, newRegion); } catch (Exception e) { diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 06ddcbd..676c000 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4358,7 +4358,6 @@ namespace OpenSim.Region.Framework.Scenes { if (EntityTransferModule != null) { - EventManager.TriggerCrossAgentToNewRegion(agent, isFlying); return EntityTransferModule.Cross(agent, isFlying); } else -- cgit v1.1