2007-10-15 07:10:21 +00:00
/ *
2008-03-18 05:16:43 +00:00
* Copyright ( c ) Contributors , http : //opensimulator.org/
* See CONTRIBUTORS . TXT for a full list of copyright holders .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
* * Redistributions of source code must retain the above copyright
* notice , this list of conditions and the following disclaimer .
* * Redistributions in binary form must reproduce the above copyright
* notice , this list of conditions and the following disclaimer in the
* documentation and / or other materials provided with the distribution .
2009-06-01 06:37:14 +00:00
* * Neither the name of the OpenSimulator Project nor the
2008-03-18 05:16:43 +00:00
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission .
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ` ` AS IS ' ' AND ANY
* EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT LIMITED TO , THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED . IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES
* ( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ;
* LOSS OF USE , DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT
* ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE .
* /
2007-10-15 07:10:21 +00:00
2008-01-01 06:12:04 +00:00
using System ;
2009-02-12 09:53:12 +00:00
using System.Collections.Generic ;
2010-02-03 19:04:31 +00:00
using System.Reflection ;
using log4net ;
2008-09-06 07:52:41 +00:00
using OpenMetaverse ;
2007-10-29 21:46:25 +00:00
using OpenSim.Framework ;
2008-11-08 17:46:10 +00:00
using OpenSim.Framework.Client ;
2009-02-06 16:55:34 +00:00
using OpenSim.Region.Framework.Interfaces ;
2010-02-03 19:04:31 +00:00
using Caps = OpenSim . Framework . Capabilities . Caps ;
2009-09-27 17:14:10 +00:00
using GridRegion = OpenSim . Services . Interfaces . GridRegion ;
2007-07-16 15:40:11 +00:00
2009-02-06 16:55:34 +00:00
namespace OpenSim.Region.Framework.Scenes
2007-07-16 15:40:11 +00:00
{
/// <summary>
/// A class for triggering remote scene events.
/// </summary>
public class EventManager
{
2010-02-03 19:04:31 +00:00
private static readonly ILog m_log = LogManager . GetLogger ( MethodBase . GetCurrentMethod ( ) . DeclaringType ) ;
2008-05-01 18:04:42 +00:00
public delegate void OnFrameDelegate ( ) ;
2008-05-01 16:35:00 +00:00
2008-05-01 18:04:42 +00:00
public event OnFrameDelegate OnFrame ;
2007-07-16 15:40:11 +00:00
2007-12-20 03:24:34 +00:00
public delegate void ClientMovement ( ScenePresence client ) ;
2008-05-01 18:04:42 +00:00
public event ClientMovement OnClientMovement ;
2007-09-19 00:30:55 +00:00
2008-05-01 18:04:42 +00:00
public delegate void OnTerrainTickDelegate ( ) ;
2007-07-16 15:40:11 +00:00
2008-05-01 18:04:42 +00:00
public event OnTerrainTickDelegate OnTerrainTick ;
2007-09-19 00:30:55 +00:00
2010-09-12 21:20:26 +00:00
public delegate void OnBackupDelegate ( ISimulationDataService datastore , bool forceBackup ) ;
2007-07-16 15:40:11 +00:00
2008-05-01 18:04:42 +00:00
public event OnBackupDelegate OnBackup ;
2007-09-19 00:30:55 +00:00
2008-11-08 17:46:10 +00:00
public delegate void OnClientConnectCoreDelegate ( IClientCore client ) ;
public event OnClientConnectCoreDelegate OnClientConnect ;
2008-05-01 16:35:00 +00:00
public delegate void OnNewClientDelegate ( IClientAPI client ) ;
2010-02-28 20:07:38 +00:00
2008-11-08 17:46:10 +00:00
/// <summary>
2009-08-14 08:16:41 +00:00
/// Deprecated in favour of OnClientConnect.
2008-11-08 17:46:10 +00:00
/// Will be marked Obsolete after IClientCore has 100% of IClientAPI interfaces.
/// </summary>
2008-05-01 18:04:42 +00:00
public event OnNewClientDelegate OnNewClient ;
2008-05-01 16:35:00 +00:00
2011-11-15 15:57:53 +00:00
/// <summary>
/// Fired if the client entering this sim is doing so as a new login
/// </summary>
public event Action < IClientAPI > OnClientLogin ;
2010-02-28 20:07:38 +00:00
2008-05-01 18:04:42 +00:00
public delegate void OnNewPresenceDelegate ( ScenePresence presence ) ;
2007-07-16 15:40:11 +00:00
2008-05-01 18:04:42 +00:00
public event OnNewPresenceDelegate OnNewPresence ;
2007-09-19 00:30:55 +00:00
2008-09-06 07:52:41 +00:00
public delegate void OnRemovePresenceDelegate ( UUID agentId ) ;
2007-07-16 15:40:11 +00:00
2008-05-01 18:04:42 +00:00
public event OnRemovePresenceDelegate OnRemovePresence ;
2008-05-01 16:35:00 +00:00
2008-05-01 18:04:42 +00:00
public delegate void OnParcelPrimCountUpdateDelegate ( ) ;
2008-05-01 16:35:00 +00:00
2008-05-01 18:04:42 +00:00
public event OnParcelPrimCountUpdateDelegate OnParcelPrimCountUpdate ;
2008-05-01 16:35:00 +00:00
2008-05-01 18:04:42 +00:00
public delegate void OnParcelPrimCountAddDelegate ( SceneObjectGroup obj ) ;
2008-05-01 16:35:00 +00:00
2008-05-01 18:04:42 +00:00
public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd ;
2008-05-01 16:35:00 +00:00
2008-05-01 18:04:42 +00:00
public delegate void OnPluginConsoleDelegate ( string [ ] args ) ;
2008-05-01 16:35:00 +00:00
2008-05-01 18:04:42 +00:00
public event OnPluginConsoleDelegate OnPluginConsole ;
2008-05-01 16:35:00 +00:00
2011-11-17 21:03:08 +00:00
/// <summary>
/// Triggered when the entire simulator is shutdown.
/// </summary>
public event Action OnShutdown ;
2010-02-02 18:19:15 +00:00
2009-06-19 12:21:20 +00:00
public delegate void ObjectDeGrabDelegate ( uint localID , uint originalID , IClientAPI remoteClient , SurfaceTouchEventArgs surfaceArgs ) ;
2008-09-06 07:52:41 +00:00
public delegate void ScriptResetDelegate ( uint localID , UUID itemID ) ;
2008-05-01 16:35:00 +00:00
2008-09-06 07:52:41 +00:00
public delegate void OnPermissionErrorDelegate ( UUID user , string reason ) ;
2007-09-19 00:30:55 +00:00
2008-11-22 23:38:25 +00:00
public delegate void OnSetRootAgentSceneDelegate ( UUID agentID , Scene scene ) ;
2008-11-22 22:56:00 +00:00
public event OnSetRootAgentSceneDelegate OnSetRootAgentScene ;
2010-09-06 01:59:48 +00:00
public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest ;
2011-11-17 21:03:08 +00:00
/// <summary>
/// Triggered when an individual scene is shutdown.
/// </summary>
/// <remarks>
/// This does not automatically mean that the entire simulator is shutting down. Listen to OnShutdown for that
/// notification.
/// </remarks>
public event Action < Scene > OnSceneShuttingDown ;
2011-05-23 22:53:28 +00:00
2010-02-02 18:19:15 +00:00
/// <summary>
2010-03-04 20:08:25 +00:00
/// Fired when an object is touched/grabbed.
2010-02-02 18:19:15 +00:00
/// </summary>
/// The originalID is the local ID of the part that was actually touched. The localID itself is always that of
2010-03-10 04:15:36 +00:00
/// the root part.
2007-08-13 20:11:35 +00:00
public event ObjectGrabDelegate OnObjectGrab ;
2010-03-10 04:15:36 +00:00
public delegate void ObjectGrabDelegate ( uint localID , uint originalID , Vector3 offsetPos , IClientAPI remoteClient , SurfaceTouchEventArgs surfaceArgs ) ;
2010-02-02 18:19:15 +00:00
2010-01-29 23:12:08 +00:00
public event ObjectGrabDelegate OnObjectGrabbing ;
2008-04-27 22:15:38 +00:00
public event ObjectDeGrabDelegate OnObjectDeGrab ;
2008-05-26 16:16:48 +00:00
public event ScriptResetDelegate OnScriptReset ;
2007-12-20 02:36:27 +00:00
2010-03-10 04:15:36 +00:00
public event OnPermissionErrorDelegate OnPermissionError ;
2007-08-15 14:10:26 +00:00
2010-03-04 20:08:25 +00:00
/// <summary>
2012-03-07 00:04:24 +00:00
/// Fired when a script is run.
2010-03-04 20:08:25 +00:00
/// </summary>
2012-03-07 00:04:24 +00:00
/// <remarks>
/// Occurs after OnNewScript.
/// </remarks>
2007-08-21 21:03:18 +00:00
public event NewRezScript OnRezScript ;
2010-03-04 20:08:25 +00:00
public delegate void NewRezScript ( uint localID , UUID itemID , string script , int startParam , bool postOnRez , string engine , int stateSource ) ;
2007-08-21 21:03:18 +00:00
2008-09-06 07:52:41 +00:00
public delegate void RemoveScript ( uint localID , UUID itemID ) ;
2007-08-22 18:36:47 +00:00
public event RemoveScript OnRemoveScript ;
2007-08-15 14:10:26 +00:00
2008-09-06 07:52:41 +00:00
public delegate void StartScript ( uint localID , UUID itemID ) ;
2008-06-28 16:08:12 +00:00
public event StartScript OnStartScript ;
2008-09-06 07:52:41 +00:00
public delegate void StopScript ( uint localID , UUID itemID ) ;
2008-06-28 16:08:12 +00:00
public event StopScript OnStopScript ;
2008-09-06 07:52:41 +00:00
public delegate bool SceneGroupMoved ( UUID groupID , Vector3 delta ) ;
2007-10-12 15:26:19 +00:00
public event SceneGroupMoved OnSceneGroupMove ;
2008-09-06 07:52:41 +00:00
public delegate void SceneGroupGrabed ( UUID groupID , Vector3 offset , UUID userID ) ;
2007-10-12 15:26:19 +00:00
public event SceneGroupGrabed OnSceneGroupGrab ;
2009-04-10 06:39:52 +00:00
public delegate bool SceneGroupSpinStarted ( UUID groupID ) ;
public event SceneGroupSpinStarted OnSceneGroupSpinStart ;
public delegate bool SceneGroupSpun ( UUID groupID , Quaternion rotation ) ;
public event SceneGroupSpun OnSceneGroupSpin ;
2008-05-01 18:04:42 +00:00
public delegate void LandObjectAdded ( ILandObject newParcel ) ;
2007-12-20 02:36:27 +00:00
public event LandObjectAdded OnLandObjectAdded ;
2007-12-27 21:41:48 +00:00
2008-09-06 07:52:41 +00:00
public delegate void LandObjectRemoved ( UUID globalID ) ;
2007-12-20 02:36:27 +00:00
public event LandObjectRemoved OnLandObjectRemoved ;
2008-09-06 07:52:41 +00:00
public delegate void AvatarEnteringNewParcel ( ScenePresence avatar , int localLandID , UUID regionID ) ;
2007-12-20 02:36:27 +00:00
public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel ;
2012-02-17 21:43:14 +00:00
public delegate void AvatarAppearanceChange ( ScenePresence avatar ) ;
public event AvatarAppearanceChange OnAvatarAppearanceChange ;
2011-08-03 03:19:19 +00:00
public event Action < ScenePresence > OnSignificantClientMovement ;
2008-05-09 17:40:39 +00:00
2008-11-16 00:47:21 +00:00
public delegate void IncomingInstantMessage ( GridInstantMessage message ) ;
public event IncomingInstantMessage OnIncomingInstantMessage ;
public event IncomingInstantMessage OnUnhandledInstantMessage ;
2008-01-01 06:12:04 +00:00
2009-06-19 20:46:17 +00:00
public delegate void ClientClosed ( UUID clientID , Scene scene ) ;
2008-05-01 18:04:42 +00:00
2010-03-10 04:15:36 +00:00
public event ClientClosed OnClientClosed ;
2008-05-01 18:04:42 +00:00
2012-02-17 17:12:41 +00:00
public delegate void NewScript ( UUID clientID , SceneObjectPart part , UUID itemID ) ;
2012-03-07 00:04:24 +00:00
/// <summary>
/// Fired when a script is created.
/// </summary>
/// <remarks>
/// Occurs before OnRezScript
/// </remarks>
2012-02-17 17:12:41 +00:00
public event NewScript OnNewScript ;
2012-03-07 00:04:24 +00:00
2012-02-17 17:12:41 +00:00
public virtual void TriggerNewScript ( UUID clientID , SceneObjectPart part , UUID itemID )
{
NewScript handlerNewScript = OnNewScript ;
if ( handlerNewScript ! = null )
{
foreach ( NewScript d in handlerNewScript . GetInvocationList ( ) )
{
try
{
d ( clientID , part , itemID ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerNewScript failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
}
public delegate void UpdateScript ( UUID clientID , UUID itemId , UUID primId , bool isScriptRunning , UUID newAssetID ) ;
2012-03-07 00:04:24 +00:00
/// <summary>
/// An indication that the script has changed.
/// </summary>
/// <remarks>
/// Triggered after the scene receives a client's upload of an updated script and has stored it in an asset.
/// </remarks>
2012-02-17 17:12:41 +00:00
public event UpdateScript OnUpdateScript ;
2012-03-07 00:04:24 +00:00
2012-02-17 17:12:41 +00:00
public virtual void TriggerUpdateScript ( UUID clientId , UUID itemId , UUID primId , bool isScriptRunning , UUID newAssetID )
{
UpdateScript handlerUpdateScript = OnUpdateScript ;
if ( handlerUpdateScript ! = null )
{
foreach ( UpdateScript d in handlerUpdateScript . GetInvocationList ( ) )
{
try
{
d ( clientId , itemId , primId , isScriptRunning , newAssetID ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerUpdateScript failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
}
2010-03-04 20:08:25 +00:00
/// <summary>
2012-02-17 17:12:41 +00:00
/// ScriptChangedEvent is fired when a scene object property that a script might be interested
/// in (such as color, scale or inventory) changes. Only enough information sent is for the LSL changed event.
/// This is not an indication that the script has changed (see OnUpdateScript for that).
/// This event is sent to a script to tell it that some property changed on
/// the object the script is in. See http://lslwiki.net/lslwiki/wakka.php?wakka=changed .
2010-03-04 20:08:25 +00:00
/// </summary>
2008-01-17 02:23:48 +00:00
public event ScriptChangedEvent OnScriptChangedEvent ;
2010-03-04 20:08:25 +00:00
public delegate void ScriptChangedEvent ( uint localID , uint change ) ;
2008-01-01 06:12:04 +00:00
2010-07-11 12:09:11 +00:00
public delegate void ScriptControlEvent ( UUID item , UUID avatarID , uint held , uint changed ) ;
2008-05-07 19:41:03 +00:00
public event ScriptControlEvent OnScriptControlEvent ;
2008-09-06 07:52:41 +00:00
public delegate void ScriptAtTargetEvent ( uint localID , uint handle , Vector3 targetpos , Vector3 atpos ) ;
2008-04-25 01:00:55 +00:00
public event ScriptAtTargetEvent OnScriptAtTargetEvent ;
2008-05-01 18:04:42 +00:00
public delegate void ScriptNotAtTargetEvent ( uint localID ) ;
2010-01-11 02:04:05 +00:00
public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent ;
public delegate void ScriptAtRotTargetEvent ( uint localID , uint handle , Quaternion targetrot , Quaternion atrot ) ;
public event ScriptAtRotTargetEvent OnScriptAtRotTargetEvent ;
public delegate void ScriptNotAtRotTargetEvent ( uint localID ) ;
2010-01-11 02:20:00 +00:00
public event ScriptNotAtRotTargetEvent OnScriptNotAtRotTargetEvent ;
2008-04-25 01:00:55 +00:00
2008-06-05 13:24:59 +00:00
public delegate void ScriptColliding ( uint localID , ColliderArgs colliders ) ;
public event ScriptColliding OnScriptColliderStart ;
public event ScriptColliding OnScriptColliding ;
public event ScriptColliding OnScriptCollidingEnd ;
2010-01-10 20:28:53 +00:00
public event ScriptColliding OnScriptLandColliderStart ;
public event ScriptColliding OnScriptLandColliding ;
public event ScriptColliding OnScriptLandColliderEnd ;
2008-05-23 16:07:47 +00:00
public delegate void OnMakeChildAgentDelegate ( ScenePresence presence ) ;
public event OnMakeChildAgentDelegate OnMakeChildAgent ;
2010-03-31 03:20:20 +00:00
public delegate void OnSaveNewWindlightProfileDelegate ( ) ;
public delegate void OnSendNewWindlightProfileTargetedDelegate ( RegionLightShareData wl , UUID user ) ;
2011-11-15 20:26:42 +00:00
/// <summary>
/// This event is on the critical path for transferring an avatar from one region to another. Try and do
/// as little work on this event as possible, or do work asynchronously.
/// </summary>
public event Action < ScenePresence > OnMakeRootAgent ;
2010-03-31 03:20:20 +00:00
public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted ;
public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile ;
2008-02-28 05:20:23 +00:00
2010-02-08 19:02:20 +00:00
/// <summary>
/// Triggered when an object or attachment enters a scene
/// </summary>
public event OnIncomingSceneObjectDelegate OnIncomingSceneObject ;
2010-02-15 10:15:03 +00:00
public delegate void OnIncomingSceneObjectDelegate ( SceneObjectGroup so ) ;
2010-02-08 19:02:20 +00:00
2008-09-06 07:52:41 +00:00
public delegate void NewInventoryItemUploadComplete ( UUID avatarID , UUID assetID , string name , int userlevel ) ;
2008-05-01 18:04:42 +00:00
2008-04-10 09:36:55 +00:00
public event NewInventoryItemUploadComplete OnNewInventoryItemUploadComplete ;
2008-05-03 17:11:21 +00:00
public delegate void RequestChangeWaterHeight ( float height ) ;
public event RequestChangeWaterHeight OnRequestChangeWaterHeight ;
2010-02-03 19:27:44 +00:00
/// <summary>
/// Fired if any avatar is 'killed' due to its health falling to zero
/// </summary>
2008-05-03 15:39:40 +00:00
public event AvatarKillData OnAvatarKilled ;
2010-02-03 19:27:44 +00:00
public delegate void AvatarKillData ( uint KillerLocalID , ScenePresence avatar ) ;
2008-05-03 15:39:40 +00:00
2010-02-03 19:04:31 +00:00
// public delegate void ScriptTimerEvent(uint localID, double timerinterval);
2008-05-25 20:50:45 +00:00
2010-02-03 19:04:31 +00:00
// public event ScriptTimerEvent OnScriptTimerEvent;
2008-05-23 15:12:15 +00:00
2009-03-13 23:45:02 +00:00
public delegate void EstateToolsSunUpdate ( ulong regionHandle , bool FixedTime , bool EstateSun , float LindenHour ) ;
2008-09-25 05:13:44 +00:00
public delegate void GetScriptRunning ( IClientAPI controllingClient , UUID objectID , UUID itemID ) ;
2009-03-13 23:45:02 +00:00
public event EstateToolsSunUpdate OnEstateToolsSunUpdate ;
2011-03-23 21:50:56 +00:00
/// <summary>
/// Triggered when an object is added to the scene.
/// </summary>
public event Action < SceneObjectGroup > OnObjectAddedToScene ;
2008-05-23 15:12:15 +00:00
2011-03-23 21:50:56 +00:00
/// <summary>
/// Triggered when an object is removed from the scene.
/// </summary>
2008-05-23 15:12:15 +00:00
public delegate void ObjectBeingRemovedFromScene ( SceneObjectGroup obj ) ;
public event ObjectBeingRemovedFromScene OnObjectBeingRemovedFromScene ;
public delegate void NoticeNoLandDataFromStorage ( ) ;
public event NoticeNoLandDataFromStorage OnNoticeNoLandDataFromStorage ;
public delegate void IncomingLandDataFromStorage ( List < LandData > data ) ;
public event IncomingLandDataFromStorage OnIncomingLandDataFromStorage ;
public delegate void SetAllowForcefulBan ( bool allow ) ;
public event SetAllowForcefulBan OnSetAllowForcefulBan ;
public delegate void RequestParcelPrimCountUpdate ( ) ;
public event RequestParcelPrimCountUpdate OnRequestParcelPrimCountUpdate ;
public delegate void ParcelPrimCountTainted ( ) ;
public event ParcelPrimCountTainted OnParcelPrimCountTainted ;
2008-09-25 05:13:44 +00:00
public event GetScriptRunning OnGetScriptRunning ;
2008-05-23 15:12:15 +00:00
2008-05-01 18:04:42 +00:00
/// <summary>
/// RegisterCapsEvent is called by Scene after the Caps object
/// has been instantiated and before it is return to the
/// client and provides region modules to add their caps.
/// </summary>
2008-09-06 07:52:41 +00:00
public delegate void RegisterCapsEvent ( UUID agentID , Caps caps ) ;
2008-04-03 15:44:20 +00:00
public event RegisterCapsEvent OnRegisterCaps ;
2008-12-12 18:48:29 +00:00
2008-05-01 18:04:42 +00:00
/// <summary>
/// DeregisterCapsEvent is called by Scene when the caps
/// handler for an agent are removed.
/// </summary>
2008-09-06 07:52:41 +00:00
public delegate void DeregisterCapsEvent ( UUID agentID , Caps caps ) ;
2008-05-01 16:35:00 +00:00
public event DeregisterCapsEvent OnDeregisterCaps ;
2008-12-12 18:48:29 +00:00
2008-05-23 10:24:26 +00:00
/// <summary>
/// ChatFromWorldEvent is called via Scene when a chat message
2008-10-03 14:53:11 +00:00
/// from world comes in.
2008-05-23 10:24:26 +00:00
/// </summary>
2008-07-25 10:05:50 +00:00
public delegate void ChatFromWorldEvent ( Object sender , OSChatMessage chat ) ;
2008-05-23 10:24:26 +00:00
public event ChatFromWorldEvent OnChatFromWorld ;
2008-12-12 18:48:29 +00:00
2008-05-26 11:56:04 +00:00
/// <summary>
2008-10-03 14:53:11 +00:00
/// ChatFromClientEvent is triggered via ChatModule (or
/// substitutes thereof) when a chat message
/// from the client comes in.
/// </summary>
public delegate void ChatFromClientEvent ( Object sender , OSChatMessage chat ) ;
public event ChatFromClientEvent OnChatFromClient ;
2008-12-12 18:48:29 +00:00
2010-10-21 21:04:31 +00:00
/// <summary>
/// ChatToClientsEvent is triggered via ChatModule (or
/// substitutes thereof) when a chat message is actually sent to clients. Clients will only be sent a
/// received chat message if they satisfy various conditions (within audible range, etc.)
2010-10-27 04:01:03 +00:00
/// </summary>
2010-10-21 21:04:31 +00:00
public delegate void ChatToClientsEvent (
UUID senderID , HashSet < UUID > receiverIDs ,
string message , ChatTypeEnum type , Vector3 fromPos , string fromName ,
ChatSourceType src , ChatAudibleLevel level ) ;
public event ChatToClientsEvent OnChatToClients ;
2008-10-03 14:53:11 +00:00
/// <summary>
2008-05-26 11:56:04 +00:00
/// ChatBroadcastEvent is called via Scene when a broadcast chat message
2008-10-03 14:53:11 +00:00
/// from world comes in
2008-05-26 11:56:04 +00:00
/// </summary>
2008-07-25 10:05:50 +00:00
public delegate void ChatBroadcastEvent ( Object sender , OSChatMessage chat ) ;
2008-05-26 11:56:04 +00:00
public event ChatBroadcastEvent OnChatBroadcast ;
2008-02-04 10:39:30 +00:00
2008-06-02 10:01:02 +00:00
public delegate float SunLindenHour ( ) ;
2009-03-13 23:45:02 +00:00
public event SunLindenHour OnGetCurrentTimeAsLindenSunHour ;
2008-06-02 10:01:02 +00:00
2009-01-28 09:22:12 +00:00
/// <summary>
/// Called when oar file has finished loading, although
/// the scripts may not have started yet
/// Message is non empty string if there were problems loading the oar file
/// </summary>
2009-04-15 19:12:37 +00:00
public delegate void OarFileLoaded ( Guid guid , string message ) ;
2009-01-28 09:22:12 +00:00
public event OarFileLoaded OnOarFileLoaded ;
2009-02-02 20:59:12 +00:00
/// <summary>
/// Called when an oar file has finished saving
/// Message is non empty string if there were problems saving the oar file
2009-04-15 19:12:37 +00:00
/// If a guid was supplied on the original call to identify, the request, this is returned. Otherwise
/// Guid.Empty is returned.
2009-02-02 20:59:12 +00:00
/// </summary>
2009-04-15 19:12:37 +00:00
public delegate void OarFileSaved ( Guid guid , string message ) ;
2009-09-30 16:00:09 +00:00
public event OarFileSaved OnOarFileSaved ;
2009-01-28 09:22:12 +00:00
/// <summary>
/// Called when the script compile queue becomes empty
/// Returns the number of scripts which failed to start
/// </summary>
public delegate void EmptyScriptCompileQueue ( int numScriptsFailed , string message ) ;
public event EmptyScriptCompileQueue OnEmptyScriptCompileQueue ;
2009-08-04 01:43:08 +00:00
/// <summary>
2010-02-01 20:15:36 +00:00
/// Called whenever an object is attached, or detached from an in-world presence.
2009-08-04 01:43:08 +00:00
/// </summary>
2010-02-01 20:15:36 +00:00
/// If the object is being attached, then the avatarID will be present. If the object is being detached then
/// the avatarID is UUID.Zero (I know, this doesn't make much sense but now it's historical).
2009-08-04 01:43:08 +00:00
public delegate void Attach ( uint localID , UUID itemID , UUID avatarID ) ;
2010-09-12 17:43:49 +00:00
public event Attach OnAttach ;
2010-07-26 19:13:26 +00:00
2011-03-23 21:50:56 +00:00
2010-07-26 19:13:26 +00:00
/// <summary>
/// Called immediately after an object is loaded from storage.
/// </summary>
public event SceneObjectDelegate OnSceneObjectLoaded ;
2010-07-26 19:36:28 +00:00
public delegate void SceneObjectDelegate ( SceneObjectGroup so ) ;
/// <summary>
/// Called immediately before an object is saved to storage.
/// </summary>
/// <param name="persistingSo">
2010-09-12 17:43:49 +00:00
/// The scene object being persisted.
2010-07-26 19:36:28 +00:00
/// This is actually a copy of the original scene object so changes made here will be saved to storage but will not be kept in memory.
/// </param>
/// <param name="originalSo">
/// The original scene object being persisted. Changes here will stay in memory but will not be saved to storage on this save.
/// </param>
public event SceneObjectPreSaveDelegate OnSceneObjectPreSave ;
public delegate void SceneObjectPreSaveDelegate ( SceneObjectGroup persistingSo , SceneObjectGroup originalSo ) ;
2010-07-28 18:23:30 +00:00
/// <summary>
/// Called when a scene object part is cloned within the region.
/// </summary>
2010-07-28 18:38:20 +00:00
/// <param name="copy"></param>
/// <param name="original"></param>
/// <param name="userExposed">True if the duplicate will immediately be in the scene, false otherwise</param>
2010-07-28 18:23:30 +00:00
public event SceneObjectPartCopyDelegate OnSceneObjectPartCopy ;
2010-07-28 18:38:20 +00:00
public delegate void SceneObjectPartCopyDelegate ( SceneObjectPart copy , SceneObjectPart original , bool userExposed ) ;
2009-08-04 01:43:08 +00:00
2012-01-19 11:06:35 +00:00
public delegate void SceneObjectPartUpdated ( SceneObjectPart sop ) ;
public event SceneObjectPartUpdated OnSceneObjectPartUpdated ;
2009-09-27 17:14:10 +00:00
public delegate void RegionUp ( GridRegion region ) ;
2010-09-12 17:43:49 +00:00
public event RegionUp OnRegionUp ;
2009-09-27 17:14:10 +00:00
2012-01-04 20:01:18 +00:00
public delegate void RegionStarted ( Scene scene ) ;
public event RegionStarted OnRegionStarted ;
2012-02-02 00:27:20 +00:00
public delegate void RegionHeartbeatEnd ( Scene scene ) ;
public event RegionHeartbeatEnd OnRegionHeartbeatEnd ;
2011-05-28 15:11:01 +00:00
public delegate void LoginsEnabled ( string regionName ) ;
2012-03-19 22:48:26 +00:00
/// <summary>
/// This should only fire in all circumstances if the RegionReady module is active.
/// </summary>
/// <remarks>
/// TODO: Fire this even when the RegionReady module is not active.
/// </remarks>
2011-05-28 15:11:01 +00:00
public event LoginsEnabled OnLoginsEnabled ;
2011-06-08 22:18:14 +00:00
public delegate void PrimsLoaded ( Scene s ) ;
public event PrimsLoaded OnPrimsLoaded ;
2008-05-16 01:22:11 +00:00
public class MoneyTransferArgs : EventArgs
2008-05-01 18:04:42 +00:00
{
2008-09-06 07:52:41 +00:00
public UUID sender ;
public UUID receiver ;
2008-05-01 18:04:42 +00:00
// Always false. The SL protocol sucks.
public bool authenticated = false ;
public int amount ;
public int transactiontype ;
public string description ;
2008-09-06 07:52:41 +00:00
public MoneyTransferArgs ( UUID asender , UUID areceiver , int aamount , int atransactiontype , string adescription )
2008-05-14 05:33:32 +00:00
{
2008-05-01 18:04:42 +00:00
sender = asender ;
receiver = areceiver ;
amount = aamount ;
transactiontype = atransactiontype ;
description = adescription ;
}
}
public class LandBuyArgs : EventArgs
{
2008-09-06 07:52:41 +00:00
public UUID agentId = UUID . Zero ;
2008-05-16 01:22:11 +00:00
2008-09-06 07:52:41 +00:00
public UUID groupId = UUID . Zero ;
2008-05-01 18:04:42 +00:00
2008-09-06 07:52:41 +00:00
public UUID parcelOwnerID = UUID . Zero ;
2008-05-01 18:04:42 +00:00
public bool final = false ;
public bool groupOwned = false ;
public bool removeContribution = false ;
public int parcelLocalID = 0 ;
public int parcelArea = 0 ;
public int parcelPrice = 0 ;
public bool authenticated = false ;
public bool landValidated = false ;
public bool economyValidated = false ;
public int transactionID = 0 ;
public int amountDebited = 0 ;
2008-09-06 07:52:41 +00:00
public LandBuyArgs ( UUID pagentId , UUID pgroupId , bool pfinal , bool pgroupOwned ,
2008-05-16 01:22:11 +00:00
bool premoveContribution , int pparcelLocalID , int pparcelArea , int pparcelPrice ,
2008-05-01 18:04:42 +00:00
bool pauthenticated )
{
agentId = pagentId ;
groupId = pgroupId ;
final = pfinal ;
groupOwned = pgroupOwned ;
removeContribution = premoveContribution ;
parcelLocalID = pparcelLocalID ;
parcelArea = pparcelArea ;
parcelPrice = pparcelPrice ;
authenticated = pauthenticated ;
}
}
public delegate void MoneyTransferEvent ( Object sender , MoneyTransferArgs e ) ;
public delegate void LandBuy ( Object sender , LandBuyArgs e ) ;
2008-04-14 17:13:38 +00:00
public event MoneyTransferEvent OnMoneyTransfer ;
public event LandBuy OnLandBuy ;
2008-04-17 19:42:54 +00:00
public event LandBuy OnValidateLandBuy ;
2008-02-22 19:08:24 +00:00
2009-08-04 01:43:08 +00:00
public void TriggerOnAttach ( uint localID , UUID itemID , UUID avatarID )
{
2010-02-03 19:04:31 +00:00
Attach handlerOnAttach = OnAttach ;
2009-08-04 01:43:08 +00:00
if ( handlerOnAttach ! = null )
2010-02-03 16:40:21 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( Attach d in handlerOnAttach . GetInvocationList ( ) )
2010-02-03 16:40:21 +00:00
{
try
{
d ( localID , itemID , avatarID ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
2010-02-03 19:04:31 +00:00
"[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}" ,
2010-02-03 16:40:21 +00:00
e . Message , e . StackTrace ) ;
}
}
}
2010-02-15 10:15:03 +00:00
}
2009-08-04 01:43:08 +00:00
2008-09-25 05:13:44 +00:00
public void TriggerGetScriptRunning ( IClientAPI controllingClient , UUID objectID , UUID itemID )
{
2010-02-03 19:04:31 +00:00
GetScriptRunning handlerGetScriptRunning = OnGetScriptRunning ;
2008-09-25 05:13:44 +00:00
if ( handlerGetScriptRunning ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( GetScriptRunning d in handlerGetScriptRunning . GetInvocationList ( ) )
{
try
{
d ( controllingClient , objectID , itemID ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerGetScriptRunning failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-09-25 05:13:44 +00:00
}
2008-01-17 02:23:48 +00:00
public void TriggerOnScriptChangedEvent ( uint localID , uint change )
{
2010-02-03 19:04:31 +00:00
ScriptChangedEvent handlerScriptChangedEvent = OnScriptChangedEvent ;
2008-03-02 22:28:48 +00:00
if ( handlerScriptChangedEvent ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( ScriptChangedEvent d in handlerScriptChangedEvent . GetInvocationList ( ) )
{
try
{
d ( localID , change ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnScriptChangedEvent failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-01-17 02:23:48 +00:00
}
2008-01-01 06:12:04 +00:00
2007-12-20 03:24:34 +00:00
public void TriggerOnClientMovement ( ScenePresence avatar )
{
2010-02-03 19:04:31 +00:00
ClientMovement handlerClientMovement = OnClientMovement ;
2008-03-02 22:28:48 +00:00
if ( handlerClientMovement ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( ClientMovement d in handlerClientMovement . GetInvocationList ( ) )
{
try
{
d ( avatar ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnClientMovement failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-12-20 03:24:34 +00:00
}
2008-09-06 07:52:41 +00:00
public void TriggerPermissionError ( UUID user , string reason )
2007-08-15 14:10:26 +00:00
{
2010-02-03 19:04:31 +00:00
OnPermissionErrorDelegate handlerPermissionError = OnPermissionError ;
2008-03-02 22:28:48 +00:00
if ( handlerPermissionError ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( OnPermissionErrorDelegate d in handlerPermissionError . GetInvocationList ( ) )
{
try
{
d ( user , reason ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerPermissionError failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-08-15 14:10:26 +00:00
}
2007-08-13 20:11:35 +00:00
2007-09-24 15:56:34 +00:00
public void TriggerOnPluginConsole ( string [ ] args )
2007-07-16 15:40:11 +00:00
{
2010-02-03 19:04:31 +00:00
OnPluginConsoleDelegate handlerPluginConsole = OnPluginConsole ;
2008-03-02 22:28:48 +00:00
if ( handlerPluginConsole ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( OnPluginConsoleDelegate d in handlerPluginConsole . GetInvocationList ( ) )
{
try
{
d ( args ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnPluginConsole failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-07-16 15:40:11 +00:00
}
public void TriggerOnFrame ( )
{
2010-02-03 19:04:31 +00:00
OnFrameDelegate handlerFrame = OnFrame ;
2008-03-02 22:28:48 +00:00
if ( handlerFrame ! = null )
2007-07-16 15:40:11 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( OnFrameDelegate d in handlerFrame . GetInvocationList ( ) )
{
try
{
d ( ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnFrame failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-07-16 15:40:11 +00:00
}
2007-08-28 14:21:17 +00:00
public void TriggerOnNewClient ( IClientAPI client )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
OnNewClientDelegate handlerNewClient = OnNewClient ;
2008-03-02 22:28:48 +00:00
if ( handlerNewClient ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( OnNewClientDelegate d in handlerNewClient . GetInvocationList ( ) )
{
try
{
d ( client ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnNewClient failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-11-08 17:46:10 +00:00
if ( client is IClientCore )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
OnClientConnectCoreDelegate handlerClientConnect = OnClientConnect ;
2009-03-12 20:38:28 +00:00
if ( handlerClientConnect ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( OnClientConnectCoreDelegate d in handlerClientConnect . GetInvocationList ( ) )
{
try
{
d ( ( IClientCore ) client ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnNewClient (IClientCore) failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-11-08 17:46:10 +00:00
}
2007-08-28 14:21:17 +00:00
}
2010-02-28 20:07:38 +00:00
public void TriggerOnClientLogin ( IClientAPI client )
{
2011-11-15 15:57:53 +00:00
Action < IClientAPI > handlerClientLogin = OnClientLogin ;
2010-02-28 20:07:38 +00:00
if ( handlerClientLogin ! = null )
{
2011-11-15 15:57:53 +00:00
foreach ( Action < IClientAPI > d in handlerClientLogin . GetInvocationList ( ) )
2010-02-28 20:07:38 +00:00
{
try
{
d ( client ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnClientLogin failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
}
2007-07-16 15:40:11 +00:00
public void TriggerOnNewPresence ( ScenePresence presence )
{
2010-02-03 19:04:31 +00:00
OnNewPresenceDelegate handlerNewPresence = OnNewPresence ;
2008-03-02 22:28:48 +00:00
if ( handlerNewPresence ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( OnNewPresenceDelegate d in handlerNewPresence . GetInvocationList ( ) )
{
try
{
d ( presence ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnNewPresence failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-07-16 15:40:11 +00:00
}
2008-09-06 07:52:41 +00:00
public void TriggerOnRemovePresence ( UUID agentId )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
OnRemovePresenceDelegate handlerRemovePresence = OnRemovePresence ;
2008-03-02 22:28:48 +00:00
if ( handlerRemovePresence ! = null )
2007-07-16 15:40:11 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( OnRemovePresenceDelegate d in handlerRemovePresence . GetInvocationList ( ) )
{
try
{
d ( agentId ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnRemovePresence failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-07-16 15:40:11 +00:00
}
2010-09-12 21:20:26 +00:00
public void TriggerOnBackup ( ISimulationDataService dstore , bool forced )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
OnBackupDelegate handlerOnAttach = OnBackup ;
if ( handlerOnAttach ! = null )
2007-07-16 15:40:11 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( OnBackupDelegate d in handlerOnAttach . GetInvocationList ( ) )
{
try
{
2010-09-06 22:00:24 +00:00
d ( dstore , forced ) ;
2010-02-03 19:04:31 +00:00
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnBackup failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-07-16 15:40:11 +00:00
}
public void TriggerParcelPrimCountUpdate ( )
{
2010-02-03 19:04:31 +00:00
OnParcelPrimCountUpdateDelegate handlerParcelPrimCountUpdate = OnParcelPrimCountUpdate ;
2008-03-02 20:29:59 +00:00
if ( handlerParcelPrimCountUpdate ! = null )
2007-07-16 15:40:11 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( OnParcelPrimCountUpdateDelegate d in handlerParcelPrimCountUpdate . GetInvocationList ( ) )
{
try
{
d ( ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerParcelPrimCountUpdate failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-02-04 10:39:30 +00:00
}
2010-02-03 19:04:31 +00:00
public void TriggerMoneyTransfer ( Object sender , MoneyTransferArgs args )
2008-02-04 10:39:30 +00:00
{
2010-02-03 19:04:31 +00:00
MoneyTransferEvent handlerMoneyTransfer = OnMoneyTransfer ;
2008-03-02 20:29:59 +00:00
if ( handlerMoneyTransfer ! = null )
2008-02-04 10:39:30 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( MoneyTransferEvent d in handlerMoneyTransfer . GetInvocationList ( ) )
{
try
{
d ( sender , args ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerMoneyTransfer failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-07-16 15:40:11 +00:00
}
2007-09-19 00:30:55 +00:00
2008-03-06 15:49:53 +00:00
public void TriggerTerrainTick ( )
{
2010-02-03 19:04:31 +00:00
OnTerrainTickDelegate handlerTerrainTick = OnTerrainTick ;
2008-03-06 15:49:53 +00:00
if ( handlerTerrainTick ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( OnTerrainTickDelegate d in handlerTerrainTick . GetInvocationList ( ) )
{
try
{
d ( ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerTerrainTick failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-03-06 15:49:53 +00:00
}
2008-02-04 10:39:30 +00:00
2007-08-09 17:54:22 +00:00
public void TriggerParcelPrimCountAdd ( SceneObjectGroup obj )
2007-07-16 15:40:11 +00:00
{
2010-02-03 19:04:31 +00:00
OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = OnParcelPrimCountAdd ;
2008-03-02 20:29:59 +00:00
if ( handlerParcelPrimCountAdd ! = null )
2007-07-16 15:40:11 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( OnParcelPrimCountAddDelegate d in handlerParcelPrimCountAdd . GetInvocationList ( ) )
{
try
{
d ( obj ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerParcelPrimCountAdd failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-07-16 15:40:11 +00:00
}
2007-07-19 00:52:10 +00:00
2011-03-23 21:50:56 +00:00
public void TriggerObjectAddedToScene ( SceneObjectGroup obj )
{
Action < SceneObjectGroup > handler = OnObjectAddedToScene ;
if ( handler ! = null )
{
foreach ( Action < SceneObjectGroup > d in handler . GetInvocationList ( ) )
{
try
{
d ( obj ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerObjectAddedToScene failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
}
2008-05-24 21:13:44 +00:00
public void TriggerObjectBeingRemovedFromScene ( SceneObjectGroup obj )
{
2010-02-03 19:04:31 +00:00
ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene ;
2008-05-24 21:13:44 +00:00
if ( handlerObjectBeingRemovedFromScene ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( ObjectBeingRemovedFromScene d in handlerObjectBeingRemovedFromScene . GetInvocationList ( ) )
{
try
{
d ( obj ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerObjectBeingRemovedFromScene failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-24 21:13:44 +00:00
}
2007-07-19 00:52:10 +00:00
public void TriggerShutdown ( )
2010-02-15 10:15:03 +00:00
{
2011-11-17 21:03:08 +00:00
Action handlerShutdown = OnShutdown ;
2008-03-02 20:29:59 +00:00
if ( handlerShutdown ! = null )
2010-02-03 19:04:31 +00:00
{
2011-11-17 21:03:08 +00:00
foreach ( Action d in handlerShutdown . GetInvocationList ( ) )
2010-02-03 19:04:31 +00:00
{
try
{
d ( ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerShutdown failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-07-19 00:52:10 +00:00
}
2007-08-13 20:11:35 +00:00
2008-12-05 16:48:47 +00:00
public void TriggerObjectGrab ( uint localID , uint originalID , Vector3 offsetPos , IClientAPI remoteClient , SurfaceTouchEventArgs surfaceArgs )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
ObjectGrabDelegate handlerObjectGrab = OnObjectGrab ;
2008-03-02 20:29:59 +00:00
if ( handlerObjectGrab ! = null )
2007-09-20 05:22:18 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( ObjectGrabDelegate d in handlerObjectGrab . GetInvocationList ( ) )
{
try
{
d ( localID , originalID , offsetPos , remoteClient , surfaceArgs ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerObjectGrab failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-08-13 20:11:35 +00:00
}
2007-08-21 21:03:18 +00:00
2010-01-29 23:12:08 +00:00
public void TriggerObjectGrabbing ( uint localID , uint originalID , Vector3 offsetPos , IClientAPI remoteClient , SurfaceTouchEventArgs surfaceArgs )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing ;
2010-01-29 23:12:08 +00:00
if ( handlerObjectGrabbing ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( ObjectGrabDelegate d in handlerObjectGrabbing . GetInvocationList ( ) )
{
try
{
d ( localID , originalID , offsetPos , remoteClient , surfaceArgs ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerObjectGrabbing failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2010-01-29 23:12:08 +00:00
}
2009-06-19 12:21:20 +00:00
public void TriggerObjectDeGrab ( uint localID , uint originalID , IClientAPI remoteClient , SurfaceTouchEventArgs surfaceArgs )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab ;
2008-04-27 22:15:38 +00:00
if ( handlerObjectDeGrab ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( ObjectDeGrabDelegate d in handlerObjectDeGrab . GetInvocationList ( ) )
{
try
{
d ( localID , originalID , remoteClient , surfaceArgs ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerObjectDeGrab failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-04-27 22:15:38 +00:00
}
2008-09-06 07:52:41 +00:00
public void TriggerScriptReset ( uint localID , UUID itemID )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
ScriptResetDelegate handlerScriptReset = OnScriptReset ;
2008-05-26 16:16:48 +00:00
if ( handlerScriptReset ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( ScriptResetDelegate d in handlerScriptReset . GetInvocationList ( ) )
{
try
{
d ( localID , itemID ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerScriptReset failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-26 16:16:48 +00:00
}
2008-11-09 19:30:40 +00:00
public void TriggerRezScript ( uint localID , UUID itemID , string script , int startParam , bool postOnRez , string engine , int stateSource )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
NewRezScript handlerRezScript = OnRezScript ;
2008-03-02 20:29:59 +00:00
if ( handlerRezScript ! = null )
2007-08-21 21:03:18 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( NewRezScript d in handlerRezScript . GetInvocationList ( ) )
{
try
{
d ( localID , itemID , script , startParam , postOnRez , engine , stateSource ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerRezScript failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-06-28 16:08:12 +00:00
}
2008-09-06 07:52:41 +00:00
public void TriggerStartScript ( uint localID , UUID itemID )
2008-06-28 16:08:12 +00:00
{
2010-02-03 19:04:31 +00:00
StartScript handlerStartScript = OnStartScript ;
2008-06-28 16:08:12 +00:00
if ( handlerStartScript ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( StartScript d in handlerStartScript . GetInvocationList ( ) )
{
try
{
d ( localID , itemID ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerStartScript failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-06-04 14:31:36 +00:00
}
2010-02-03 19:04:31 +00:00
public void TriggerStopScript ( uint localID , UUID itemID )
2007-08-22 18:36:47 +00:00
{
2010-02-03 19:04:31 +00:00
StopScript handlerStopScript = OnStopScript ;
if ( handlerStopScript ! = null )
{
foreach ( StopScript d in handlerStopScript . GetInvocationList ( ) )
{
try
{
d ( localID , itemID ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerStopScript failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2010-02-03 19:04:31 +00:00
}
public void TriggerRemoveScript ( uint localID , UUID itemID )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
RemoveScript handlerRemoveScript = OnRemoveScript ;
2008-03-02 20:29:59 +00:00
if ( handlerRemoveScript ! = null )
2007-08-22 18:36:47 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( RemoveScript d in handlerRemoveScript . GetInvocationList ( ) )
{
try
{
d ( localID , itemID ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-08-22 18:36:47 +00:00
}
2007-10-12 15:26:19 +00:00
2008-09-06 07:52:41 +00:00
public bool TriggerGroupMove ( UUID groupID , Vector3 delta )
2007-10-12 15:26:19 +00:00
{
2010-02-03 19:04:31 +00:00
bool result = true ;
SceneGroupMoved handlerSceneGroupMove = OnSceneGroupMove ;
2008-03-02 20:29:59 +00:00
if ( handlerSceneGroupMove ! = null )
2007-10-12 15:26:19 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( SceneGroupMoved d in handlerSceneGroupMove . GetInvocationList ( ) )
{
try
{
if ( d ( groupID , delta ) = = false )
result = false ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2007-10-12 15:26:19 +00:00
}
2010-02-03 19:04:31 +00:00
return result ;
2007-10-12 15:26:19 +00:00
}
2009-04-10 06:39:52 +00:00
public bool TriggerGroupSpinStart ( UUID groupID )
{
2010-02-03 19:04:31 +00:00
bool result = true ;
SceneGroupSpinStarted handlerSceneGroupSpinStarted = OnSceneGroupSpinStart ;
2009-04-10 06:39:52 +00:00
if ( handlerSceneGroupSpinStarted ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( SceneGroupSpinStarted d in handlerSceneGroupSpinStarted . GetInvocationList ( ) )
{
try
{
if ( d ( groupID ) = = false )
result = false ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerGroupSpinStart failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2009-04-10 06:39:52 +00:00
}
2010-02-03 19:04:31 +00:00
return result ;
2009-04-10 06:39:52 +00:00
}
public bool TriggerGroupSpin ( UUID groupID , Quaternion rotation )
{
2010-02-03 19:04:31 +00:00
bool result = true ;
SceneGroupSpun handlerSceneGroupSpin = OnSceneGroupSpin ;
2009-04-10 06:39:52 +00:00
if ( handlerSceneGroupSpin ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( SceneGroupSpun d in handlerSceneGroupSpin . GetInvocationList ( ) )
{
try
{
if ( d ( groupID , rotation ) = = false )
result = false ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerGroupSpin failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2009-04-10 06:39:52 +00:00
}
2010-02-03 19:04:31 +00:00
return result ;
2009-04-10 06:39:52 +00:00
}
2008-09-06 07:52:41 +00:00
public void TriggerGroupGrab ( UUID groupID , Vector3 offset , UUID userID )
2007-10-12 15:26:19 +00:00
{
2010-02-03 19:04:31 +00:00
SceneGroupGrabed handlerSceneGroupGrab = OnSceneGroupGrab ;
2008-03-02 20:29:59 +00:00
if ( handlerSceneGroupGrab ! = null )
2007-10-12 15:26:19 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( SceneGroupGrabed d in handlerSceneGroupGrab . GetInvocationList ( ) )
{
try
{
d ( groupID , offset , userID ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerGroupGrab failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-10-12 15:26:19 +00:00
}
2007-12-20 02:36:27 +00:00
2008-03-22 23:10:22 +00:00
public void TriggerLandObjectAdded ( ILandObject newParcel )
2007-12-20 02:36:27 +00:00
{
2010-02-03 19:04:31 +00:00
LandObjectAdded handlerLandObjectAdded = OnLandObjectAdded ;
2008-03-02 03:50:33 +00:00
if ( handlerLandObjectAdded ! = null )
2007-12-20 02:36:27 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( LandObjectAdded d in handlerLandObjectAdded . GetInvocationList ( ) )
{
try
{
d ( newParcel ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerLandObjectAdded failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-12-20 02:36:27 +00:00
}
2007-12-27 21:41:48 +00:00
2008-09-06 07:52:41 +00:00
public void TriggerLandObjectRemoved ( UUID globalID )
2007-12-20 02:36:27 +00:00
{
2010-02-03 19:04:31 +00:00
LandObjectRemoved handlerLandObjectRemoved = OnLandObjectRemoved ;
2008-03-02 03:50:33 +00:00
if ( handlerLandObjectRemoved ! = null )
2007-12-20 02:36:27 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( LandObjectRemoved d in handlerLandObjectRemoved . GetInvocationList ( ) )
{
try
{
d ( globalID ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerLandObjectRemoved failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-12-20 02:36:27 +00:00
}
2007-12-27 21:41:48 +00:00
2008-03-22 23:10:22 +00:00
public void TriggerLandObjectUpdated ( uint localParcelID , ILandObject newParcel )
2007-12-20 02:36:27 +00:00
{
2008-03-22 23:10:22 +00:00
TriggerLandObjectAdded ( newParcel ) ;
2007-12-20 02:36:27 +00:00
}
2008-09-06 07:52:41 +00:00
public void TriggerAvatarEnteringNewParcel ( ScenePresence avatar , int localLandID , UUID regionID )
2007-12-20 02:36:27 +00:00
{
2010-02-03 19:04:31 +00:00
AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel ;
2008-03-02 03:50:33 +00:00
if ( handlerAvatarEnteringNewParcel ! = null )
2007-12-20 02:36:27 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( AvatarEnteringNewParcel d in handlerAvatarEnteringNewParcel . GetInvocationList ( ) )
{
try
{
d ( avatar , localLandID , regionID ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerAvatarEnteringNewParcel failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2007-12-20 02:36:27 +00:00
}
2008-01-01 06:12:04 +00:00
2012-02-17 21:43:14 +00:00
public void TriggerAvatarAppearanceChanged ( ScenePresence avatar )
{
AvatarAppearanceChange handler = OnAvatarAppearanceChange ;
if ( handler ! = null )
{
foreach ( AvatarAppearanceChange d in handler . GetInvocationList ( ) )
{
try
{
d ( avatar ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
}
2008-11-16 00:47:21 +00:00
public void TriggerIncomingInstantMessage ( GridInstantMessage message )
{
2010-02-03 19:04:31 +00:00
IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage ;
2008-11-16 00:47:21 +00:00
if ( handlerIncomingInstantMessage ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( IncomingInstantMessage d in handlerIncomingInstantMessage . GetInvocationList ( ) )
{
try
{
d ( message ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerIncomingInstantMessage failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-11-16 00:47:21 +00:00
}
public void TriggerUnhandledInstantMessage ( GridInstantMessage message )
2008-01-01 06:12:04 +00:00
{
2010-02-03 19:04:31 +00:00
IncomingInstantMessage handlerUnhandledInstantMessage = OnUnhandledInstantMessage ;
2008-11-16 00:47:21 +00:00
if ( handlerUnhandledInstantMessage ! = null )
2008-01-01 06:12:04 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( IncomingInstantMessage d in handlerUnhandledInstantMessage . GetInvocationList ( ) )
{
try
{
d ( message ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-01-01 06:12:04 +00:00
}
2008-02-05 05:26:18 +00:00
2009-06-19 20:46:17 +00:00
public void TriggerClientClosed ( UUID ClientID , Scene scene )
2008-02-05 05:26:18 +00:00
{
2010-02-03 19:04:31 +00:00
ClientClosed handlerClientClosed = OnClientClosed ;
2008-03-02 03:50:33 +00:00
if ( handlerClientClosed ! = null )
2008-02-05 05:26:18 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( ClientClosed d in handlerClientClosed . GetInvocationList ( ) )
{
try
{
d ( ClientID , scene ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerClientClosed failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-02-05 05:26:18 +00:00
}
2008-02-28 05:20:23 +00:00
public void TriggerOnMakeChildAgent ( ScenePresence presence )
{
2010-02-03 19:04:31 +00:00
OnMakeChildAgentDelegate handlerMakeChildAgent = OnMakeChildAgent ;
2008-03-02 03:50:33 +00:00
if ( handlerMakeChildAgent ! = null )
2008-02-28 05:20:23 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( OnMakeChildAgentDelegate d in handlerMakeChildAgent . GetInvocationList ( ) )
{
try
{
d ( presence ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnMakeChildAgent failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-02-28 05:20:23 +00:00
}
2008-04-03 15:44:20 +00:00
2010-03-31 03:20:20 +00:00
public void TriggerOnSendNewWindlightProfileTargeted ( RegionLightShareData wl , UUID user )
{
OnSendNewWindlightProfileTargetedDelegate handlerSendNewWindlightProfileTargeted = OnSendNewWindlightProfileTargeted ;
if ( handlerSendNewWindlightProfileTargeted ! = null )
{
handlerSendNewWindlightProfileTargeted ( wl , user ) ;
}
}
public void TriggerOnSaveNewWindlightProfile ( )
{
OnSaveNewWindlightProfileDelegate handlerSaveNewWindlightProfile = OnSaveNewWindlightProfile ;
if ( handlerSaveNewWindlightProfile ! = null )
{
handlerSaveNewWindlightProfile ( ) ;
}
}
2008-05-23 16:07:47 +00:00
public void TriggerOnMakeRootAgent ( ScenePresence presence )
{
2011-11-15 20:26:42 +00:00
Action < ScenePresence > handlerMakeRootAgent = OnMakeRootAgent ;
2008-05-23 16:07:47 +00:00
if ( handlerMakeRootAgent ! = null )
{
2011-11-15 20:26:42 +00:00
foreach ( Action < ScenePresence > d in handlerMakeRootAgent . GetInvocationList ( ) )
2010-02-03 19:04:31 +00:00
{
try
{
d ( presence ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnMakeRootAgent failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-23 16:07:47 +00:00
}
2010-02-08 19:02:20 +00:00
public void TriggerOnIncomingSceneObject ( SceneObjectGroup so )
{
OnIncomingSceneObjectDelegate handlerIncomingSceneObject = OnIncomingSceneObject ;
if ( handlerIncomingSceneObject ! = null )
{
foreach ( OnIncomingSceneObjectDelegate d in handlerIncomingSceneObject . GetInvocationList ( ) )
{
try
{
d ( so ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnIncomingSceneObject failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
2010-02-15 10:15:03 +00:00
}
2010-02-08 19:02:20 +00:00
}
}
2008-09-06 07:52:41 +00:00
public void TriggerOnRegisterCaps ( UUID agentID , Caps caps )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
RegisterCapsEvent handlerRegisterCaps = OnRegisterCaps ;
2008-04-03 15:44:20 +00:00
if ( handlerRegisterCaps ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( RegisterCapsEvent d in handlerRegisterCaps . GetInvocationList ( ) )
{
try
{
d ( agentID , caps ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnRegisterCaps failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-04-03 15:44:20 +00:00
}
2008-09-06 07:52:41 +00:00
public void TriggerOnDeregisterCaps ( UUID agentID , Caps caps )
2008-04-03 15:44:20 +00:00
{
2010-02-03 19:04:31 +00:00
DeregisterCapsEvent handlerDeregisterCaps = OnDeregisterCaps ;
2008-04-03 15:44:20 +00:00
if ( handlerDeregisterCaps ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( DeregisterCapsEvent d in handlerDeregisterCaps . GetInvocationList ( ) )
{
try
{
d ( agentID , caps ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnDeregisterCaps failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-04-03 15:44:20 +00:00
}
2008-04-10 09:36:55 +00:00
2008-09-06 07:52:41 +00:00
public void TriggerOnNewInventoryItemUploadComplete ( UUID agentID , UUID AssetID , String AssetName , int userlevel )
2008-04-10 09:36:55 +00:00
{
2010-02-03 19:04:31 +00:00
NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete ;
2008-04-10 09:36:55 +00:00
if ( handlerNewInventoryItemUpdateComplete ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( NewInventoryItemUploadComplete d in handlerNewInventoryItemUpdateComplete . GetInvocationList ( ) )
{
try
{
d ( agentID , AssetID , AssetName , userlevel ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnNewInventoryItemUploadComplete failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-04-10 09:36:55 +00:00
}
2008-08-18 00:39:10 +00:00
2010-02-03 19:04:31 +00:00
public void TriggerLandBuy ( Object sender , LandBuyArgs args )
2008-04-14 17:13:38 +00:00
{
2010-02-03 19:04:31 +00:00
LandBuy handlerLandBuy = OnLandBuy ;
2008-04-14 17:13:38 +00:00
if ( handlerLandBuy ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( LandBuy d in handlerLandBuy . GetInvocationList ( ) )
{
try
{
d ( sender , args ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerLandBuy failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-04-14 17:13:38 +00:00
}
2008-08-18 00:39:10 +00:00
2010-02-03 19:04:31 +00:00
public void TriggerValidateLandBuy ( Object sender , LandBuyArgs args )
2008-04-14 17:13:38 +00:00
{
2010-02-03 19:04:31 +00:00
LandBuy handlerValidateLandBuy = OnValidateLandBuy ;
2008-04-17 19:42:54 +00:00
if ( handlerValidateLandBuy ! = null )
2008-04-14 17:13:38 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( LandBuy d in handlerValidateLandBuy . GetInvocationList ( ) )
{
try
{
d ( sender , args ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerValidateLandBuy failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-04-14 17:13:38 +00:00
}
2008-05-16 01:22:11 +00:00
2008-09-06 07:52:41 +00:00
public void TriggerAtTargetEvent ( uint localID , uint handle , Vector3 targetpos , Vector3 currentpos )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
ScriptAtTargetEvent handlerScriptAtTargetEvent = OnScriptAtTargetEvent ;
2008-04-25 01:00:55 +00:00
if ( handlerScriptAtTargetEvent ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( ScriptAtTargetEvent d in handlerScriptAtTargetEvent . GetInvocationList ( ) )
{
try
{
d ( localID , handle , targetpos , currentpos ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerAtTargetEvent failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-04-25 01:00:55 +00:00
}
public void TriggerNotAtTargetEvent ( uint localID )
{
2010-02-03 19:04:31 +00:00
ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = OnScriptNotAtTargetEvent ;
2008-04-25 01:00:55 +00:00
if ( handlerScriptNotAtTargetEvent ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( ScriptNotAtTargetEvent d in handlerScriptNotAtTargetEvent . GetInvocationList ( ) )
{
try
{
d ( localID ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerNotAtTargetEvent failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2010-01-11 02:04:05 +00:00
}
public void TriggerAtRotTargetEvent ( uint localID , uint handle , Quaternion targetrot , Quaternion currentrot )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent ;
2010-01-11 02:04:05 +00:00
if ( handlerScriptAtRotTargetEvent ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( ScriptAtRotTargetEvent d in handlerScriptAtRotTargetEvent . GetInvocationList ( ) )
{
try
{
d ( localID , handle , targetrot , currentrot ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerAtRotTargetEvent failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2010-01-11 02:04:05 +00:00
}
public void TriggerNotAtRotTargetEvent ( uint localID )
{
2010-02-03 19:04:31 +00:00
ScriptNotAtRotTargetEvent handlerScriptNotAtRotTargetEvent = OnScriptNotAtRotTargetEvent ;
2010-01-11 02:04:05 +00:00
if ( handlerScriptNotAtRotTargetEvent ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( ScriptNotAtRotTargetEvent d in handlerScriptNotAtRotTargetEvent . GetInvocationList ( ) )
{
try
{
d ( localID ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerNotAtRotTargetEvent failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-04-25 01:00:55 +00:00
}
2008-05-03 17:11:21 +00:00
public void TriggerRequestChangeWaterHeight ( float height )
{
2011-12-16 21:16:01 +00:00
if ( height < 0 )
{
// ignore negative water height
return ;
}
2010-02-03 19:04:31 +00:00
RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight ;
2008-05-03 17:11:21 +00:00
if ( handlerRequestChangeWaterHeight ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( RequestChangeWaterHeight d in handlerRequestChangeWaterHeight . GetInvocationList ( ) )
{
try
{
d ( height ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerRequestChangeWaterHeight failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-03 17:11:21 +00:00
}
2008-08-18 00:39:10 +00:00
2008-05-03 15:39:40 +00:00
public void TriggerAvatarKill ( uint KillerObjectLocalID , ScenePresence DeadAvatar )
{
2010-02-03 19:04:31 +00:00
AvatarKillData handlerAvatarKill = OnAvatarKilled ;
2008-05-03 15:39:40 +00:00
if ( handlerAvatarKill ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( AvatarKillData d in handlerAvatarKill . GetInvocationList ( ) )
{
try
{
d ( KillerObjectLocalID , DeadAvatar ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerAvatarKill failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-03 15:39:40 +00:00
}
2008-05-07 18:23:46 +00:00
2011-08-03 03:19:19 +00:00
public void TriggerSignificantClientMovement ( ScenePresence presence )
2008-05-09 17:40:39 +00:00
{
2011-08-03 03:19:19 +00:00
Action < ScenePresence > handlerSignificantClientMovement = OnSignificantClientMovement ;
2008-05-09 17:40:39 +00:00
if ( handlerSignificantClientMovement ! = null )
{
2011-08-03 03:19:19 +00:00
foreach ( Action < ScenePresence > d in handlerSignificantClientMovement . GetInvocationList ( ) )
2010-02-03 19:04:31 +00:00
{
try
{
2011-08-03 03:19:19 +00:00
d ( presence ) ;
2010-02-03 19:04:31 +00:00
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerSignificantClientMovement failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-09 17:40:39 +00:00
}
2008-05-23 10:24:26 +00:00
2008-07-25 10:05:50 +00:00
public void TriggerOnChatFromWorld ( Object sender , OSChatMessage chat )
2008-05-23 10:24:26 +00:00
{
2010-02-03 19:04:31 +00:00
ChatFromWorldEvent handlerChatFromWorld = OnChatFromWorld ;
2008-05-23 10:24:26 +00:00
if ( handlerChatFromWorld ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( ChatFromWorldEvent d in handlerChatFromWorld . GetInvocationList ( ) )
{
try
{
d ( sender , chat ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnChatFromWorld failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-23 10:24:26 +00:00
}
2008-10-03 14:53:11 +00:00
public void TriggerOnChatFromClient ( Object sender , OSChatMessage chat )
{
2010-02-03 19:04:31 +00:00
ChatFromClientEvent handlerChatFromClient = OnChatFromClient ;
2008-10-03 14:53:11 +00:00
if ( handlerChatFromClient ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( ChatFromClientEvent d in handlerChatFromClient . GetInvocationList ( ) )
{
try
{
d ( sender , chat ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnChatFromClient failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-10-03 14:53:11 +00:00
}
2010-10-21 21:04:31 +00:00
public void TriggerOnChatToClients (
UUID senderID , HashSet < UUID > receiverIDs ,
string message , ChatTypeEnum type , Vector3 fromPos , string fromName ,
ChatSourceType src , ChatAudibleLevel level )
{
ChatToClientsEvent handler = OnChatToClients ;
if ( handler ! = null )
{
foreach ( ChatToClientsEvent d in handler . GetInvocationList ( ) )
{
try
{
d ( senderID , receiverIDs , message , type , fromPos , fromName , src , level ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnChatToClients failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-10-27 04:01:03 +00:00
}
}
2008-10-03 14:53:11 +00:00
2008-07-25 10:05:50 +00:00
public void TriggerOnChatBroadcast ( Object sender , OSChatMessage chat )
2008-05-26 11:56:04 +00:00
{
2010-02-03 19:04:31 +00:00
ChatBroadcastEvent handlerChatBroadcast = OnChatBroadcast ;
2008-05-26 11:56:04 +00:00
if ( handlerChatBroadcast ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( ChatBroadcastEvent d in handlerChatBroadcast . GetInvocationList ( ) )
{
try
{
d ( sender , chat ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnChatBroadcast failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-26 11:56:04 +00:00
}
2010-07-11 12:09:11 +00:00
internal void TriggerControlEvent ( UUID scriptUUID , UUID avatarID , uint held , uint _changed )
2008-05-07 18:23:46 +00:00
{
2010-02-03 19:04:31 +00:00
ScriptControlEvent handlerScriptControlEvent = OnScriptControlEvent ;
2008-05-07 19:41:03 +00:00
if ( handlerScriptControlEvent ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( ScriptControlEvent d in handlerScriptControlEvent . GetInvocationList ( ) )
{
try
{
2010-07-11 12:09:11 +00:00
d ( scriptUUID , avatarID , held , _changed ) ;
2010-02-03 19:04:31 +00:00
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerControlEvent failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-07 18:23:46 +00:00
}
2008-05-23 15:12:15 +00:00
public void TriggerNoticeNoLandDataFromStorage ( )
{
2010-02-03 19:04:31 +00:00
NoticeNoLandDataFromStorage handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage ;
2008-05-23 15:12:15 +00:00
if ( handlerNoticeNoLandDataFromStorage ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( NoticeNoLandDataFromStorage d in handlerNoticeNoLandDataFromStorage . GetInvocationList ( ) )
{
try
{
d ( ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerNoticeNoLandDataFromStorage failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-23 15:12:15 +00:00
}
public void TriggerIncomingLandDataFromStorage ( List < LandData > landData )
{
2010-02-03 19:04:31 +00:00
IncomingLandDataFromStorage handlerIncomingLandDataFromStorage = OnIncomingLandDataFromStorage ;
2008-05-23 15:12:15 +00:00
if ( handlerIncomingLandDataFromStorage ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( IncomingLandDataFromStorage d in handlerIncomingLandDataFromStorage . GetInvocationList ( ) )
{
try
{
d ( landData ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerIncomingLandDataFromStorage failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-23 15:12:15 +00:00
}
public void TriggerSetAllowForcefulBan ( bool allow )
{
2010-02-03 19:04:31 +00:00
SetAllowForcefulBan handlerSetAllowForcefulBan = OnSetAllowForcefulBan ;
2008-05-23 15:12:15 +00:00
if ( handlerSetAllowForcefulBan ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( SetAllowForcefulBan d in handlerSetAllowForcefulBan . GetInvocationList ( ) )
{
try
{
d ( allow ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerSetAllowForcefulBan failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-23 15:12:15 +00:00
}
public void TriggerRequestParcelPrimCountUpdate ( )
{
2010-02-03 19:04:31 +00:00
RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate ;
2008-05-23 15:12:15 +00:00
if ( handlerRequestParcelPrimCountUpdate ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( RequestParcelPrimCountUpdate d in handlerRequestParcelPrimCountUpdate . GetInvocationList ( ) )
{
try
{
d ( ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerRequestParcelPrimCountUpdate failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-23 15:12:15 +00:00
}
2008-08-18 00:39:10 +00:00
2008-05-23 15:12:15 +00:00
public void TriggerParcelPrimCountTainted ( )
{
2010-02-03 19:04:31 +00:00
ParcelPrimCountTainted handlerParcelPrimCountTainted = OnParcelPrimCountTainted ;
2008-05-23 15:12:15 +00:00
if ( handlerParcelPrimCountTainted ! = null )
{
2010-02-03 19:04:31 +00:00
foreach ( ParcelPrimCountTainted d in handlerParcelPrimCountTainted . GetInvocationList ( ) )
{
try
{
d ( ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerParcelPrimCountTainted failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-23 15:12:15 +00:00
}
2008-08-18 00:39:10 +00:00
2008-05-25 20:50:45 +00:00
// this lets us keep track of nasty script events like timer, etc.
public void TriggerTimerEvent ( uint objLocalID , double Interval )
{
2009-08-07 19:43:23 +00:00
throw new NotImplementedException ( "TriggerTimerEvent was thought to be not used anymore and the registration for the event from scene object part has been commented out due to a memory leak" ) ;
//handlerScriptTimerEvent = OnScriptTimerEvent;
//if (handlerScriptTimerEvent != null)
//{
// handlerScriptTimerEvent(objLocalID, Interval);
//}
2008-05-25 20:50:45 +00:00
}
2008-05-30 11:25:21 +00:00
2009-03-13 23:45:02 +00:00
/// <summary>
/// Updates the system as to how the position of the sun should be handled.
/// </summary>
/// <param name="regionHandle"></param>
/// <param name="FixedTime">True if the Sun Position is fixed</param>
/// <param name="useEstateTime">True if the Estate Settings should be used instead of region</param>
/// <param name="FixedSunHour">The hour 0.0 <= FixedSunHour <= 24.0 at which the sun is fixed at. Sun Hour 0 is sun-rise, when Day/Night ratio is 1:1</param>
public void TriggerEstateToolsSunUpdate ( ulong regionHandle , bool FixedTime , bool useEstateTime , float FixedSunHour )
2008-05-30 11:25:21 +00:00
{
2010-02-03 19:04:31 +00:00
EstateToolsSunUpdate handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate ;
2009-03-13 23:45:02 +00:00
if ( handlerEstateToolsSunUpdate ! = null )
2008-05-30 11:25:21 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( EstateToolsSunUpdate d in handlerEstateToolsSunUpdate . GetInvocationList ( ) )
{
try
{
d ( regionHandle , FixedTime , useEstateTime , FixedSunHour ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerEstateToolsSunUpdate failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-05-30 11:25:21 +00:00
}
2008-06-02 10:01:02 +00:00
2009-03-13 23:45:02 +00:00
public float GetCurrentTimeAsSunLindenHour ( )
2008-06-02 10:01:02 +00:00
{
2010-02-03 19:04:31 +00:00
SunLindenHour handlerCurrentTimeAsLindenSunHour = OnGetCurrentTimeAsLindenSunHour ;
2009-03-13 23:45:02 +00:00
if ( handlerCurrentTimeAsLindenSunHour ! = null )
2008-06-02 10:01:02 +00:00
{
2010-02-03 19:04:31 +00:00
foreach ( SunLindenHour d in handlerCurrentTimeAsLindenSunHour . GetInvocationList ( ) )
{
try
{
return d ( ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2008-06-02 10:01:02 +00:00
}
2010-02-03 19:04:31 +00:00
2008-06-02 10:01:02 +00:00
return 6 ;
}
2008-06-05 13:24:59 +00:00
2009-04-15 19:12:37 +00:00
public void TriggerOarFileLoaded ( Guid requestId , string message )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
OarFileLoaded handlerOarFileLoaded = OnOarFileLoaded ;
2009-01-28 09:22:12 +00:00
if ( handlerOarFileLoaded ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( OarFileLoaded d in handlerOarFileLoaded . GetInvocationList ( ) )
{
try
{
d ( requestId , message ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOarFileLoaded failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2009-01-28 09:22:12 +00:00
}
2009-02-02 20:59:12 +00:00
2009-04-15 19:12:37 +00:00
public void TriggerOarFileSaved ( Guid requestId , string message )
2009-02-02 20:59:12 +00:00
{
2010-02-03 19:04:31 +00:00
OarFileSaved handlerOarFileSaved = OnOarFileSaved ;
2009-02-02 20:59:12 +00:00
if ( handlerOarFileSaved ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( OarFileSaved d in handlerOarFileSaved . GetInvocationList ( ) )
{
try
{
d ( requestId , message ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOarFileSaved failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2009-09-30 16:00:09 +00:00
}
2009-01-28 09:22:12 +00:00
public void TriggerEmptyScriptCompileQueue ( int numScriptsFailed , string message )
{
2010-02-03 19:04:31 +00:00
EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = OnEmptyScriptCompileQueue ;
2009-01-28 09:22:12 +00:00
if ( handlerEmptyScriptCompileQueue ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( EmptyScriptCompileQueue d in handlerEmptyScriptCompileQueue . GetInvocationList ( ) )
{
try
{
d ( numScriptsFailed , message ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerEmptyScriptCompileQueue failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2009-01-28 09:22:12 +00:00
}
2008-06-05 13:24:59 +00:00
public void TriggerScriptCollidingStart ( uint localId , ColliderArgs colliders )
{
2010-02-03 19:04:31 +00:00
ScriptColliding handlerCollidingStart = OnScriptColliderStart ;
2008-06-05 13:24:59 +00:00
if ( handlerCollidingStart ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( ScriptColliding d in handlerCollidingStart . GetInvocationList ( ) )
{
try
{
d ( localId , colliders ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerScriptCollidingStart failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-06-05 13:24:59 +00:00
}
2008-08-18 00:39:10 +00:00
2008-06-05 13:24:59 +00:00
public void TriggerScriptColliding ( uint localId , ColliderArgs colliders )
{
2010-02-03 19:04:31 +00:00
ScriptColliding handlerColliding = OnScriptColliding ;
2008-06-05 13:24:59 +00:00
if ( handlerColliding ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( ScriptColliding d in handlerColliding . GetInvocationList ( ) )
{
try
{
d ( localId , colliders ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerScriptColliding failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-06-05 13:24:59 +00:00
}
2008-08-18 00:39:10 +00:00
2008-06-05 13:24:59 +00:00
public void TriggerScriptCollidingEnd ( uint localId , ColliderArgs colliders )
{
2010-02-03 19:04:31 +00:00
ScriptColliding handlerCollidingEnd = OnScriptCollidingEnd ;
2008-06-05 13:24:59 +00:00
if ( handlerCollidingEnd ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( ScriptColliding d in handlerCollidingEnd . GetInvocationList ( ) )
{
try
{
d ( localId , colliders ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerScriptCollidingEnd failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-06-05 13:24:59 +00:00
}
2008-11-22 22:56:00 +00:00
2010-01-10 20:28:53 +00:00
public void TriggerScriptLandCollidingStart ( uint localId , ColliderArgs colliders )
{
2010-02-03 19:04:31 +00:00
ScriptColliding handlerLandCollidingStart = OnScriptLandColliderStart ;
2010-01-10 20:28:53 +00:00
if ( handlerLandCollidingStart ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( ScriptColliding d in handlerLandCollidingStart . GetInvocationList ( ) )
{
try
{
d ( localId , colliders ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingStart failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2010-01-10 20:28:53 +00:00
}
public void TriggerScriptLandColliding ( uint localId , ColliderArgs colliders )
{
2010-02-03 19:04:31 +00:00
ScriptColliding handlerLandColliding = OnScriptLandColliding ;
2010-01-10 20:28:53 +00:00
if ( handlerLandColliding ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( ScriptColliding d in handlerLandColliding . GetInvocationList ( ) )
{
try
{
d ( localId , colliders ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerScriptLandColliding failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2010-01-10 20:28:53 +00:00
}
public void TriggerScriptLandCollidingEnd ( uint localId , ColliderArgs colliders )
{
2010-02-03 19:04:31 +00:00
ScriptColliding handlerLandCollidingEnd = OnScriptLandColliderEnd ;
2010-01-10 20:28:53 +00:00
if ( handlerLandCollidingEnd ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( ScriptColliding d in handlerLandCollidingEnd . GetInvocationList ( ) )
{
try
{
d ( localId , colliders ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingEnd failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2010-01-10 20:28:53 +00:00
}
2008-11-22 23:38:25 +00:00
public void TriggerSetRootAgentScene ( UUID agentID , Scene scene )
2010-02-15 10:15:03 +00:00
{
2010-02-03 19:04:31 +00:00
OnSetRootAgentSceneDelegate handlerSetRootAgentScene = OnSetRootAgentScene ;
2008-11-22 22:56:00 +00:00
if ( handlerSetRootAgentScene ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( OnSetRootAgentSceneDelegate d in handlerSetRootAgentScene . GetInvocationList ( ) )
{
try
{
d ( agentID , scene ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerSetRootAgentScene failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2008-11-22 22:56:00 +00:00
}
2009-09-27 17:14:10 +00:00
public void TriggerOnRegionUp ( GridRegion otherRegion )
{
2010-02-03 19:04:31 +00:00
RegionUp handlerOnRegionUp = OnRegionUp ;
2009-09-27 17:14:10 +00:00
if ( handlerOnRegionUp ! = null )
2010-02-03 19:04:31 +00:00
{
foreach ( RegionUp d in handlerOnRegionUp . GetInvocationList ( ) )
{
try
{
d ( otherRegion ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnRegionUp failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
2010-02-15 10:15:03 +00:00
}
2009-09-27 17:14:10 +00:00
}
2010-07-26 19:13:26 +00:00
public void TriggerOnSceneObjectLoaded ( SceneObjectGroup so )
{
SceneObjectDelegate handler = OnSceneObjectLoaded ;
if ( handler ! = null )
{
foreach ( SceneObjectDelegate d in handler . GetInvocationList ( ) )
{
try
{
d ( so ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnSceneObjectLoaded failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
2010-09-12 17:43:49 +00:00
}
2010-07-26 19:36:28 +00:00
public void TriggerOnSceneObjectPreSave ( SceneObjectGroup persistingSo , SceneObjectGroup originalSo )
{
SceneObjectPreSaveDelegate handler = OnSceneObjectPreSave ;
if ( handler ! = null )
{
foreach ( SceneObjectPreSaveDelegate d in handler . GetInvocationList ( ) )
{
try
{
d ( persistingSo , originalSo ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPreSave failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
2010-07-28 18:23:30 +00:00
}
2010-07-28 18:38:20 +00:00
public void TriggerOnSceneObjectPartCopy ( SceneObjectPart copy , SceneObjectPart original , bool userExposed )
2010-07-28 18:23:30 +00:00
{
SceneObjectPartCopyDelegate handler = OnSceneObjectPartCopy ;
if ( handler ! = null )
{
foreach ( SceneObjectPartCopyDelegate d in handler . GetInvocationList ( ) )
{
try
{
2010-07-28 18:38:20 +00:00
d ( copy , original , userExposed ) ;
2010-07-28 18:23:30 +00:00
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
2010-09-12 17:43:49 +00:00
}
2010-09-06 01:59:48 +00:00
2012-01-19 11:06:35 +00:00
public void TriggerSceneObjectPartUpdated ( SceneObjectPart sop )
{
SceneObjectPartUpdated handler = OnSceneObjectPartUpdated ;
if ( handler ! = null )
{
foreach ( SceneObjectPartUpdated d in handler . GetInvocationList ( ) )
{
try
{
d ( sop ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerSceneObjectPartUpdated failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
}
2010-09-06 01:59:48 +00:00
public void TriggerOnParcelPropertiesUpdateRequest ( LandUpdateArgs args ,
int local_id , IClientAPI remote_client )
{
ParcelPropertiesUpdateRequest handler = OnParcelPropertiesUpdateRequest ;
if ( handler ! = null )
{
foreach ( ParcelPropertiesUpdateRequest d in handler . GetInvocationList ( ) )
{
try
{
d ( args , local_id , remote_client ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
2010-09-12 17:43:49 +00:00
}
2011-05-23 22:53:28 +00:00
public void TriggerSceneShuttingDown ( Scene s )
{
2011-11-17 21:03:08 +00:00
Action < Scene > handler = OnSceneShuttingDown ;
2011-05-23 22:53:28 +00:00
if ( handler ! = null )
{
2011-11-17 21:03:08 +00:00
foreach ( Action < Scene > d in handler . GetInvocationList ( ) )
2011-05-23 22:53:28 +00:00
{
try
{
d ( s ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerSceneShuttingDown failed - continuing. {0} {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
}
2011-05-28 15:11:01 +00:00
2012-01-04 20:01:18 +00:00
public void TriggerOnRegionStarted ( Scene scene )
{
RegionStarted handler = OnRegionStarted ;
if ( handler ! = null )
{
foreach ( RegionStarted d in handler . GetInvocationList ( ) )
{
try
{
d ( scene ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat ( "[EVENT MANAGER]: Delegate for RegionStarted failed - continuing {0} - {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
}
2012-02-02 00:27:20 +00:00
public void TriggerRegionHeartbeatEnd ( Scene scene )
{
RegionHeartbeatEnd handler = OnRegionHeartbeatEnd ;
if ( handler ! = null )
{
foreach ( RegionHeartbeatEnd d in handler . GetInvocationList ( ) )
{
try
{
d ( scene ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat ( "[EVENT MANAGER]: Delegate for OnRegionHeartbeatEnd failed - continuing {0} - {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
}
2011-05-28 15:11:01 +00:00
public void TriggerLoginsEnabled ( string regionName )
{
LoginsEnabled handler = OnLoginsEnabled ;
if ( handler ! = null )
{
foreach ( LoginsEnabled d in handler . GetInvocationList ( ) )
{
try
{
d ( regionName ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat ( "[EVENT MANAGER]: Delegate for LoginsEnabled failed - continuing {0} - {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
}
2011-06-08 22:18:14 +00:00
public void TriggerPrimsLoaded ( Scene s )
{
PrimsLoaded handler = OnPrimsLoaded ;
if ( handler ! = null )
{
foreach ( PrimsLoaded d in handler . GetInvocationList ( ) )
{
try
{
d ( s ) ;
}
catch ( Exception e )
{
m_log . ErrorFormat ( "[EVENT MANAGER]: Delegate for PrimsLoaded failed - continuing {0} - {1}" ,
e . Message , e . StackTrace ) ;
}
}
}
}
2007-07-16 15:40:11 +00:00
}
2010-09-06 01:59:48 +00:00
}