add newRegion parameter to CrossAgentToNewRegion event and trigger the event after crossing thread is invoked

0.8.0.3
dahlia 2014-02-20 00:18:28 -08:00
parent 269a6410a0
commit a2866b85f3
3 changed files with 5 additions and 4 deletions

View File

@ -1531,6 +1531,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
CrossAgentToNewRegionDelegate d = CrossAgentToNewRegionAsync; CrossAgentToNewRegionDelegate d = CrossAgentToNewRegionAsync;
d.BeginInvoke(agent, newpos, neighbourRegion, isFlying, version, CrossAgentToNewRegionCompleted, d); d.BeginInvoke(agent, newpos, neighbourRegion, isFlying, version, CrossAgentToNewRegionCompleted, d);
Scene.EventManager.TriggerCrossAgentToNewRegion(agent, isFlying, neighbourRegion);
return true; return true;
} }

View File

@ -430,7 +430,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void IncomingInstantMessage(GridInstantMessage message); public delegate void IncomingInstantMessage(GridInstantMessage message);
public event IncomingInstantMessage OnIncomingInstantMessage; 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 CrossAgentToNewRegion OnCrossAgentToNewRegion;
public event IncomingInstantMessage OnUnhandledInstantMessage; 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; CrossAgentToNewRegion handlerCrossAgentToNewRegion = OnCrossAgentToNewRegion;
if (handlerCrossAgentToNewRegion != null) if (handlerCrossAgentToNewRegion != null)
@ -1972,7 +1972,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
try try
{ {
d(agent, isFlying); d(agent, isFlying, newRegion);
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -4358,7 +4358,6 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (EntityTransferModule != null) if (EntityTransferModule != null)
{ {
EventManager.TriggerCrossAgentToNewRegion(agent, isFlying);
return EntityTransferModule.Cross(agent, isFlying); return EntityTransferModule.Cross(agent, isFlying);
} }
else else