mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user