From 9637e509567efe512d4b29ea925c10011cdbe99e Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 6 Apr 2012 20:34:31 -0700 Subject: 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. --- OpenSim/Region/Framework/Scenes/EventManager.cs | 49 +++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index fe3438e..b3debb0 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -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); + } + } + } + } + } } -- cgit v1.1