EventManager.cs 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using System.Collections.Generic;
  29. using System.Reflection;
  30. using log4net;
  31. using OpenMetaverse;
  32. using OpenSim.Framework;
  33. using OpenSim.Framework.Client;
  34. using OpenSim.Region.Framework.Interfaces;
  35. using Caps = OpenSim.Framework.Capabilities.Caps;
  36. using GridRegion = OpenSim.Services.Interfaces.GridRegion;
  37. namespace OpenSim.Region.Framework.Scenes
  38. {
  39. /// <summary>
  40. /// A class for triggering remote scene events.
  41. /// </summary>
  42. public class EventManager
  43. {
  44. private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  45. public delegate void OnFrameDelegate();
  46. public event OnFrameDelegate OnFrame;
  47. public delegate void ClientMovement(ScenePresence client);
  48. public event ClientMovement OnClientMovement;
  49. public delegate void OnTerrainTickDelegate();
  50. public event OnTerrainTickDelegate OnTerrainTick;
  51. public delegate void OnBackupDelegate(IRegionDataStore datastore, bool forceBackup);
  52. public event OnBackupDelegate OnBackup;
  53. public delegate void OnClientConnectCoreDelegate(IClientCore client);
  54. public event OnClientConnectCoreDelegate OnClientConnect;
  55. public delegate void OnNewClientDelegate(IClientAPI client);
  56. /// <summary>
  57. /// Deprecated in favour of OnClientConnect.
  58. /// Will be marked Obsolete after IClientCore has 100% of IClientAPI interfaces.
  59. /// </summary>
  60. public event OnNewClientDelegate OnNewClient;
  61. public delegate void OnClientLoginDelegate(IClientAPI client);
  62. public event OnClientLoginDelegate OnClientLogin;
  63. public delegate void OnNewPresenceDelegate(ScenePresence presence);
  64. public event OnNewPresenceDelegate OnNewPresence;
  65. public delegate void OnRemovePresenceDelegate(UUID agentId);
  66. public event OnRemovePresenceDelegate OnRemovePresence;
  67. public delegate void OnParcelPrimCountUpdateDelegate();
  68. public event OnParcelPrimCountUpdateDelegate OnParcelPrimCountUpdate;
  69. public delegate void OnParcelPrimCountAddDelegate(SceneObjectGroup obj);
  70. public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd;
  71. public delegate void OnPluginConsoleDelegate(string[] args);
  72. public event OnPluginConsoleDelegate OnPluginConsole;
  73. public delegate void OnShutdownDelegate();
  74. public event OnShutdownDelegate OnShutdown;
  75. public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs);
  76. public delegate void ScriptResetDelegate(uint localID, UUID itemID);
  77. public delegate void OnPermissionErrorDelegate(UUID user, string reason);
  78. public delegate void OnSetRootAgentSceneDelegate(UUID agentID, Scene scene);
  79. public event OnSetRootAgentSceneDelegate OnSetRootAgentScene;
  80. /// <summary>
  81. /// Fired when an object is touched/grabbed.
  82. /// </summary>
  83. /// The originalID is the local ID of the part that was actually touched. The localID itself is always that of
  84. /// the root part.
  85. public event ObjectGrabDelegate OnObjectGrab;
  86. public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs);
  87. public event ObjectGrabDelegate OnObjectGrabbing;
  88. public event ObjectDeGrabDelegate OnObjectDeGrab;
  89. public event ScriptResetDelegate OnScriptReset;
  90. public event OnPermissionErrorDelegate OnPermissionError;
  91. /// <summary>
  92. /// Fired when a new script is created.
  93. /// </summary>
  94. public event NewRezScript OnRezScript;
  95. public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource);
  96. public delegate void RemoveScript(uint localID, UUID itemID);
  97. public event RemoveScript OnRemoveScript;
  98. public delegate void StartScript(uint localID, UUID itemID);
  99. public event StartScript OnStartScript;
  100. public delegate void StopScript(uint localID, UUID itemID);
  101. public event StopScript OnStopScript;
  102. public delegate bool SceneGroupMoved(UUID groupID, Vector3 delta);
  103. public event SceneGroupMoved OnSceneGroupMove;
  104. public delegate void SceneGroupGrabed(UUID groupID, Vector3 offset, UUID userID);
  105. public event SceneGroupGrabed OnSceneGroupGrab;
  106. public delegate bool SceneGroupSpinStarted(UUID groupID);
  107. public event SceneGroupSpinStarted OnSceneGroupSpinStart;
  108. public delegate bool SceneGroupSpun(UUID groupID, Quaternion rotation);
  109. public event SceneGroupSpun OnSceneGroupSpin;
  110. public delegate void LandObjectAdded(ILandObject newParcel);
  111. public event LandObjectAdded OnLandObjectAdded;
  112. public delegate void LandObjectRemoved(UUID globalID);
  113. public event LandObjectRemoved OnLandObjectRemoved;
  114. public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID);
  115. public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
  116. public delegate void SignificantClientMovement(IClientAPI remote_client);
  117. public event SignificantClientMovement OnSignificantClientMovement;
  118. public delegate void IncomingInstantMessage(GridInstantMessage message);
  119. public event IncomingInstantMessage OnIncomingInstantMessage;
  120. public event IncomingInstantMessage OnUnhandledInstantMessage;
  121. public delegate void ClientClosed(UUID clientID, Scene scene);
  122. public event ClientClosed OnClientClosed;
  123. /// <summary>
  124. /// This is fired when a scene object property that a script might be interested in (such as color, scale or
  125. /// inventory) changes. Only enough information is sent for the LSL changed event
  126. /// (see http://lslwiki.net/lslwiki/wakka.php?wakka=changed)
  127. /// </summary>
  128. public event ScriptChangedEvent OnScriptChangedEvent;
  129. public delegate void ScriptChangedEvent(uint localID, uint change);
  130. public delegate void ScriptControlEvent(UUID item, UUID avatarID, uint held, uint changed);
  131. public event ScriptControlEvent OnScriptControlEvent;
  132. public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos);
  133. public event ScriptAtTargetEvent OnScriptAtTargetEvent;
  134. public delegate void ScriptNotAtTargetEvent(uint localID);
  135. public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent;
  136. public delegate void ScriptAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion atrot);
  137. public event ScriptAtRotTargetEvent OnScriptAtRotTargetEvent;
  138. public delegate void ScriptNotAtRotTargetEvent(uint localID);
  139. public event ScriptNotAtRotTargetEvent OnScriptNotAtRotTargetEvent;
  140. public delegate void ScriptColliding(uint localID, ColliderArgs colliders);
  141. public event ScriptColliding OnScriptColliderStart;
  142. public event ScriptColliding OnScriptColliding;
  143. public event ScriptColliding OnScriptCollidingEnd;
  144. public event ScriptColliding OnScriptLandColliderStart;
  145. public event ScriptColliding OnScriptLandColliding;
  146. public event ScriptColliding OnScriptLandColliderEnd;
  147. public delegate void OnMakeChildAgentDelegate(ScenePresence presence);
  148. public event OnMakeChildAgentDelegate OnMakeChildAgent;
  149. public delegate void OnMakeRootAgentDelegate(ScenePresence presence);
  150. public delegate void OnSaveNewWindlightProfileDelegate();
  151. public delegate void OnSendNewWindlightProfileTargetedDelegate(RegionLightShareData wl, UUID user);
  152. public event OnMakeRootAgentDelegate OnMakeRootAgent;
  153. public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted;
  154. public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile;
  155. /// <summary>
  156. /// Triggered when an object or attachment enters a scene
  157. /// </summary>
  158. public event OnIncomingSceneObjectDelegate OnIncomingSceneObject;
  159. public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so);
  160. public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel);
  161. public event NewInventoryItemUploadComplete OnNewInventoryItemUploadComplete;
  162. public delegate void RequestChangeWaterHeight(float height);
  163. public event RequestChangeWaterHeight OnRequestChangeWaterHeight;
  164. /// <summary>
  165. /// Fired if any avatar is 'killed' due to its health falling to zero
  166. /// </summary>
  167. public event AvatarKillData OnAvatarKilled;
  168. public delegate void AvatarKillData(uint KillerLocalID, ScenePresence avatar);
  169. // public delegate void ScriptTimerEvent(uint localID, double timerinterval);
  170. // public event ScriptTimerEvent OnScriptTimerEvent;
  171. public delegate void EstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour);
  172. public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID);
  173. public event EstateToolsSunUpdate OnEstateToolsSunUpdate;
  174. public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj);
  175. public event ObjectBeingRemovedFromScene OnObjectBeingRemovedFromScene;
  176. public delegate void NoticeNoLandDataFromStorage();
  177. public event NoticeNoLandDataFromStorage OnNoticeNoLandDataFromStorage;
  178. public delegate void IncomingLandDataFromStorage(List<LandData> data);
  179. public event IncomingLandDataFromStorage OnIncomingLandDataFromStorage;
  180. public delegate void SetAllowForcefulBan(bool allow);
  181. public event SetAllowForcefulBan OnSetAllowForcefulBan;
  182. public delegate void RequestParcelPrimCountUpdate();
  183. public event RequestParcelPrimCountUpdate OnRequestParcelPrimCountUpdate;
  184. public delegate void ParcelPrimCountTainted();
  185. public event ParcelPrimCountTainted OnParcelPrimCountTainted;
  186. public event GetScriptRunning OnGetScriptRunning;
  187. /// <summary>
  188. /// RegisterCapsEvent is called by Scene after the Caps object
  189. /// has been instantiated and before it is return to the
  190. /// client and provides region modules to add their caps.
  191. /// </summary>
  192. public delegate void RegisterCapsEvent(UUID agentID, Caps caps);
  193. public event RegisterCapsEvent OnRegisterCaps;
  194. /// <summary>
  195. /// DeregisterCapsEvent is called by Scene when the caps
  196. /// handler for an agent are removed.
  197. /// </summary>
  198. public delegate void DeregisterCapsEvent(UUID agentID, Caps caps);
  199. public event DeregisterCapsEvent OnDeregisterCaps;
  200. /// <summary>
  201. /// ChatFromWorldEvent is called via Scene when a chat message
  202. /// from world comes in.
  203. /// </summary>
  204. public delegate void ChatFromWorldEvent(Object sender, OSChatMessage chat);
  205. public event ChatFromWorldEvent OnChatFromWorld;
  206. /// <summary>
  207. /// ChatFromClientEvent is triggered via ChatModule (or
  208. /// substitutes thereof) when a chat message
  209. /// from the client comes in.
  210. /// </summary>
  211. public delegate void ChatFromClientEvent(Object sender, OSChatMessage chat);
  212. public event ChatFromClientEvent OnChatFromClient;
  213. /// <summary>
  214. /// ChatBroadcastEvent is called via Scene when a broadcast chat message
  215. /// from world comes in
  216. /// </summary>
  217. public delegate void ChatBroadcastEvent(Object sender, OSChatMessage chat);
  218. public event ChatBroadcastEvent OnChatBroadcast;
  219. public delegate float SunLindenHour();
  220. public event SunLindenHour OnGetCurrentTimeAsLindenSunHour;
  221. /// <summary>
  222. /// Called when oar file has finished loading, although
  223. /// the scripts may not have started yet
  224. /// Message is non empty string if there were problems loading the oar file
  225. /// </summary>
  226. public delegate void OarFileLoaded(Guid guid, string message);
  227. public event OarFileLoaded OnOarFileLoaded;
  228. /// <summary>
  229. /// Called when an oar file has finished saving
  230. /// Message is non empty string if there were problems saving the oar file
  231. /// If a guid was supplied on the original call to identify, the request, this is returned. Otherwise
  232. /// Guid.Empty is returned.
  233. /// </summary>
  234. public delegate void OarFileSaved(Guid guid, string message);
  235. public event OarFileSaved OnOarFileSaved;
  236. /// <summary>
  237. /// Called when the script compile queue becomes empty
  238. /// Returns the number of scripts which failed to start
  239. /// </summary>
  240. public delegate void EmptyScriptCompileQueue(int numScriptsFailed, string message);
  241. public event EmptyScriptCompileQueue OnEmptyScriptCompileQueue;
  242. /// <summary>
  243. /// Called whenever an object is attached, or detached from an in-world presence.
  244. /// </summary>
  245. /// If the object is being attached, then the avatarID will be present. If the object is being detached then
  246. /// the avatarID is UUID.Zero (I know, this doesn't make much sense but now it's historical).
  247. public delegate void Attach(uint localID, UUID itemID, UUID avatarID);
  248. public event Attach OnAttach;
  249. public delegate void RegionUp(GridRegion region);
  250. public event RegionUp OnRegionUp;
  251. public class MoneyTransferArgs : EventArgs
  252. {
  253. public UUID sender;
  254. public UUID receiver;
  255. // Always false. The SL protocol sucks.
  256. public bool authenticated = false;
  257. public int amount;
  258. public int transactiontype;
  259. public string description;
  260. public MoneyTransferArgs(UUID asender, UUID areceiver, int aamount, int atransactiontype, string adescription)
  261. {
  262. sender = asender;
  263. receiver = areceiver;
  264. amount = aamount;
  265. transactiontype = atransactiontype;
  266. description = adescription;
  267. }
  268. }
  269. public class LandBuyArgs : EventArgs
  270. {
  271. public UUID agentId = UUID.Zero;
  272. public UUID groupId = UUID.Zero;
  273. public UUID parcelOwnerID = UUID.Zero;
  274. public bool final = false;
  275. public bool groupOwned = false;
  276. public bool removeContribution = false;
  277. public int parcelLocalID = 0;
  278. public int parcelArea = 0;
  279. public int parcelPrice = 0;
  280. public bool authenticated = false;
  281. public bool landValidated = false;
  282. public bool economyValidated = false;
  283. public int transactionID = 0;
  284. public int amountDebited = 0;
  285. public LandBuyArgs(UUID pagentId, UUID pgroupId, bool pfinal, bool pgroupOwned,
  286. bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice,
  287. bool pauthenticated)
  288. {
  289. agentId = pagentId;
  290. groupId = pgroupId;
  291. final = pfinal;
  292. groupOwned = pgroupOwned;
  293. removeContribution = premoveContribution;
  294. parcelLocalID = pparcelLocalID;
  295. parcelArea = pparcelArea;
  296. parcelPrice = pparcelPrice;
  297. authenticated = pauthenticated;
  298. }
  299. }
  300. public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e);
  301. public delegate void LandBuy(Object sender, LandBuyArgs e);
  302. public event MoneyTransferEvent OnMoneyTransfer;
  303. public event LandBuy OnLandBuy;
  304. public event LandBuy OnValidateLandBuy;
  305. public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID)
  306. {
  307. Attach handlerOnAttach = OnAttach;
  308. if (handlerOnAttach != null)
  309. {
  310. foreach (Attach d in handlerOnAttach.GetInvocationList())
  311. {
  312. try
  313. {
  314. d(localID, itemID, avatarID);
  315. }
  316. catch (Exception e)
  317. {
  318. m_log.ErrorFormat(
  319. "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
  320. e.Message, e.StackTrace);
  321. }
  322. }
  323. }
  324. }
  325. public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
  326. {
  327. GetScriptRunning handlerGetScriptRunning = OnGetScriptRunning;
  328. if (handlerGetScriptRunning != null)
  329. {
  330. foreach (GetScriptRunning d in handlerGetScriptRunning.GetInvocationList())
  331. {
  332. try
  333. {
  334. d(controllingClient, objectID, itemID);
  335. }
  336. catch (Exception e)
  337. {
  338. m_log.ErrorFormat(
  339. "[EVENT MANAGER]: Delegate for TriggerGetScriptRunning failed - continuing. {0} {1}",
  340. e.Message, e.StackTrace);
  341. }
  342. }
  343. }
  344. }
  345. public void TriggerOnScriptChangedEvent(uint localID, uint change)
  346. {
  347. ScriptChangedEvent handlerScriptChangedEvent = OnScriptChangedEvent;
  348. if (handlerScriptChangedEvent != null)
  349. {
  350. foreach (ScriptChangedEvent d in handlerScriptChangedEvent.GetInvocationList())
  351. {
  352. try
  353. {
  354. d(localID, change);
  355. }
  356. catch (Exception e)
  357. {
  358. m_log.ErrorFormat(
  359. "[EVENT MANAGER]: Delegate for TriggerOnScriptChangedEvent failed - continuing. {0} {1}",
  360. e.Message, e.StackTrace);
  361. }
  362. }
  363. }
  364. }
  365. public void TriggerOnClientMovement(ScenePresence avatar)
  366. {
  367. ClientMovement handlerClientMovement = OnClientMovement;
  368. if (handlerClientMovement != null)
  369. {
  370. foreach (ClientMovement d in handlerClientMovement.GetInvocationList())
  371. {
  372. try
  373. {
  374. d(avatar);
  375. }
  376. catch (Exception e)
  377. {
  378. m_log.ErrorFormat(
  379. "[EVENT MANAGER]: Delegate for TriggerOnClientMovement failed - continuing. {0} {1}",
  380. e.Message, e.StackTrace);
  381. }
  382. }
  383. }
  384. }
  385. public void TriggerPermissionError(UUID user, string reason)
  386. {
  387. OnPermissionErrorDelegate handlerPermissionError = OnPermissionError;
  388. if (handlerPermissionError != null)
  389. {
  390. foreach (OnPermissionErrorDelegate d in handlerPermissionError.GetInvocationList())
  391. {
  392. try
  393. {
  394. d(user, reason);
  395. }
  396. catch (Exception e)
  397. {
  398. m_log.ErrorFormat(
  399. "[EVENT MANAGER]: Delegate for TriggerPermissionError failed - continuing. {0} {1}",
  400. e.Message, e.StackTrace);
  401. }
  402. }
  403. }
  404. }
  405. public void TriggerOnPluginConsole(string[] args)
  406. {
  407. OnPluginConsoleDelegate handlerPluginConsole = OnPluginConsole;
  408. if (handlerPluginConsole != null)
  409. {
  410. foreach (OnPluginConsoleDelegate d in handlerPluginConsole.GetInvocationList())
  411. {
  412. try
  413. {
  414. d(args);
  415. }
  416. catch (Exception e)
  417. {
  418. m_log.ErrorFormat(
  419. "[EVENT MANAGER]: Delegate for TriggerOnPluginConsole failed - continuing. {0} {1}",
  420. e.Message, e.StackTrace);
  421. }
  422. }
  423. }
  424. }
  425. public void TriggerOnFrame()
  426. {
  427. OnFrameDelegate handlerFrame = OnFrame;
  428. if (handlerFrame != null)
  429. {
  430. foreach (OnFrameDelegate d in handlerFrame.GetInvocationList())
  431. {
  432. try
  433. {
  434. d();
  435. }
  436. catch (Exception e)
  437. {
  438. m_log.ErrorFormat(
  439. "[EVENT MANAGER]: Delegate for TriggerOnFrame failed - continuing. {0} {1}",
  440. e.Message, e.StackTrace);
  441. }
  442. }
  443. }
  444. }
  445. public void TriggerOnNewClient(IClientAPI client)
  446. {
  447. OnNewClientDelegate handlerNewClient = OnNewClient;
  448. if (handlerNewClient != null)
  449. {
  450. foreach (OnNewClientDelegate d in handlerNewClient.GetInvocationList())
  451. {
  452. try
  453. {
  454. d(client);
  455. }
  456. catch (Exception e)
  457. {
  458. m_log.ErrorFormat(
  459. "[EVENT MANAGER]: Delegate for TriggerOnNewClient failed - continuing. {0} {1}",
  460. e.Message, e.StackTrace);
  461. }
  462. }
  463. }
  464. if (client is IClientCore)
  465. {
  466. OnClientConnectCoreDelegate handlerClientConnect = OnClientConnect;
  467. if (handlerClientConnect != null)
  468. {
  469. foreach (OnClientConnectCoreDelegate d in handlerClientConnect.GetInvocationList())
  470. {
  471. try
  472. {
  473. d((IClientCore)client);
  474. }
  475. catch (Exception e)
  476. {
  477. m_log.ErrorFormat(
  478. "[EVENT MANAGER]: Delegate for TriggerOnNewClient (IClientCore) failed - continuing. {0} {1}",
  479. e.Message, e.StackTrace);
  480. }
  481. }
  482. }
  483. }
  484. }
  485. public void TriggerOnClientLogin(IClientAPI client)
  486. {
  487. OnClientLoginDelegate handlerClientLogin = OnClientLogin;
  488. if (handlerClientLogin != null)
  489. {
  490. foreach (OnClientLoginDelegate d in handlerClientLogin.GetInvocationList())
  491. {
  492. try
  493. {
  494. d(client);
  495. }
  496. catch (Exception e)
  497. {
  498. m_log.ErrorFormat(
  499. "[EVENT MANAGER]: Delegate for TriggerOnClientLogin failed - continuing. {0} {1}",
  500. e.Message, e.StackTrace);
  501. }
  502. }
  503. }
  504. }
  505. public void TriggerOnNewPresence(ScenePresence presence)
  506. {
  507. OnNewPresenceDelegate handlerNewPresence = OnNewPresence;
  508. if (handlerNewPresence != null)
  509. {
  510. foreach (OnNewPresenceDelegate d in handlerNewPresence.GetInvocationList())
  511. {
  512. try
  513. {
  514. d(presence);
  515. }
  516. catch (Exception e)
  517. {
  518. m_log.ErrorFormat(
  519. "[EVENT MANAGER]: Delegate for TriggerOnNewPresence failed - continuing. {0} {1}",
  520. e.Message, e.StackTrace);
  521. }
  522. }
  523. }
  524. }
  525. public void TriggerOnRemovePresence(UUID agentId)
  526. {
  527. OnRemovePresenceDelegate handlerRemovePresence = OnRemovePresence;
  528. if (handlerRemovePresence != null)
  529. {
  530. foreach (OnRemovePresenceDelegate d in handlerRemovePresence.GetInvocationList())
  531. {
  532. try
  533. {
  534. d(agentId);
  535. }
  536. catch (Exception e)
  537. {
  538. m_log.ErrorFormat(
  539. "[EVENT MANAGER]: Delegate for TriggerOnRemovePresence failed - continuing. {0} {1}",
  540. e.Message, e.StackTrace);
  541. }
  542. }
  543. }
  544. }
  545. public void TriggerOnBackup(IRegionDataStore dstore)
  546. {
  547. OnBackupDelegate handlerOnAttach = OnBackup;
  548. if (handlerOnAttach != null)
  549. {
  550. foreach (OnBackupDelegate d in handlerOnAttach.GetInvocationList())
  551. {
  552. try
  553. {
  554. d(dstore, false);
  555. }
  556. catch (Exception e)
  557. {
  558. m_log.ErrorFormat(
  559. "[EVENT MANAGER]: Delegate for TriggerOnBackup failed - continuing. {0} {1}",
  560. e.Message, e.StackTrace);
  561. }
  562. }
  563. }
  564. }
  565. public void TriggerParcelPrimCountUpdate()
  566. {
  567. OnParcelPrimCountUpdateDelegate handlerParcelPrimCountUpdate = OnParcelPrimCountUpdate;
  568. if (handlerParcelPrimCountUpdate != null)
  569. {
  570. foreach (OnParcelPrimCountUpdateDelegate d in handlerParcelPrimCountUpdate.GetInvocationList())
  571. {
  572. try
  573. {
  574. d();
  575. }
  576. catch (Exception e)
  577. {
  578. m_log.ErrorFormat(
  579. "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountUpdate failed - continuing. {0} {1}",
  580. e.Message, e.StackTrace);
  581. }
  582. }
  583. }
  584. }
  585. public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs args)
  586. {
  587. MoneyTransferEvent handlerMoneyTransfer = OnMoneyTransfer;
  588. if (handlerMoneyTransfer != null)
  589. {
  590. foreach (MoneyTransferEvent d in handlerMoneyTransfer.GetInvocationList())
  591. {
  592. try
  593. {
  594. d(sender, args);
  595. }
  596. catch (Exception e)
  597. {
  598. m_log.ErrorFormat(
  599. "[EVENT MANAGER]: Delegate for TriggerMoneyTransfer failed - continuing. {0} {1}",
  600. e.Message, e.StackTrace);
  601. }
  602. }
  603. }
  604. }
  605. public void TriggerTerrainTick()
  606. {
  607. OnTerrainTickDelegate handlerTerrainTick = OnTerrainTick;
  608. if (handlerTerrainTick != null)
  609. {
  610. foreach (OnTerrainTickDelegate d in handlerTerrainTick.GetInvocationList())
  611. {
  612. try
  613. {
  614. d();
  615. }
  616. catch (Exception e)
  617. {
  618. m_log.ErrorFormat(
  619. "[EVENT MANAGER]: Delegate for TriggerTerrainTick failed - continuing. {0} {1}",
  620. e.Message, e.StackTrace);
  621. }
  622. }
  623. }
  624. }
  625. public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
  626. {
  627. OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = OnParcelPrimCountAdd;
  628. if (handlerParcelPrimCountAdd != null)
  629. {
  630. foreach (OnParcelPrimCountAddDelegate d in handlerParcelPrimCountAdd.GetInvocationList())
  631. {
  632. try
  633. {
  634. d(obj);
  635. }
  636. catch (Exception e)
  637. {
  638. m_log.ErrorFormat(
  639. "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountAdd failed - continuing. {0} {1}",
  640. e.Message, e.StackTrace);
  641. }
  642. }
  643. }
  644. }
  645. public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj)
  646. {
  647. ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene;
  648. if (handlerObjectBeingRemovedFromScene != null)
  649. {
  650. foreach (ObjectBeingRemovedFromScene d in handlerObjectBeingRemovedFromScene.GetInvocationList())
  651. {
  652. try
  653. {
  654. d(obj);
  655. }
  656. catch (Exception e)
  657. {
  658. m_log.ErrorFormat(
  659. "[EVENT MANAGER]: Delegate for TriggerObjectBeingRemovedFromScene failed - continuing. {0} {1}",
  660. e.Message, e.StackTrace);
  661. }
  662. }
  663. }
  664. }
  665. public void TriggerShutdown()
  666. {
  667. OnShutdownDelegate handlerShutdown = OnShutdown;
  668. if (handlerShutdown != null)
  669. {
  670. foreach (OnShutdownDelegate d in handlerShutdown.GetInvocationList())
  671. {
  672. try
  673. {
  674. d();
  675. }
  676. catch (Exception e)
  677. {
  678. m_log.ErrorFormat(
  679. "[EVENT MANAGER]: Delegate for TriggerShutdown failed - continuing. {0} {1}",
  680. e.Message, e.StackTrace);
  681. }
  682. }
  683. }
  684. }
  685. public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
  686. {
  687. ObjectGrabDelegate handlerObjectGrab = OnObjectGrab;
  688. if (handlerObjectGrab != null)
  689. {
  690. foreach (ObjectGrabDelegate d in handlerObjectGrab.GetInvocationList())
  691. {
  692. try
  693. {
  694. d(localID, originalID, offsetPos, remoteClient, surfaceArgs);
  695. }
  696. catch (Exception e)
  697. {
  698. m_log.ErrorFormat(
  699. "[EVENT MANAGER]: Delegate for TriggerObjectGrab failed - continuing. {0} {1}",
  700. e.Message, e.StackTrace);
  701. }
  702. }
  703. }
  704. }
  705. public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
  706. {
  707. ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing;
  708. if (handlerObjectGrabbing != null)
  709. {
  710. foreach (ObjectGrabDelegate d in handlerObjectGrabbing.GetInvocationList())
  711. {
  712. try
  713. {
  714. d(localID, originalID, offsetPos, remoteClient, surfaceArgs);
  715. }
  716. catch (Exception e)
  717. {
  718. m_log.ErrorFormat(
  719. "[EVENT MANAGER]: Delegate for TriggerObjectGrabbing failed - continuing. {0} {1}",
  720. e.Message, e.StackTrace);
  721. }
  722. }
  723. }
  724. }
  725. public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
  726. {
  727. ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab;
  728. if (handlerObjectDeGrab != null)
  729. {
  730. foreach (ObjectDeGrabDelegate d in handlerObjectDeGrab.GetInvocationList())
  731. {
  732. try
  733. {
  734. d(localID, originalID, remoteClient, surfaceArgs);
  735. }
  736. catch (Exception e)
  737. {
  738. m_log.ErrorFormat(
  739. "[EVENT MANAGER]: Delegate for TriggerObjectDeGrab failed - continuing. {0} {1}",
  740. e.Message, e.StackTrace);
  741. }
  742. }
  743. }
  744. }
  745. public void TriggerScriptReset(uint localID, UUID itemID)
  746. {
  747. ScriptResetDelegate handlerScriptReset = OnScriptReset;
  748. if (handlerScriptReset != null)
  749. {
  750. foreach (ScriptResetDelegate d in handlerScriptReset.GetInvocationList())
  751. {
  752. try
  753. {
  754. d(localID, itemID);
  755. }
  756. catch (Exception e)
  757. {
  758. m_log.ErrorFormat(
  759. "[EVENT MANAGER]: Delegate for TriggerScriptReset failed - continuing. {0} {1}",
  760. e.Message, e.StackTrace);
  761. }
  762. }
  763. }
  764. }
  765. public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource)
  766. {
  767. NewRezScript handlerRezScript = OnRezScript;
  768. if (handlerRezScript != null)
  769. {
  770. foreach (NewRezScript d in handlerRezScript.GetInvocationList())
  771. {
  772. try
  773. {
  774. d(localID, itemID, script, startParam, postOnRez, engine, stateSource);
  775. }
  776. catch (Exception e)
  777. {
  778. m_log.ErrorFormat(
  779. "[EVENT MANAGER]: Delegate for TriggerRezScript failed - continuing. {0} {1}",
  780. e.Message, e.StackTrace);
  781. }
  782. }
  783. }
  784. }
  785. public void TriggerStartScript(uint localID, UUID itemID)
  786. {
  787. StartScript handlerStartScript = OnStartScript;
  788. if (handlerStartScript != null)
  789. {
  790. foreach (StartScript d in handlerStartScript.GetInvocationList())
  791. {
  792. try
  793. {
  794. d(localID, itemID);
  795. }
  796. catch (Exception e)
  797. {
  798. m_log.ErrorFormat(
  799. "[EVENT MANAGER]: Delegate for TriggerStartScript failed - continuing. {0} {1}",
  800. e.Message, e.StackTrace);
  801. }
  802. }
  803. }
  804. }
  805. public void TriggerStopScript(uint localID, UUID itemID)
  806. {
  807. StopScript handlerStopScript = OnStopScript;
  808. if (handlerStopScript != null)
  809. {
  810. foreach (StopScript d in handlerStopScript.GetInvocationList())
  811. {
  812. try
  813. {
  814. d(localID, itemID);
  815. }
  816. catch (Exception e)
  817. {
  818. m_log.ErrorFormat(
  819. "[EVENT MANAGER]: Delegate for TriggerStopScript failed - continuing. {0} {1}",
  820. e.Message, e.StackTrace);
  821. }
  822. }
  823. }
  824. }
  825. public void TriggerRemoveScript(uint localID, UUID itemID)
  826. {
  827. RemoveScript handlerRemoveScript = OnRemoveScript;
  828. if (handlerRemoveScript != null)
  829. {
  830. foreach (RemoveScript d in handlerRemoveScript.GetInvocationList())
  831. {
  832. try
  833. {
  834. d(localID, itemID);
  835. }
  836. catch (Exception e)
  837. {
  838. m_log.ErrorFormat(
  839. "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}",
  840. e.Message, e.StackTrace);
  841. }
  842. }
  843. }
  844. }
  845. public bool TriggerGroupMove(UUID groupID, Vector3 delta)
  846. {
  847. bool result = true;
  848. SceneGroupMoved handlerSceneGroupMove = OnSceneGroupMove;
  849. if (handlerSceneGroupMove != null)
  850. {
  851. foreach (SceneGroupMoved d in handlerSceneGroupMove.GetInvocationList())
  852. {
  853. try
  854. {
  855. if (d(groupID, delta) == false)
  856. result = false;
  857. }
  858. catch (Exception e)
  859. {
  860. m_log.ErrorFormat(
  861. "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
  862. e.Message, e.StackTrace);
  863. }
  864. }
  865. }
  866. return result;
  867. }
  868. public bool TriggerGroupSpinStart(UUID groupID)
  869. {
  870. bool result = true;
  871. SceneGroupSpinStarted handlerSceneGroupSpinStarted = OnSceneGroupSpinStart;
  872. if (handlerSceneGroupSpinStarted != null)
  873. {
  874. foreach (SceneGroupSpinStarted d in handlerSceneGroupSpinStarted.GetInvocationList())
  875. {
  876. try
  877. {
  878. if (d(groupID) == false)
  879. result = false;
  880. }
  881. catch (Exception e)
  882. {
  883. m_log.ErrorFormat(
  884. "[EVENT MANAGER]: Delegate for TriggerGroupSpinStart failed - continuing. {0} {1}",
  885. e.Message, e.StackTrace);
  886. }
  887. }
  888. }
  889. return result;
  890. }
  891. public bool TriggerGroupSpin(UUID groupID, Quaternion rotation)
  892. {
  893. bool result = true;
  894. SceneGroupSpun handlerSceneGroupSpin = OnSceneGroupSpin;
  895. if (handlerSceneGroupSpin != null)
  896. {
  897. foreach (SceneGroupSpun d in handlerSceneGroupSpin.GetInvocationList())
  898. {
  899. try
  900. {
  901. if (d(groupID, rotation) == false)
  902. result = false;
  903. }
  904. catch (Exception e)
  905. {
  906. m_log.ErrorFormat(
  907. "[EVENT MANAGER]: Delegate for TriggerGroupSpin failed - continuing. {0} {1}",
  908. e.Message, e.StackTrace);
  909. }
  910. }
  911. }
  912. return result;
  913. }
  914. public void TriggerGroupGrab(UUID groupID, Vector3 offset, UUID userID)
  915. {
  916. SceneGroupGrabed handlerSceneGroupGrab = OnSceneGroupGrab;
  917. if (handlerSceneGroupGrab != null)
  918. {
  919. foreach (SceneGroupGrabed d in handlerSceneGroupGrab.GetInvocationList())
  920. {
  921. try
  922. {
  923. d(groupID, offset, userID);
  924. }
  925. catch (Exception e)
  926. {
  927. m_log.ErrorFormat(
  928. "[EVENT MANAGER]: Delegate for TriggerGroupGrab failed - continuing. {0} {1}",
  929. e.Message, e.StackTrace);
  930. }
  931. }
  932. }
  933. }
  934. public void TriggerLandObjectAdded(ILandObject newParcel)
  935. {
  936. LandObjectAdded handlerLandObjectAdded = OnLandObjectAdded;
  937. if (handlerLandObjectAdded != null)
  938. {
  939. foreach (LandObjectAdded d in handlerLandObjectAdded.GetInvocationList())
  940. {
  941. try
  942. {
  943. d(newParcel);
  944. }
  945. catch (Exception e)
  946. {
  947. m_log.ErrorFormat(
  948. "[EVENT MANAGER]: Delegate for TriggerLandObjectAdded failed - continuing. {0} {1}",
  949. e.Message, e.StackTrace);
  950. }
  951. }
  952. }
  953. }
  954. public void TriggerLandObjectRemoved(UUID globalID)
  955. {
  956. LandObjectRemoved handlerLandObjectRemoved = OnLandObjectRemoved;
  957. if (handlerLandObjectRemoved != null)
  958. {
  959. foreach (LandObjectRemoved d in handlerLandObjectRemoved.GetInvocationList())
  960. {
  961. try
  962. {
  963. d(globalID);
  964. }
  965. catch (Exception e)
  966. {
  967. m_log.ErrorFormat(
  968. "[EVENT MANAGER]: Delegate for TriggerLandObjectRemoved failed - continuing. {0} {1}",
  969. e.Message, e.StackTrace);
  970. }
  971. }
  972. }
  973. }
  974. public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel)
  975. {
  976. TriggerLandObjectAdded(newParcel);
  977. }
  978. public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID)
  979. {
  980. AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel;
  981. if (handlerAvatarEnteringNewParcel != null)
  982. {
  983. foreach (AvatarEnteringNewParcel d in handlerAvatarEnteringNewParcel.GetInvocationList())
  984. {
  985. try
  986. {
  987. d(avatar, localLandID, regionID);
  988. }
  989. catch (Exception e)
  990. {
  991. m_log.ErrorFormat(
  992. "[EVENT MANAGER]: Delegate for TriggerAvatarEnteringNewParcel failed - continuing. {0} {1}",
  993. e.Message, e.StackTrace);
  994. }
  995. }
  996. }
  997. }
  998. public void TriggerIncomingInstantMessage(GridInstantMessage message)
  999. {
  1000. IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage;
  1001. if (handlerIncomingInstantMessage != null)
  1002. {
  1003. foreach (IncomingInstantMessage d in handlerIncomingInstantMessage.GetInvocationList())
  1004. {
  1005. try
  1006. {
  1007. d(message);
  1008. }
  1009. catch (Exception e)
  1010. {
  1011. m_log.ErrorFormat(
  1012. "[EVENT MANAGER]: Delegate for TriggerIncomingInstantMessage failed - continuing. {0} {1}",
  1013. e.Message, e.StackTrace);
  1014. }
  1015. }
  1016. }
  1017. }
  1018. public void TriggerUnhandledInstantMessage(GridInstantMessage message)
  1019. {
  1020. IncomingInstantMessage handlerUnhandledInstantMessage = OnUnhandledInstantMessage;
  1021. if (handlerUnhandledInstantMessage != null)
  1022. {
  1023. foreach (IncomingInstantMessage d in handlerUnhandledInstantMessage.GetInvocationList())
  1024. {
  1025. try
  1026. {
  1027. d(message);
  1028. }
  1029. catch (Exception e)
  1030. {
  1031. m_log.ErrorFormat(
  1032. "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
  1033. e.Message, e.StackTrace);
  1034. }
  1035. }
  1036. }
  1037. }
  1038. public void TriggerClientClosed(UUID ClientID, Scene scene)
  1039. {
  1040. ClientClosed handlerClientClosed = OnClientClosed;
  1041. if (handlerClientClosed != null)
  1042. {
  1043. foreach (ClientClosed d in handlerClientClosed.GetInvocationList())
  1044. {
  1045. try
  1046. {
  1047. d(ClientID, scene);
  1048. }
  1049. catch (Exception e)
  1050. {
  1051. m_log.ErrorFormat(
  1052. "[EVENT MANAGER]: Delegate for TriggerClientClosed failed - continuing. {0} {1}",
  1053. e.Message, e.StackTrace);
  1054. }
  1055. }
  1056. }
  1057. }
  1058. public void TriggerOnMakeChildAgent(ScenePresence presence)
  1059. {
  1060. OnMakeChildAgentDelegate handlerMakeChildAgent = OnMakeChildAgent;
  1061. if (handlerMakeChildAgent != null)
  1062. {
  1063. foreach (OnMakeChildAgentDelegate d in handlerMakeChildAgent.GetInvocationList())
  1064. {
  1065. try
  1066. {
  1067. d(presence);
  1068. }
  1069. catch (Exception e)
  1070. {
  1071. m_log.ErrorFormat(
  1072. "[EVENT MANAGER]: Delegate for TriggerOnMakeChildAgent failed - continuing. {0} {1}",
  1073. e.Message, e.StackTrace);
  1074. }
  1075. }
  1076. }
  1077. }
  1078. public void TriggerOnSendNewWindlightProfileTargeted(RegionLightShareData wl, UUID user)
  1079. {
  1080. OnSendNewWindlightProfileTargetedDelegate handlerSendNewWindlightProfileTargeted = OnSendNewWindlightProfileTargeted;
  1081. if (handlerSendNewWindlightProfileTargeted != null)
  1082. {
  1083. handlerSendNewWindlightProfileTargeted(wl, user);
  1084. }
  1085. }
  1086. public void TriggerOnSaveNewWindlightProfile()
  1087. {
  1088. OnSaveNewWindlightProfileDelegate handlerSaveNewWindlightProfile = OnSaveNewWindlightProfile;
  1089. if (handlerSaveNewWindlightProfile != null)
  1090. {
  1091. handlerSaveNewWindlightProfile();
  1092. }
  1093. }
  1094. public void TriggerOnMakeRootAgent(ScenePresence presence)
  1095. {
  1096. OnMakeRootAgentDelegate handlerMakeRootAgent = OnMakeRootAgent;
  1097. if (handlerMakeRootAgent != null)
  1098. {
  1099. foreach (OnMakeRootAgentDelegate d in handlerMakeRootAgent.GetInvocationList())
  1100. {
  1101. try
  1102. {
  1103. d(presence);
  1104. }
  1105. catch (Exception e)
  1106. {
  1107. m_log.ErrorFormat(
  1108. "[EVENT MANAGER]: Delegate for TriggerOnMakeRootAgent failed - continuing. {0} {1}",
  1109. e.Message, e.StackTrace);
  1110. }
  1111. }
  1112. }
  1113. }
  1114. public void TriggerOnIncomingSceneObject(SceneObjectGroup so)
  1115. {
  1116. OnIncomingSceneObjectDelegate handlerIncomingSceneObject = OnIncomingSceneObject;
  1117. if (handlerIncomingSceneObject != null)
  1118. {
  1119. foreach (OnIncomingSceneObjectDelegate d in handlerIncomingSceneObject.GetInvocationList())
  1120. {
  1121. try
  1122. {
  1123. d(so);
  1124. }
  1125. catch (Exception e)
  1126. {
  1127. m_log.ErrorFormat(
  1128. "[EVENT MANAGER]: Delegate for TriggerOnIncomingSceneObject failed - continuing. {0} {1}",
  1129. e.Message, e.StackTrace);
  1130. }
  1131. }
  1132. }
  1133. }
  1134. public void TriggerOnRegisterCaps(UUID agentID, Caps caps)
  1135. {
  1136. RegisterCapsEvent handlerRegisterCaps = OnRegisterCaps;
  1137. if (handlerRegisterCaps != null)
  1138. {
  1139. foreach (RegisterCapsEvent d in handlerRegisterCaps.GetInvocationList())
  1140. {
  1141. try
  1142. {
  1143. d(agentID, caps);
  1144. }
  1145. catch (Exception e)
  1146. {
  1147. m_log.ErrorFormat(
  1148. "[EVENT MANAGER]: Delegate for TriggerOnRegisterCaps failed - continuing. {0} {1}",
  1149. e.Message, e.StackTrace);
  1150. }
  1151. }
  1152. }
  1153. }
  1154. public void TriggerOnDeregisterCaps(UUID agentID, Caps caps)
  1155. {
  1156. DeregisterCapsEvent handlerDeregisterCaps = OnDeregisterCaps;
  1157. if (handlerDeregisterCaps != null)
  1158. {
  1159. foreach (DeregisterCapsEvent d in handlerDeregisterCaps.GetInvocationList())
  1160. {
  1161. try
  1162. {
  1163. d(agentID, caps);
  1164. }
  1165. catch (Exception e)
  1166. {
  1167. m_log.ErrorFormat(
  1168. "[EVENT MANAGER]: Delegate for TriggerOnDeregisterCaps failed - continuing. {0} {1}",
  1169. e.Message, e.StackTrace);
  1170. }
  1171. }
  1172. }
  1173. }
  1174. public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel)
  1175. {
  1176. NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete;
  1177. if (handlerNewInventoryItemUpdateComplete != null)
  1178. {
  1179. foreach (NewInventoryItemUploadComplete d in handlerNewInventoryItemUpdateComplete.GetInvocationList())
  1180. {
  1181. try
  1182. {
  1183. d(agentID, AssetID, AssetName, userlevel);
  1184. }
  1185. catch (Exception e)
  1186. {
  1187. m_log.ErrorFormat(
  1188. "[EVENT MANAGER]: Delegate for TriggerOnNewInventoryItemUploadComplete failed - continuing. {0} {1}",
  1189. e.Message, e.StackTrace);
  1190. }
  1191. }
  1192. }
  1193. }
  1194. public void TriggerLandBuy(Object sender, LandBuyArgs args)
  1195. {
  1196. LandBuy handlerLandBuy = OnLandBuy;
  1197. if (handlerLandBuy != null)
  1198. {
  1199. foreach (LandBuy d in handlerLandBuy.GetInvocationList())
  1200. {
  1201. try
  1202. {
  1203. d(sender, args);
  1204. }
  1205. catch (Exception e)
  1206. {
  1207. m_log.ErrorFormat(
  1208. "[EVENT MANAGER]: Delegate for TriggerLandBuy failed - continuing. {0} {1}",
  1209. e.Message, e.StackTrace);
  1210. }
  1211. }
  1212. }
  1213. }
  1214. public void TriggerValidateLandBuy(Object sender, LandBuyArgs args)
  1215. {
  1216. LandBuy handlerValidateLandBuy = OnValidateLandBuy;
  1217. if (handlerValidateLandBuy != null)
  1218. {
  1219. foreach (LandBuy d in handlerValidateLandBuy.GetInvocationList())
  1220. {
  1221. try
  1222. {
  1223. d(sender, args);
  1224. }
  1225. catch (Exception e)
  1226. {
  1227. m_log.ErrorFormat(
  1228. "[EVENT MANAGER]: Delegate for TriggerValidateLandBuy failed - continuing. {0} {1}",
  1229. e.Message, e.StackTrace);
  1230. }
  1231. }
  1232. }
  1233. }
  1234. public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos)
  1235. {
  1236. ScriptAtTargetEvent handlerScriptAtTargetEvent = OnScriptAtTargetEvent;
  1237. if (handlerScriptAtTargetEvent != null)
  1238. {
  1239. foreach (ScriptAtTargetEvent d in handlerScriptAtTargetEvent.GetInvocationList())
  1240. {
  1241. try
  1242. {
  1243. d(localID, handle, targetpos, currentpos);
  1244. }
  1245. catch (Exception e)
  1246. {
  1247. m_log.ErrorFormat(
  1248. "[EVENT MANAGER]: Delegate for TriggerAtTargetEvent failed - continuing. {0} {1}",
  1249. e.Message, e.StackTrace);
  1250. }
  1251. }
  1252. }
  1253. }
  1254. public void TriggerNotAtTargetEvent(uint localID)
  1255. {
  1256. ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = OnScriptNotAtTargetEvent;
  1257. if (handlerScriptNotAtTargetEvent != null)
  1258. {
  1259. foreach (ScriptNotAtTargetEvent d in handlerScriptNotAtTargetEvent.GetInvocationList())
  1260. {
  1261. try
  1262. {
  1263. d(localID);
  1264. }
  1265. catch (Exception e)
  1266. {
  1267. m_log.ErrorFormat(
  1268. "[EVENT MANAGER]: Delegate for TriggerNotAtTargetEvent failed - continuing. {0} {1}",
  1269. e.Message, e.StackTrace);
  1270. }
  1271. }
  1272. }
  1273. }
  1274. public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot)
  1275. {
  1276. ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent;
  1277. if (handlerScriptAtRotTargetEvent != null)
  1278. {
  1279. foreach (ScriptAtRotTargetEvent d in handlerScriptAtRotTargetEvent.GetInvocationList())
  1280. {
  1281. try
  1282. {
  1283. d(localID, handle, targetrot, currentrot);
  1284. }
  1285. catch (Exception e)
  1286. {
  1287. m_log.ErrorFormat(
  1288. "[EVENT MANAGER]: Delegate for TriggerAtRotTargetEvent failed - continuing. {0} {1}",
  1289. e.Message, e.StackTrace);
  1290. }
  1291. }
  1292. }
  1293. }
  1294. public void TriggerNotAtRotTargetEvent(uint localID)
  1295. {
  1296. ScriptNotAtRotTargetEvent handlerScriptNotAtRotTargetEvent = OnScriptNotAtRotTargetEvent;
  1297. if (handlerScriptNotAtRotTargetEvent != null)
  1298. {
  1299. foreach (ScriptNotAtRotTargetEvent d in handlerScriptNotAtRotTargetEvent.GetInvocationList())
  1300. {
  1301. try
  1302. {
  1303. d(localID);
  1304. }
  1305. catch (Exception e)
  1306. {
  1307. m_log.ErrorFormat(
  1308. "[EVENT MANAGER]: Delegate for TriggerNotAtRotTargetEvent failed - continuing. {0} {1}",
  1309. e.Message, e.StackTrace);
  1310. }
  1311. }
  1312. }
  1313. }
  1314. public void TriggerRequestChangeWaterHeight(float height)
  1315. {
  1316. RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight;
  1317. if (handlerRequestChangeWaterHeight != null)
  1318. {
  1319. foreach (RequestChangeWaterHeight d in handlerRequestChangeWaterHeight.GetInvocationList())
  1320. {
  1321. try
  1322. {
  1323. d(height);
  1324. }
  1325. catch (Exception e)
  1326. {
  1327. m_log.ErrorFormat(
  1328. "[EVENT MANAGER]: Delegate for TriggerRequestChangeWaterHeight failed - continuing. {0} {1}",
  1329. e.Message, e.StackTrace);
  1330. }
  1331. }
  1332. }
  1333. }
  1334. public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar)
  1335. {
  1336. AvatarKillData handlerAvatarKill = OnAvatarKilled;
  1337. if (handlerAvatarKill != null)
  1338. {
  1339. foreach (AvatarKillData d in handlerAvatarKill.GetInvocationList())
  1340. {
  1341. try
  1342. {
  1343. d(KillerObjectLocalID, DeadAvatar);
  1344. }
  1345. catch (Exception e)
  1346. {
  1347. m_log.ErrorFormat(
  1348. "[EVENT MANAGER]: Delegate for TriggerAvatarKill failed - continuing. {0} {1}",
  1349. e.Message, e.StackTrace);
  1350. }
  1351. }
  1352. }
  1353. }
  1354. public void TriggerSignificantClientMovement(IClientAPI client)
  1355. {
  1356. SignificantClientMovement handlerSignificantClientMovement = OnSignificantClientMovement;
  1357. if (handlerSignificantClientMovement != null)
  1358. {
  1359. foreach (SignificantClientMovement d in handlerSignificantClientMovement.GetInvocationList())
  1360. {
  1361. try
  1362. {
  1363. d(client);
  1364. }
  1365. catch (Exception e)
  1366. {
  1367. m_log.ErrorFormat(
  1368. "[EVENT MANAGER]: Delegate for TriggerSignificantClientMovement failed - continuing. {0} {1}",
  1369. e.Message, e.StackTrace);
  1370. }
  1371. }
  1372. }
  1373. }
  1374. public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat)
  1375. {
  1376. ChatFromWorldEvent handlerChatFromWorld = OnChatFromWorld;
  1377. if (handlerChatFromWorld != null)
  1378. {
  1379. foreach (ChatFromWorldEvent d in handlerChatFromWorld.GetInvocationList())
  1380. {
  1381. try
  1382. {
  1383. d(sender, chat);
  1384. }
  1385. catch (Exception e)
  1386. {
  1387. m_log.ErrorFormat(
  1388. "[EVENT MANAGER]: Delegate for TriggerOnChatFromWorld failed - continuing. {0} {1}",
  1389. e.Message, e.StackTrace);
  1390. }
  1391. }
  1392. }
  1393. }
  1394. public void TriggerOnChatFromClient(Object sender, OSChatMessage chat)
  1395. {
  1396. ChatFromClientEvent handlerChatFromClient = OnChatFromClient;
  1397. if (handlerChatFromClient != null)
  1398. {
  1399. foreach (ChatFromClientEvent d in handlerChatFromClient.GetInvocationList())
  1400. {
  1401. try
  1402. {
  1403. d(sender, chat);
  1404. }
  1405. catch (Exception e)
  1406. {
  1407. m_log.ErrorFormat(
  1408. "[EVENT MANAGER]: Delegate for TriggerOnChatFromClient failed - continuing. {0} {1}",
  1409. e.Message, e.StackTrace);
  1410. }
  1411. }
  1412. }
  1413. }
  1414. public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
  1415. {
  1416. ChatBroadcastEvent handlerChatBroadcast = OnChatBroadcast;
  1417. if (handlerChatBroadcast != null)
  1418. {
  1419. foreach (ChatBroadcastEvent d in handlerChatBroadcast.GetInvocationList())
  1420. {
  1421. try
  1422. {
  1423. d(sender, chat);
  1424. }
  1425. catch (Exception e)
  1426. {
  1427. m_log.ErrorFormat(
  1428. "[EVENT MANAGER]: Delegate for TriggerOnChatBroadcast failed - continuing. {0} {1}",
  1429. e.Message, e.StackTrace);
  1430. }
  1431. }
  1432. }
  1433. }
  1434. internal void TriggerControlEvent(UUID scriptUUID, UUID avatarID, uint held, uint _changed)
  1435. {
  1436. ScriptControlEvent handlerScriptControlEvent = OnScriptControlEvent;
  1437. if (handlerScriptControlEvent != null)
  1438. {
  1439. foreach (ScriptControlEvent d in handlerScriptControlEvent.GetInvocationList())
  1440. {
  1441. try
  1442. {
  1443. d(scriptUUID, avatarID, held, _changed);
  1444. }
  1445. catch (Exception e)
  1446. {
  1447. m_log.ErrorFormat(
  1448. "[EVENT MANAGER]: Delegate for TriggerControlEvent failed - continuing. {0} {1}",
  1449. e.Message, e.StackTrace);
  1450. }
  1451. }
  1452. }
  1453. }
  1454. public void TriggerNoticeNoLandDataFromStorage()
  1455. {
  1456. NoticeNoLandDataFromStorage handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage;
  1457. if (handlerNoticeNoLandDataFromStorage != null)
  1458. {
  1459. foreach (NoticeNoLandDataFromStorage d in handlerNoticeNoLandDataFromStorage.GetInvocationList())
  1460. {
  1461. try
  1462. {
  1463. d();
  1464. }
  1465. catch (Exception e)
  1466. {
  1467. m_log.ErrorFormat(
  1468. "[EVENT MANAGER]: Delegate for TriggerNoticeNoLandDataFromStorage failed - continuing. {0} {1}",
  1469. e.Message, e.StackTrace);
  1470. }
  1471. }
  1472. }
  1473. }
  1474. public void TriggerIncomingLandDataFromStorage(List<LandData> landData)
  1475. {
  1476. IncomingLandDataFromStorage handlerIncomingLandDataFromStorage = OnIncomingLandDataFromStorage;
  1477. if (handlerIncomingLandDataFromStorage != null)
  1478. {
  1479. foreach (IncomingLandDataFromStorage d in handlerIncomingLandDataFromStorage.GetInvocationList())
  1480. {
  1481. try
  1482. {
  1483. d(landData);
  1484. }
  1485. catch (Exception e)
  1486. {
  1487. m_log.ErrorFormat(
  1488. "[EVENT MANAGER]: Delegate for TriggerIncomingLandDataFromStorage failed - continuing. {0} {1}",
  1489. e.Message, e.StackTrace);
  1490. }
  1491. }
  1492. }
  1493. }
  1494. public void TriggerSetAllowForcefulBan(bool allow)
  1495. {
  1496. SetAllowForcefulBan handlerSetAllowForcefulBan = OnSetAllowForcefulBan;
  1497. if (handlerSetAllowForcefulBan != null)
  1498. {
  1499. foreach (SetAllowForcefulBan d in handlerSetAllowForcefulBan.GetInvocationList())
  1500. {
  1501. try
  1502. {
  1503. d(allow);
  1504. }
  1505. catch (Exception e)
  1506. {
  1507. m_log.ErrorFormat(
  1508. "[EVENT MANAGER]: Delegate for TriggerSetAllowForcefulBan failed - continuing. {0} {1}",
  1509. e.Message, e.StackTrace);
  1510. }
  1511. }
  1512. }
  1513. }
  1514. public void TriggerRequestParcelPrimCountUpdate()
  1515. {
  1516. RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate;
  1517. if (handlerRequestParcelPrimCountUpdate != null)
  1518. {
  1519. foreach (RequestParcelPrimCountUpdate d in handlerRequestParcelPrimCountUpdate.GetInvocationList())
  1520. {
  1521. try
  1522. {
  1523. d();
  1524. }
  1525. catch (Exception e)
  1526. {
  1527. m_log.ErrorFormat(
  1528. "[EVENT MANAGER]: Delegate for TriggerRequestParcelPrimCountUpdate failed - continuing. {0} {1}",
  1529. e.Message, e.StackTrace);
  1530. }
  1531. }
  1532. }
  1533. }
  1534. public void TriggerParcelPrimCountTainted()
  1535. {
  1536. ParcelPrimCountTainted handlerParcelPrimCountTainted = OnParcelPrimCountTainted;
  1537. if (handlerParcelPrimCountTainted != null)
  1538. {
  1539. foreach (ParcelPrimCountTainted d in handlerParcelPrimCountTainted.GetInvocationList())
  1540. {
  1541. try
  1542. {
  1543. d();
  1544. }
  1545. catch (Exception e)
  1546. {
  1547. m_log.ErrorFormat(
  1548. "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountTainted failed - continuing. {0} {1}",
  1549. e.Message, e.StackTrace);
  1550. }
  1551. }
  1552. }
  1553. }
  1554. // this lets us keep track of nasty script events like timer, etc.
  1555. public void TriggerTimerEvent(uint objLocalID, double Interval)
  1556. {
  1557. 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");
  1558. //handlerScriptTimerEvent = OnScriptTimerEvent;
  1559. //if (handlerScriptTimerEvent != null)
  1560. //{
  1561. // handlerScriptTimerEvent(objLocalID, Interval);
  1562. //}
  1563. }
  1564. /// <summary>
  1565. /// Updates the system as to how the position of the sun should be handled.
  1566. /// </summary>
  1567. /// <param name="regionHandle"></param>
  1568. /// <param name="FixedTime">True if the Sun Position is fixed</param>
  1569. /// <param name="useEstateTime">True if the Estate Settings should be used instead of region</param>
  1570. /// <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>
  1571. public void TriggerEstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float FixedSunHour)
  1572. {
  1573. EstateToolsSunUpdate handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate;
  1574. if (handlerEstateToolsSunUpdate != null)
  1575. {
  1576. foreach (EstateToolsSunUpdate d in handlerEstateToolsSunUpdate.GetInvocationList())
  1577. {
  1578. try
  1579. {
  1580. d(regionHandle, FixedTime, useEstateTime, FixedSunHour);
  1581. }
  1582. catch (Exception e)
  1583. {
  1584. m_log.ErrorFormat(
  1585. "[EVENT MANAGER]: Delegate for TriggerEstateToolsSunUpdate failed - continuing. {0} {1}",
  1586. e.Message, e.StackTrace);
  1587. }
  1588. }
  1589. }
  1590. }
  1591. public float GetCurrentTimeAsSunLindenHour()
  1592. {
  1593. SunLindenHour handlerCurrentTimeAsLindenSunHour = OnGetCurrentTimeAsLindenSunHour;
  1594. if (handlerCurrentTimeAsLindenSunHour != null)
  1595. {
  1596. foreach (SunLindenHour d in handlerCurrentTimeAsLindenSunHour.GetInvocationList())
  1597. {
  1598. try
  1599. {
  1600. return d();
  1601. }
  1602. catch (Exception e)
  1603. {
  1604. m_log.ErrorFormat(
  1605. "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
  1606. e.Message, e.StackTrace);
  1607. }
  1608. }
  1609. }
  1610. return 6;
  1611. }
  1612. public void TriggerOarFileLoaded(Guid requestId, string message)
  1613. {
  1614. OarFileLoaded handlerOarFileLoaded = OnOarFileLoaded;
  1615. if (handlerOarFileLoaded != null)
  1616. {
  1617. foreach (OarFileLoaded d in handlerOarFileLoaded.GetInvocationList())
  1618. {
  1619. try
  1620. {
  1621. d(requestId, message);
  1622. }
  1623. catch (Exception e)
  1624. {
  1625. m_log.ErrorFormat(
  1626. "[EVENT MANAGER]: Delegate for TriggerOarFileLoaded failed - continuing. {0} {1}",
  1627. e.Message, e.StackTrace);
  1628. }
  1629. }
  1630. }
  1631. }
  1632. public void TriggerOarFileSaved(Guid requestId, string message)
  1633. {
  1634. OarFileSaved handlerOarFileSaved = OnOarFileSaved;
  1635. if (handlerOarFileSaved != null)
  1636. {
  1637. foreach (OarFileSaved d in handlerOarFileSaved.GetInvocationList())
  1638. {
  1639. try
  1640. {
  1641. d(requestId, message);
  1642. }
  1643. catch (Exception e)
  1644. {
  1645. m_log.ErrorFormat(
  1646. "[EVENT MANAGER]: Delegate for TriggerOarFileSaved failed - continuing. {0} {1}",
  1647. e.Message, e.StackTrace);
  1648. }
  1649. }
  1650. }
  1651. }
  1652. public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message)
  1653. {
  1654. EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = OnEmptyScriptCompileQueue;
  1655. if (handlerEmptyScriptCompileQueue != null)
  1656. {
  1657. foreach (EmptyScriptCompileQueue d in handlerEmptyScriptCompileQueue.GetInvocationList())
  1658. {
  1659. try
  1660. {
  1661. d(numScriptsFailed, message);
  1662. }
  1663. catch (Exception e)
  1664. {
  1665. m_log.ErrorFormat(
  1666. "[EVENT MANAGER]: Delegate for TriggerEmptyScriptCompileQueue failed - continuing. {0} {1}",
  1667. e.Message, e.StackTrace);
  1668. }
  1669. }
  1670. }
  1671. }
  1672. public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders)
  1673. {
  1674. ScriptColliding handlerCollidingStart = OnScriptColliderStart;
  1675. if (handlerCollidingStart != null)
  1676. {
  1677. foreach (ScriptColliding d in handlerCollidingStart.GetInvocationList())
  1678. {
  1679. try
  1680. {
  1681. d(localId, colliders);
  1682. }
  1683. catch (Exception e)
  1684. {
  1685. m_log.ErrorFormat(
  1686. "[EVENT MANAGER]: Delegate for TriggerScriptCollidingStart failed - continuing. {0} {1}",
  1687. e.Message, e.StackTrace);
  1688. }
  1689. }
  1690. }
  1691. }
  1692. public void TriggerScriptColliding(uint localId, ColliderArgs colliders)
  1693. {
  1694. ScriptColliding handlerColliding = OnScriptColliding;
  1695. if (handlerColliding != null)
  1696. {
  1697. foreach (ScriptColliding d in handlerColliding.GetInvocationList())
  1698. {
  1699. try
  1700. {
  1701. d(localId, colliders);
  1702. }
  1703. catch (Exception e)
  1704. {
  1705. m_log.ErrorFormat(
  1706. "[EVENT MANAGER]: Delegate for TriggerScriptColliding failed - continuing. {0} {1}",
  1707. e.Message, e.StackTrace);
  1708. }
  1709. }
  1710. }
  1711. }
  1712. public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders)
  1713. {
  1714. ScriptColliding handlerCollidingEnd = OnScriptCollidingEnd;
  1715. if (handlerCollidingEnd != null)
  1716. {
  1717. foreach (ScriptColliding d in handlerCollidingEnd.GetInvocationList())
  1718. {
  1719. try
  1720. {
  1721. d(localId, colliders);
  1722. }
  1723. catch (Exception e)
  1724. {
  1725. m_log.ErrorFormat(
  1726. "[EVENT MANAGER]: Delegate for TriggerScriptCollidingEnd failed - continuing. {0} {1}",
  1727. e.Message, e.StackTrace);
  1728. }
  1729. }
  1730. }
  1731. }
  1732. public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders)
  1733. {
  1734. ScriptColliding handlerLandCollidingStart = OnScriptLandColliderStart;
  1735. if (handlerLandCollidingStart != null)
  1736. {
  1737. foreach (ScriptColliding d in handlerLandCollidingStart.GetInvocationList())
  1738. {
  1739. try
  1740. {
  1741. d(localId, colliders);
  1742. }
  1743. catch (Exception e)
  1744. {
  1745. m_log.ErrorFormat(
  1746. "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingStart failed - continuing. {0} {1}",
  1747. e.Message, e.StackTrace);
  1748. }
  1749. }
  1750. }
  1751. }
  1752. public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders)
  1753. {
  1754. ScriptColliding handlerLandColliding = OnScriptLandColliding;
  1755. if (handlerLandColliding != null)
  1756. {
  1757. foreach (ScriptColliding d in handlerLandColliding.GetInvocationList())
  1758. {
  1759. try
  1760. {
  1761. d(localId, colliders);
  1762. }
  1763. catch (Exception e)
  1764. {
  1765. m_log.ErrorFormat(
  1766. "[EVENT MANAGER]: Delegate for TriggerScriptLandColliding failed - continuing. {0} {1}",
  1767. e.Message, e.StackTrace);
  1768. }
  1769. }
  1770. }
  1771. }
  1772. public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders)
  1773. {
  1774. ScriptColliding handlerLandCollidingEnd = OnScriptLandColliderEnd;
  1775. if (handlerLandCollidingEnd != null)
  1776. {
  1777. foreach (ScriptColliding d in handlerLandCollidingEnd.GetInvocationList())
  1778. {
  1779. try
  1780. {
  1781. d(localId, colliders);
  1782. }
  1783. catch (Exception e)
  1784. {
  1785. m_log.ErrorFormat(
  1786. "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingEnd failed - continuing. {0} {1}",
  1787. e.Message, e.StackTrace);
  1788. }
  1789. }
  1790. }
  1791. }
  1792. public void TriggerSetRootAgentScene(UUID agentID, Scene scene)
  1793. {
  1794. OnSetRootAgentSceneDelegate handlerSetRootAgentScene = OnSetRootAgentScene;
  1795. if (handlerSetRootAgentScene != null)
  1796. {
  1797. foreach (OnSetRootAgentSceneDelegate d in handlerSetRootAgentScene.GetInvocationList())
  1798. {
  1799. try
  1800. {
  1801. d(agentID, scene);
  1802. }
  1803. catch (Exception e)
  1804. {
  1805. m_log.ErrorFormat(
  1806. "[EVENT MANAGER]: Delegate for TriggerSetRootAgentScene failed - continuing. {0} {1}",
  1807. e.Message, e.StackTrace);
  1808. }
  1809. }
  1810. }
  1811. }
  1812. public void TriggerOnRegionUp(GridRegion otherRegion)
  1813. {
  1814. RegionUp handlerOnRegionUp = OnRegionUp;
  1815. if (handlerOnRegionUp != null)
  1816. {
  1817. foreach (RegionUp d in handlerOnRegionUp.GetInvocationList())
  1818. {
  1819. try
  1820. {
  1821. d(otherRegion);
  1822. }
  1823. catch (Exception e)
  1824. {
  1825. m_log.ErrorFormat(
  1826. "[EVENT MANAGER]: Delegate for TriggerOnRegionUp failed - continuing. {0} {1}",
  1827. e.Message, e.StackTrace);
  1828. }
  1829. }
  1830. }
  1831. }
  1832. }
  1833. }