1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017 |
- /*
- * 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.
- * * Neither the name of the OpenSimulator Project nor the
- * 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.
- */
- using System;
- using System.Collections.Generic;
- using System.Reflection;
- using log4net;
- using OpenMetaverse;
- using OpenSim.Framework;
- using OpenSim.Framework.Client;
- using OpenSim.Region.Framework.Interfaces;
- using Caps = OpenSim.Framework.Capabilities.Caps;
- using GridRegion = OpenSim.Services.Interfaces.GridRegion;
- namespace OpenSim.Region.Framework.Scenes
- {
- /// <summary>
- /// A class for triggering remote scene events.
- /// </summary>
- public class EventManager
- {
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
- public delegate void OnFrameDelegate();
- public event OnFrameDelegate OnFrame;
- public delegate void ClientMovement(ScenePresence client);
- public event ClientMovement OnClientMovement;
- public delegate void OnTerrainTickDelegate();
- public event OnTerrainTickDelegate OnTerrainTick;
- public delegate void OnBackupDelegate(IRegionDataStore datastore, bool forceBackup);
- public event OnBackupDelegate OnBackup;
- public delegate void OnClientConnectCoreDelegate(IClientCore client);
- public event OnClientConnectCoreDelegate OnClientConnect;
- public delegate void OnNewClientDelegate(IClientAPI client);
-
- /// <summary>
- /// Deprecated in favour of OnClientConnect.
- /// Will be marked Obsolete after IClientCore has 100% of IClientAPI interfaces.
- /// </summary>
- public event OnNewClientDelegate OnNewClient;
- public delegate void OnClientLoginDelegate(IClientAPI client);
- public event OnClientLoginDelegate OnClientLogin;
- public delegate void OnNewPresenceDelegate(ScenePresence presence);
- public event OnNewPresenceDelegate OnNewPresence;
- public delegate void OnRemovePresenceDelegate(UUID agentId);
- public event OnRemovePresenceDelegate OnRemovePresence;
- public delegate void OnParcelPrimCountUpdateDelegate();
- public event OnParcelPrimCountUpdateDelegate OnParcelPrimCountUpdate;
- public delegate void OnParcelPrimCountAddDelegate(SceneObjectGroup obj);
- public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd;
- public delegate void OnPluginConsoleDelegate(string[] args);
- public event OnPluginConsoleDelegate OnPluginConsole;
- public delegate void OnShutdownDelegate();
- public event OnShutdownDelegate OnShutdown;
-
- public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs);
- public delegate void ScriptResetDelegate(uint localID, UUID itemID);
- public delegate void OnPermissionErrorDelegate(UUID user, string reason);
- public delegate void OnSetRootAgentSceneDelegate(UUID agentID, Scene scene);
- public event OnSetRootAgentSceneDelegate OnSetRootAgentScene;
- /// <summary>
- /// Fired when an object is touched/grabbed.
- /// </summary>
- /// The originalID is the local ID of the part that was actually touched. The localID itself is always that of
- /// the root part.
- public event ObjectGrabDelegate OnObjectGrab;
- public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs);
-
- public event ObjectGrabDelegate OnObjectGrabbing;
- public event ObjectDeGrabDelegate OnObjectDeGrab;
- public event ScriptResetDelegate OnScriptReset;
- public event OnPermissionErrorDelegate OnPermissionError;
- /// <summary>
- /// Fired when a new script is created.
- /// </summary>
- public event NewRezScript OnRezScript;
- public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource);
- public delegate void RemoveScript(uint localID, UUID itemID);
- public event RemoveScript OnRemoveScript;
- public delegate void StartScript(uint localID, UUID itemID);
- public event StartScript OnStartScript;
- public delegate void StopScript(uint localID, UUID itemID);
- public event StopScript OnStopScript;
- public delegate bool SceneGroupMoved(UUID groupID, Vector3 delta);
- public event SceneGroupMoved OnSceneGroupMove;
- public delegate void SceneGroupGrabed(UUID groupID, Vector3 offset, UUID userID);
- public event SceneGroupGrabed OnSceneGroupGrab;
- public delegate bool SceneGroupSpinStarted(UUID groupID);
- public event SceneGroupSpinStarted OnSceneGroupSpinStart;
- public delegate bool SceneGroupSpun(UUID groupID, Quaternion rotation);
- public event SceneGroupSpun OnSceneGroupSpin;
- public delegate void LandObjectAdded(ILandObject newParcel);
- public event LandObjectAdded OnLandObjectAdded;
- public delegate void LandObjectRemoved(UUID globalID);
- public event LandObjectRemoved OnLandObjectRemoved;
- public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID);
- public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
- public delegate void SignificantClientMovement(IClientAPI remote_client);
- public event SignificantClientMovement OnSignificantClientMovement;
- public delegate void IncomingInstantMessage(GridInstantMessage message);
- public event IncomingInstantMessage OnIncomingInstantMessage;
- public event IncomingInstantMessage OnUnhandledInstantMessage;
- public delegate void ClientClosed(UUID clientID, Scene scene);
- public event ClientClosed OnClientClosed;
- /// <summary>
- /// This is fired when a scene object property that a script might be interested in (such as color, scale or
- /// inventory) changes. Only enough information is sent for the LSL changed event
- /// (see http://lslwiki.net/lslwiki/wakka.php?wakka=changed)
- /// </summary>
- public event ScriptChangedEvent OnScriptChangedEvent;
- public delegate void ScriptChangedEvent(uint localID, uint change);
- public delegate void ScriptControlEvent(uint localID, UUID item, UUID avatarID, uint held, uint changed);
- public event ScriptControlEvent OnScriptControlEvent;
- public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos);
- public event ScriptAtTargetEvent OnScriptAtTargetEvent;
- public delegate void ScriptNotAtTargetEvent(uint localID);
- 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);
- public event ScriptNotAtRotTargetEvent OnScriptNotAtRotTargetEvent;
- public delegate void ScriptColliding(uint localID, ColliderArgs colliders);
- public event ScriptColliding OnScriptColliderStart;
- public event ScriptColliding OnScriptColliding;
- public event ScriptColliding OnScriptCollidingEnd;
- public event ScriptColliding OnScriptLandColliderStart;
- public event ScriptColliding OnScriptLandColliding;
- public event ScriptColliding OnScriptLandColliderEnd;
- public delegate void OnMakeChildAgentDelegate(ScenePresence presence);
- public event OnMakeChildAgentDelegate OnMakeChildAgent;
- public delegate void OnMakeRootAgentDelegate(ScenePresence presence);
- public delegate void OnSaveNewWindlightProfileDelegate();
- public delegate void OnSendNewWindlightProfileTargetedDelegate(RegionLightShareData wl, UUID user);
- public event OnMakeRootAgentDelegate OnMakeRootAgent;
- public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted;
- public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile;
- /// <summary>
- /// Triggered when an object or attachment enters a scene
- /// </summary>
- public event OnIncomingSceneObjectDelegate OnIncomingSceneObject;
- public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so);
- public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel);
- public event NewInventoryItemUploadComplete OnNewInventoryItemUploadComplete;
- public delegate void RequestChangeWaterHeight(float height);
- public event RequestChangeWaterHeight OnRequestChangeWaterHeight;
-
- /// <summary>
- /// Fired if any avatar is 'killed' due to its health falling to zero
- /// </summary>
- public event AvatarKillData OnAvatarKilled;
- public delegate void AvatarKillData(uint KillerLocalID, ScenePresence avatar);
- // public delegate void ScriptTimerEvent(uint localID, double timerinterval);
- // public event ScriptTimerEvent OnScriptTimerEvent;
- public delegate void EstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour);
- public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID);
- public event EstateToolsSunUpdate OnEstateToolsSunUpdate;
- 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;
- public event GetScriptRunning OnGetScriptRunning;
- /// <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>
- public delegate void RegisterCapsEvent(UUID agentID, Caps caps);
- public event RegisterCapsEvent OnRegisterCaps;
-
- /// <summary>
- /// DeregisterCapsEvent is called by Scene when the caps
- /// handler for an agent are removed.
- /// </summary>
- public delegate void DeregisterCapsEvent(UUID agentID, Caps caps);
- public event DeregisterCapsEvent OnDeregisterCaps;
-
- /// <summary>
- /// ChatFromWorldEvent is called via Scene when a chat message
- /// from world comes in.
- /// </summary>
- public delegate void ChatFromWorldEvent(Object sender, OSChatMessage chat);
- public event ChatFromWorldEvent OnChatFromWorld;
-
- /// <summary>
- /// 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;
-
- /// <summary>
- /// ChatBroadcastEvent is called via Scene when a broadcast chat message
- /// from world comes in
- /// </summary>
- public delegate void ChatBroadcastEvent(Object sender, OSChatMessage chat);
- public event ChatBroadcastEvent OnChatBroadcast;
- public delegate float SunLindenHour();
- public event SunLindenHour OnGetCurrentTimeAsLindenSunHour;
- /// <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>
- public delegate void OarFileLoaded(Guid guid, string message);
- public event OarFileLoaded OnOarFileLoaded;
-
- /// <summary>
- /// Called when an oar file has finished saving
- /// Message is non empty string if there were problems saving the oar file
- /// If a guid was supplied on the original call to identify, the request, this is returned. Otherwise
- /// Guid.Empty is returned.
- /// </summary>
- public delegate void OarFileSaved(Guid guid, string message);
- public event OarFileSaved OnOarFileSaved;
- /// <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;
- /// <summary>
- /// Called whenever an object is attached, or detached from an in-world presence.
- /// </summary>
- /// 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).
- public delegate void Attach(uint localID, UUID itemID, UUID avatarID);
- public event Attach OnAttach;
- public delegate void RegionUp(GridRegion region);
- public event RegionUp OnRegionUp;
- public class MoneyTransferArgs : EventArgs
- {
- public UUID sender;
- public UUID receiver;
- // Always false. The SL protocol sucks.
- public bool authenticated = false;
- public int amount;
- public int transactiontype;
- public string description;
- public MoneyTransferArgs(UUID asender, UUID areceiver, int aamount, int atransactiontype, string adescription)
- {
- sender = asender;
- receiver = areceiver;
- amount = aamount;
- transactiontype = atransactiontype;
- description = adescription;
- }
- }
- public class LandBuyArgs : EventArgs
- {
- public UUID agentId = UUID.Zero;
- public UUID groupId = UUID.Zero;
- public UUID parcelOwnerID = UUID.Zero;
- 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;
- public LandBuyArgs(UUID pagentId, UUID pgroupId, bool pfinal, bool pgroupOwned,
- bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice,
- 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);
- public event MoneyTransferEvent OnMoneyTransfer;
- public event LandBuy OnLandBuy;
- public event LandBuy OnValidateLandBuy;
- public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID)
- {
- Attach handlerOnAttach = OnAttach;
- if (handlerOnAttach != null)
- {
- foreach (Attach d in handlerOnAttach.GetInvocationList())
- {
- try
- {
- d(localID, itemID, avatarID);
- }
- catch (Exception e)
- {
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
- }
- }
- }
- }
- public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
- {
- GetScriptRunning handlerGetScriptRunning = OnGetScriptRunning;
- if (handlerGetScriptRunning != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerOnScriptChangedEvent(uint localID, uint change)
- {
- ScriptChangedEvent handlerScriptChangedEvent = OnScriptChangedEvent;
- if (handlerScriptChangedEvent != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerOnClientMovement(ScenePresence avatar)
- {
- ClientMovement handlerClientMovement = OnClientMovement;
- if (handlerClientMovement != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerPermissionError(UUID user, string reason)
- {
- OnPermissionErrorDelegate handlerPermissionError = OnPermissionError;
- if (handlerPermissionError != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerOnPluginConsole(string[] args)
- {
- OnPluginConsoleDelegate handlerPluginConsole = OnPluginConsole;
- if (handlerPluginConsole != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerOnFrame()
- {
- OnFrameDelegate handlerFrame = OnFrame;
- if (handlerFrame != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerOnNewClient(IClientAPI client)
- {
- OnNewClientDelegate handlerNewClient = OnNewClient;
- if (handlerNewClient != null)
- {
- 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);
- }
- }
- }
- if (client is IClientCore)
- {
- OnClientConnectCoreDelegate handlerClientConnect = OnClientConnect;
- if (handlerClientConnect != null)
- {
- 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);
- }
- }
- }
- }
- }
- public void TriggerOnClientLogin(IClientAPI client)
- {
- OnClientLoginDelegate handlerClientLogin = OnClientLogin;
- if (handlerClientLogin != null)
- {
- foreach (OnClientLoginDelegate d in handlerClientLogin.GetInvocationList())
- {
- try
- {
- d(client);
- }
- catch (Exception e)
- {
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnClientLogin failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
- }
- }
- }
- }
- public void TriggerOnNewPresence(ScenePresence presence)
- {
- OnNewPresenceDelegate handlerNewPresence = OnNewPresence;
- if (handlerNewPresence != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerOnRemovePresence(UUID agentId)
- {
- OnRemovePresenceDelegate handlerRemovePresence = OnRemovePresence;
- if (handlerRemovePresence != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerOnBackup(IRegionDataStore dstore)
- {
- OnBackupDelegate handlerOnAttach = OnBackup;
- if (handlerOnAttach != null)
- {
- foreach (OnBackupDelegate d in handlerOnAttach.GetInvocationList())
- {
- try
- {
- d(dstore, false);
- }
- catch (Exception e)
- {
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnBackup failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
- }
- }
- }
- }
- public void TriggerParcelPrimCountUpdate()
- {
- OnParcelPrimCountUpdateDelegate handlerParcelPrimCountUpdate = OnParcelPrimCountUpdate;
- if (handlerParcelPrimCountUpdate != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs args)
- {
- MoneyTransferEvent handlerMoneyTransfer = OnMoneyTransfer;
- if (handlerMoneyTransfer != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerTerrainTick()
- {
- OnTerrainTickDelegate handlerTerrainTick = OnTerrainTick;
- if (handlerTerrainTick != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
- {
- OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = OnParcelPrimCountAdd;
- if (handlerParcelPrimCountAdd != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj)
- {
- ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene;
- if (handlerObjectBeingRemovedFromScene != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerShutdown()
- {
- OnShutdownDelegate handlerShutdown = OnShutdown;
- if (handlerShutdown != null)
- {
- foreach (OnShutdownDelegate d in handlerShutdown.GetInvocationList())
- {
- try
- {
- d();
- }
- catch (Exception e)
- {
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerShutdown failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
- }
- }
- }
- }
- public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
- {
- ObjectGrabDelegate handlerObjectGrab = OnObjectGrab;
- if (handlerObjectGrab != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
- {
- ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing;
- if (handlerObjectGrabbing != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
- {
- ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab;
- if (handlerObjectDeGrab != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerScriptReset(uint localID, UUID itemID)
- {
- ScriptResetDelegate handlerScriptReset = OnScriptReset;
- if (handlerScriptReset != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource)
- {
- NewRezScript handlerRezScript = OnRezScript;
- if (handlerRezScript != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerStartScript(uint localID, UUID itemID)
- {
- StartScript handlerStartScript = OnStartScript;
- if (handlerStartScript != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerStopScript(uint localID, UUID itemID)
- {
- 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);
- }
- }
- }
- }
- public void TriggerRemoveScript(uint localID, UUID itemID)
- {
- RemoveScript handlerRemoveScript = OnRemoveScript;
- if (handlerRemoveScript != null)
- {
- 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);
- }
- }
- }
- }
- public bool TriggerGroupMove(UUID groupID, Vector3 delta)
- {
- bool result = true;
-
- SceneGroupMoved handlerSceneGroupMove = OnSceneGroupMove;
- if (handlerSceneGroupMove != null)
- {
- 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);
- }
- }
- }
-
- return result;
- }
- public bool TriggerGroupSpinStart(UUID groupID)
- {
- bool result = true;
-
- SceneGroupSpinStarted handlerSceneGroupSpinStarted = OnSceneGroupSpinStart;
- if (handlerSceneGroupSpinStarted != null)
- {
- 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);
- }
- }
- }
-
- return result;
- }
- public bool TriggerGroupSpin(UUID groupID, Quaternion rotation)
- {
- bool result = true;
-
- SceneGroupSpun handlerSceneGroupSpin = OnSceneGroupSpin;
- if (handlerSceneGroupSpin != null)
- {
- 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);
- }
- }
- }
-
- return result;
- }
- public void TriggerGroupGrab(UUID groupID, Vector3 offset, UUID userID)
- {
- SceneGroupGrabed handlerSceneGroupGrab = OnSceneGroupGrab;
- if (handlerSceneGroupGrab != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerLandObjectAdded(ILandObject newParcel)
- {
- LandObjectAdded handlerLandObjectAdded = OnLandObjectAdded;
- if (handlerLandObjectAdded != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerLandObjectRemoved(UUID globalID)
- {
- LandObjectRemoved handlerLandObjectRemoved = OnLandObjectRemoved;
- if (handlerLandObjectRemoved != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel)
- {
- TriggerLandObjectAdded(newParcel);
- }
- public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID)
- {
- AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel;
- if (handlerAvatarEnteringNewParcel != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerIncomingInstantMessage(GridInstantMessage message)
- {
- IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage;
- if (handlerIncomingInstantMessage != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerUnhandledInstantMessage(GridInstantMessage message)
- {
- IncomingInstantMessage handlerUnhandledInstantMessage = OnUnhandledInstantMessage;
- if (handlerUnhandledInstantMessage != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerClientClosed(UUID ClientID, Scene scene)
- {
- ClientClosed handlerClientClosed = OnClientClosed;
- if (handlerClientClosed != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerOnMakeChildAgent(ScenePresence presence)
- {
- OnMakeChildAgentDelegate handlerMakeChildAgent = OnMakeChildAgent;
- if (handlerMakeChildAgent != null)
- {
- 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);
- }
- }
- }
- }
- 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();
- }
- }
- public void TriggerOnMakeRootAgent(ScenePresence presence)
- {
- OnMakeRootAgentDelegate handlerMakeRootAgent = OnMakeRootAgent;
- if (handlerMakeRootAgent != null)
- {
- foreach (OnMakeRootAgentDelegate d in handlerMakeRootAgent.GetInvocationList())
- {
- try
- {
- d(presence);
- }
- catch (Exception e)
- {
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnMakeRootAgent failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
- }
- }
- }
- }
- 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);
- }
- }
- }
- }
- public void TriggerOnRegisterCaps(UUID agentID, Caps caps)
- {
- RegisterCapsEvent handlerRegisterCaps = OnRegisterCaps;
- if (handlerRegisterCaps != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerOnDeregisterCaps(UUID agentID, Caps caps)
- {
- DeregisterCapsEvent handlerDeregisterCaps = OnDeregisterCaps;
- if (handlerDeregisterCaps != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel)
- {
- NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete;
- if (handlerNewInventoryItemUpdateComplete != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerLandBuy(Object sender, LandBuyArgs args)
- {
- LandBuy handlerLandBuy = OnLandBuy;
- if (handlerLandBuy != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerValidateLandBuy(Object sender, LandBuyArgs args)
- {
- LandBuy handlerValidateLandBuy = OnValidateLandBuy;
- if (handlerValidateLandBuy != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos)
- {
- ScriptAtTargetEvent handlerScriptAtTargetEvent = OnScriptAtTargetEvent;
- if (handlerScriptAtTargetEvent != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerNotAtTargetEvent(uint localID)
- {
- ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = OnScriptNotAtTargetEvent;
- if (handlerScriptNotAtTargetEvent != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot)
- {
- ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent;
- if (handlerScriptAtRotTargetEvent != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerNotAtRotTargetEvent(uint localID)
- {
- ScriptNotAtRotTargetEvent handlerScriptNotAtRotTargetEvent = OnScriptNotAtRotTargetEvent;
- if (handlerScriptNotAtRotTargetEvent != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerRequestChangeWaterHeight(float height)
- {
- RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight;
- if (handlerRequestChangeWaterHeight != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar)
- {
- AvatarKillData handlerAvatarKill = OnAvatarKilled;
- if (handlerAvatarKill != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerSignificantClientMovement(IClientAPI client)
- {
- SignificantClientMovement handlerSignificantClientMovement = OnSignificantClientMovement;
- if (handlerSignificantClientMovement != null)
- {
- foreach (SignificantClientMovement d in handlerSignificantClientMovement.GetInvocationList())
- {
- try
- {
- d(client);
- }
- catch (Exception e)
- {
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerSignificantClientMovement failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
- }
- }
- }
- }
- public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat)
- {
- ChatFromWorldEvent handlerChatFromWorld = OnChatFromWorld;
- if (handlerChatFromWorld != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerOnChatFromClient(Object sender, OSChatMessage chat)
- {
- ChatFromClientEvent handlerChatFromClient = OnChatFromClient;
- if (handlerChatFromClient != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
- {
- ChatBroadcastEvent handlerChatBroadcast = OnChatBroadcast;
- if (handlerChatBroadcast != null)
- {
- 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);
- }
- }
- }
- }
- internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed)
- {
- ScriptControlEvent handlerScriptControlEvent = OnScriptControlEvent;
- if (handlerScriptControlEvent != null)
- {
- foreach (ScriptControlEvent d in handlerScriptControlEvent.GetInvocationList())
- {
- try
- {
- d(p, scriptUUID, avatarID, held, _changed);
- }
- catch (Exception e)
- {
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerControlEvent failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
- }
- }
- }
- }
- public void TriggerNoticeNoLandDataFromStorage()
- {
- NoticeNoLandDataFromStorage handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage;
- if (handlerNoticeNoLandDataFromStorage != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerIncomingLandDataFromStorage(List<LandData> landData)
- {
- IncomingLandDataFromStorage handlerIncomingLandDataFromStorage = OnIncomingLandDataFromStorage;
- if (handlerIncomingLandDataFromStorage != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerSetAllowForcefulBan(bool allow)
- {
- SetAllowForcefulBan handlerSetAllowForcefulBan = OnSetAllowForcefulBan;
- if (handlerSetAllowForcefulBan != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerRequestParcelPrimCountUpdate()
- {
- RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate;
- if (handlerRequestParcelPrimCountUpdate != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerParcelPrimCountTainted()
- {
- ParcelPrimCountTainted handlerParcelPrimCountTainted = OnParcelPrimCountTainted;
- if (handlerParcelPrimCountTainted != null)
- {
- 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);
- }
- }
- }
- }
- // this lets us keep track of nasty script events like timer, etc.
- public void TriggerTimerEvent(uint objLocalID, double Interval)
- {
- 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);
- //}
- }
- /// <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)
- {
- EstateToolsSunUpdate handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate;
- if (handlerEstateToolsSunUpdate != null)
- {
- 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);
- }
- }
- }
- }
- public float GetCurrentTimeAsSunLindenHour()
- {
- SunLindenHour handlerCurrentTimeAsLindenSunHour = OnGetCurrentTimeAsLindenSunHour;
- if (handlerCurrentTimeAsLindenSunHour != null)
- {
- 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);
- }
- }
- }
-
- return 6;
- }
- public void TriggerOarFileLoaded(Guid requestId, string message)
- {
- OarFileLoaded handlerOarFileLoaded = OnOarFileLoaded;
- if (handlerOarFileLoaded != null)
- {
- 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);
- }
- }
- }
- }
-
- public void TriggerOarFileSaved(Guid requestId, string message)
- {
- OarFileSaved handlerOarFileSaved = OnOarFileSaved;
- if (handlerOarFileSaved != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message)
- {
- EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = OnEmptyScriptCompileQueue;
- if (handlerEmptyScriptCompileQueue != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders)
- {
- ScriptColliding handlerCollidingStart = OnScriptColliderStart;
- if (handlerCollidingStart != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerScriptColliding(uint localId, ColliderArgs colliders)
- {
- ScriptColliding handlerColliding = OnScriptColliding;
- if (handlerColliding != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders)
- {
- ScriptColliding handlerCollidingEnd = OnScriptCollidingEnd;
- if (handlerCollidingEnd != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders)
- {
- ScriptColliding handlerLandCollidingStart = OnScriptLandColliderStart;
- if (handlerLandCollidingStart != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders)
- {
- ScriptColliding handlerLandColliding = OnScriptLandColliding;
- if (handlerLandColliding != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders)
- {
- ScriptColliding handlerLandCollidingEnd = OnScriptLandColliderEnd;
- if (handlerLandCollidingEnd != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerSetRootAgentScene(UUID agentID, Scene scene)
- {
- OnSetRootAgentSceneDelegate handlerSetRootAgentScene = OnSetRootAgentScene;
- if (handlerSetRootAgentScene != null)
- {
- 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);
- }
- }
- }
- }
- public void TriggerOnRegionUp(GridRegion otherRegion)
- {
- RegionUp handlerOnRegionUp = OnRegionUp;
- if (handlerOnRegionUp != null)
- {
- 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);
- }
- }
- }
- }
- }
- }
|