EventManager.cs 87 KB

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