Moved the inventory manipulation from HGEntityTransferModule to HGInventoryAccessModule where it belongs. They need to exchange some events, so added those to EventManager. Those events (TeleportStart and TeleportFail) are nice to have anyway.

This commit is contained in:
Diva Canto
2012-04-06 20:34:31 -07:00
parent 6a9f36788d
commit 9637e50956
4 changed files with 208 additions and 150 deletions

View File

@@ -502,6 +502,12 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void PrimsLoaded(Scene s);
public event PrimsLoaded OnPrimsLoaded;
public delegate void TeleportStart(IClientAPI client, GridRegion destination, GridRegion finalDestination, uint teleportFlags, bool gridLogout);
public event TeleportStart OnTeleportStart;
public delegate void TeleportFail(IClientAPI client, bool gridLogout);
public event TeleportFail OnTeleportFail;
public class MoneyTransferArgs : EventArgs
{
public UUID sender;
@@ -2463,5 +2469,48 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
public void TriggerTeleportStart(IClientAPI client, GridRegion destination, GridRegion finalDestination, uint teleportFlags, bool gridLogout)
{
TeleportStart handler = OnTeleportStart;
if (handler != null)
{
foreach (TeleportStart d in handler.GetInvocationList())
{
try
{
d(client, destination, finalDestination, teleportFlags, gridLogout);
}
catch (Exception e)
{
m_log.ErrorFormat("[EVENT MANAGER]: Delegate for TeleportStart failed - continuing {0} - {1}",
e.Message, e.StackTrace);
}
}
}
}
public void TriggerTeleportFail(IClientAPI client, bool gridLogout)
{
TeleportFail handler = OnTeleportFail;
if (handler != null)
{
foreach (TeleportFail d in handler.GetInvocationList())
{
try
{
d(client, gridLogout);
}
catch (Exception e)
{
m_log.ErrorFormat("[EVENT MANAGER]: Delegate for TeleportFail failed - continuing {0} - {1}",
e.Message, e.StackTrace);
}
}
}
}
}
}