EventManager.cs 87 KB

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