From a2866b85f3674b0f63b962f46f23490cd198515e Mon Sep 17 00:00:00 2001 From: dahlia Date: Thu, 20 Feb 2014 00:18:28 -0800 Subject: [PATCH] add newRegion parameter to CrossAgentToNewRegion event and trigger the event after crossing thread is invoked --- .../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(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index f1d69b0bac..c9adc37eb1 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 1981a25a68..ba79964bcb 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 06ddcbd1cd..676c000462 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