add EventManager event OnCrossAgentToNewRegion

0.8.0.3
dahlia 2014-02-19 17:52:38 -08:00
parent c26f01ff8c
commit 269a6410a0
2 changed files with 25 additions and 0 deletions

View File

@ -430,6 +430,9 @@ 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 event CrossAgentToNewRegion OnCrossAgentToNewRegion;
public event IncomingInstantMessage OnUnhandledInstantMessage; public event IncomingInstantMessage OnUnhandledInstantMessage;
public delegate void ClientClosed(UUID clientID, Scene scene); public delegate void ClientClosed(UUID clientID, Scene scene);
@ -1960,6 +1963,27 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void TriggerCrossAgentToNewRegion(ScenePresence agent, bool isFlying)
{
CrossAgentToNewRegion handlerCrossAgentToNewRegion = OnCrossAgentToNewRegion;
if (handlerCrossAgentToNewRegion != null)
{
foreach (CrossAgentToNewRegion d in handlerCrossAgentToNewRegion.GetInvocationList())
{
try
{
d(agent, isFlying);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[EVENT MANAGER]: Delegate for TriggerCrossAgentToNewRegion failed - continuing. {0} {1}",
e.Message, e.StackTrace);
}
}
}
}
public void TriggerIncomingInstantMessage(GridInstantMessage message) public void TriggerIncomingInstantMessage(GridInstantMessage message)
{ {
IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage; IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage;

View File

@ -4358,6 +4358,7 @@ 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