1
0

EventManager.cs 123 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107
  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. /// <summary>
  47. /// Triggered on each sim frame.
  48. /// </summary>
  49. /// <remarks>
  50. /// This gets triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.Update"/>
  51. /// Core uses it for things like Sun, Wind & Clouds
  52. /// The MRM module also uses it.
  53. /// </remarks>
  54. public event OnFrameDelegate OnFrame;
  55. public delegate void ClientMovement(ScenePresence client);
  56. /// <summary>
  57. /// Trigerred when an agent moves.
  58. /// </summary>
  59. /// <remarks>
  60. /// This gets triggered in <see cref="OpenSim.Region.Framework.Scenes.ScenePresence.HandleAgentUpdate"/>
  61. /// prior to <see cref="OpenSim.Region.Framework.Scenes.ScenePresence.TriggerScenePresenceUpdated"/>
  62. /// </remarks>
  63. public event ClientMovement OnClientMovement;
  64. public delegate void OnTerrainTaintedDelegate();
  65. /// <summary>
  66. /// Triggered if the terrain has been edited
  67. /// </summary>
  68. /// <remarks>
  69. /// This gets triggered in <see cref="OpenSim.Region.CoreModules.World.Terrain.CheckForTerrainUpdates"/>
  70. /// after it determines that an update has been made.
  71. /// </remarks>
  72. public event OnTerrainTaintedDelegate OnTerrainTainted;
  73. public delegate void OnTerrainTickDelegate();
  74. /// <summary>
  75. /// Triggered if the terrain has been edited
  76. /// </summary>
  77. /// <remarks>
  78. /// This gets triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.UpdateTerrain"/>
  79. /// but is used by core solely to update the physics engine.
  80. /// </remarks>
  81. public event OnTerrainTickDelegate OnTerrainTick;
  82. public delegate void OnBackupDelegate(ISimulationDataService datastore, bool forceBackup);
  83. /// <summary>
  84. /// Triggered when a region is backed up/persisted to storage
  85. /// </summary>
  86. /// <remarks>
  87. /// This gets triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.Backup"/>
  88. /// and is fired before the persistence occurs.
  89. /// </remarks>
  90. public event OnBackupDelegate OnBackup;
  91. public delegate void OnClientConnectCoreDelegate(IClientCore client);
  92. /// <summary>
  93. /// Triggered when a new client connects to the scene.
  94. /// </summary>
  95. /// <remarks>
  96. /// This gets triggered in <see cref="TriggerOnNewClient"/>,
  97. /// which checks if an instance of <see cref="OpenSim.Framework.IClientAPI"/>
  98. /// also implements <see cref="OpenSim.Framework.Client.IClientCore"/> and as such,
  99. /// is not triggered by <see cref="OpenSim.Region.OptionalModules.World.NPC">NPCs</see>.
  100. /// </remarks>
  101. public event OnClientConnectCoreDelegate OnClientConnect;
  102. public delegate void OnNewClientDelegate(IClientAPI client);
  103. /// <summary>
  104. /// Triggered when a new client is added to the scene.
  105. /// </summary>
  106. /// <remarks>
  107. /// This is triggered for both child and root agent client connections.
  108. ///
  109. /// Triggered before OnClientLogin.
  110. ///
  111. /// This is triggered under per-agent lock. So if you want to perform any long-running operations, please
  112. /// do this on a separate thread.
  113. /// </remarks>
  114. public event OnNewClientDelegate OnNewClient;
  115. /// <summary>
  116. /// Fired if the client entering this sim is doing so as a new login
  117. /// </summary>
  118. /// <remarks>
  119. /// This is triggered under per-agent lock. So if you want to perform any long-running operations, please
  120. /// do this on a separate thread.
  121. /// </remarks>
  122. public event Action<IClientAPI> OnClientLogin;
  123. public delegate void OnNewPresenceDelegate(ScenePresence presence);
  124. /// <summary>
  125. /// Triggered when a new presence is added to the scene
  126. /// </summary>
  127. /// <remarks>
  128. /// Triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.AddNewClient"/> which is used by both
  129. /// <see cref="OpenSim.Framework.PresenceType.User">users</see> and <see cref="OpenSim.Framework.PresenceType.Npc">NPCs</see>
  130. /// </remarks>
  131. public event OnNewPresenceDelegate OnNewPresence;
  132. public delegate void OnRemovePresenceDelegate(UUID agentId);
  133. /// <summary>
  134. /// Triggered when a presence is removed from the scene
  135. /// </summary>
  136. /// <remarks>
  137. /// Triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.AddNewClient"/> which is used by both
  138. /// <see cref="OpenSim.Framework.PresenceType.User">users</see> and <see cref="OpenSim.Framework.PresenceType.Npc">NPCs</see>
  139. ///
  140. /// Triggered under per-agent lock. So if you want to perform any long-running operations, please
  141. /// do this on a separate thread.
  142. /// </remarks>
  143. public event OnRemovePresenceDelegate OnRemovePresence;
  144. public delegate void OnParcelPrimCountUpdateDelegate();
  145. /// <summary>
  146. /// Triggered whenever the prim count may have been altered, or prior
  147. /// to an action that requires the current prim count to be accurate.
  148. /// </summary>
  149. /// <remarks>
  150. /// Triggered by <see cref="TriggerParcelPrimCountUpdate"/> in
  151. /// <see cref="OpenSim.OpenSimBase.CreateRegion"/>,
  152. /// <see cref="OpenSim.Region.CoreModules.World.Land.LandManagementModule.EventManagerOnRequestParcelPrimCountUpdate"/>,
  153. /// <see cref="OpenSim.Region.CoreModules.World.Land.LandManagementModule.ClientOnParcelObjectOwnerRequest"/>,
  154. /// <see cref="OpenSim.Region.CoreModules.World.Land.LandObject.GetPrimsFree"/>,
  155. /// <see cref="OpenSim.Region.CoreModules.World.Land.LandObject.UpdateLandSold"/>,
  156. /// <see cref="OpenSim.Region.CoreModules.World.Land.LandObject.DeedToGroup"/>,
  157. /// <see cref="OpenSim.Region.CoreModules.World.Land.LandObject.SendLandUpdateToClient"/>
  158. /// </remarks>
  159. public event OnParcelPrimCountUpdateDelegate OnParcelPrimCountUpdate;
  160. public delegate void OnParcelPrimCountAddDelegate(SceneObjectGroup obj);
  161. /// <summary>
  162. /// Triggered in response to <see cref="OnParcelPrimCountUpdate"/> for
  163. /// objects that actually contribute to parcel prim count.
  164. /// </summary>
  165. /// <remarks>
  166. /// Triggered by <see cref="TriggerParcelPrimCountAdd"/> in
  167. /// <see cref="OpenSim.Region.CoreModules.World.Land.LandManagementModule.EventManagerOnParcelPrimCountUpdate"/>
  168. /// </remarks>
  169. public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd;
  170. public delegate void OnPluginConsoleDelegate(string[] args);
  171. /// <summary>
  172. /// Triggered after <see cref="OpenSim.IApplicationPlugin.PostInitialise"/>
  173. /// has been called for all <see cref="OpenSim.IApplicationPlugin"/>
  174. /// loaded via <see cref="OpenSim.OpenSimBase.LoadPlugins"/>.
  175. /// Handlers for this event are typically used to parse the arguments
  176. /// from <see cref="OnPluginConsoleDelegate"/> in order to process or
  177. /// filter the arguments and pass them onto <see cref="OpenSim.Region.CoreModules.Framework.InterfaceCommander.Commander.ProcessConsoleCommand"/>
  178. /// </summary>
  179. /// <remarks>
  180. /// Triggered by <see cref="TriggerOnPluginConsole"/> in
  181. /// <see cref="Scene.SendCommandToPlugins"/> via
  182. /// <see cref="SceneManager.SendCommandToPluginModules"/> via
  183. /// <see cref="OpenSim.OpenSimBase.HandleCommanderCommand"/> via
  184. /// <see cref="OpenSim.OpenSimBase.AddPluginCommands"/> via
  185. /// <see cref="OpenSim.OpenSimBase.StartupSpecific"/>
  186. /// </remarks>
  187. public event OnPluginConsoleDelegate OnPluginConsole;
  188. /// <summary>
  189. /// Triggered when the entire simulator is shutdown.
  190. /// </summary>
  191. public event Action OnShutdown;
  192. public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs);
  193. public delegate void ScriptResetDelegate(uint localID, UUID itemID);
  194. public delegate void OnPermissionErrorDelegate(UUID user, string reason);
  195. public delegate void OnSetRootAgentSceneDelegate(UUID agentID, Scene scene);
  196. /// <summary>
  197. /// Triggered before the grunt work for adding a root agent to a
  198. /// scene has been performed (resuming attachment scripts, physics,
  199. /// animations etc.)
  200. /// </summary>
  201. /// <remarks>
  202. /// Triggered before <see cref="OnMakeRootAgent"/>
  203. /// by <see cref="TriggerSetRootAgentScene"/>
  204. /// in <see cref="ScenePresence.MakeRootAgent"/>
  205. /// via <see cref="Scene.AgentCrossing"/>
  206. /// and <see cref="ScenePresence.CompleteMovement"/>
  207. /// </remarks>
  208. public event OnSetRootAgentSceneDelegate OnSetRootAgentScene;
  209. /// <summary>
  210. /// Triggered after parcel properties have been updated.
  211. /// </summary>
  212. /// <remarks>
  213. /// Triggered by <see cref="TriggerOnParcelPropertiesUpdateRequest"/> in
  214. /// <see cref="OpenSim.Region.CoreModules.World.Land.LandManagementModule.ClientOnParcelPropertiesUpdateRequest"/>,
  215. /// <see cref="OpenSim.Region.CoreModules.World.Land.LandManagementModule.ProcessPropertiesUpdate"/>
  216. /// </remarks>
  217. public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
  218. /// <summary>
  219. /// Triggered when an individual scene is shutdown.
  220. /// </summary>
  221. /// <remarks>
  222. /// This does not automatically mean that the entire simulator is shutting down. Listen to OnShutdown for that
  223. /// notification.
  224. /// </remarks>
  225. public event Action<Scene> OnSceneShuttingDown;
  226. /// <summary>
  227. /// Fired when an object is touched/grabbed.
  228. /// </summary>
  229. /// <remarks>
  230. /// The originalID is the local ID of the part that was actually touched. The localID itself is always that of
  231. /// the root part.
  232. /// Triggerd in response to <see cref="OpenSim.Framework.IClientAPI.OnGrabObject"/>
  233. /// via <see cref="TriggerObjectGrab"/>
  234. /// in <see cref="Scene.ProcessObjectGrab"/>
  235. /// </remarks>
  236. public event ObjectGrabDelegate OnObjectGrab;
  237. public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs);
  238. /// <summary>
  239. /// Triggered when an object is being touched/grabbed continuously.
  240. /// </summary>
  241. /// <remarks>
  242. /// Triggered in response to <see cref="OpenSim.Framework.IClientAPI.OnGrabUpdate"/>
  243. /// via <see cref="TriggerObjectGrabbing"/>
  244. /// in <see cref="Scene.ProcessObjectGrabUpdate"/>
  245. /// </remarks>
  246. public event ObjectGrabDelegate OnObjectGrabbing;
  247. /// <summary>
  248. /// Triggered when an object stops being touched/grabbed.
  249. /// </summary>
  250. /// <remarks>
  251. /// Triggered in response to <see cref="OpenSim.Framework.IClientAPI.OnDeGrabObject"/>
  252. /// via <see cref="TriggerObjectDeGrab"/>
  253. /// in <see cref="Scene.ProcessObjectDeGrab"/>
  254. /// </remarks>
  255. public event ObjectDeGrabDelegate OnObjectDeGrab;
  256. /// <summary>
  257. /// Triggered when a script resets.
  258. /// </summary>
  259. /// <remarks>
  260. /// Triggered by <see cref="TriggerScriptReset"/>
  261. /// in <see cref="Scene.ProcessScriptReset"/>
  262. /// via <see cref="OpenSim.Framework.IClientAPI.OnScriptReset"/>
  263. /// via <see cref="OpenSim.Region.ClientStack.LindenUDP.LLClientView.HandleScriptReset"/>
  264. /// </remarks>
  265. public event ScriptResetDelegate OnScriptReset;
  266. public event OnPermissionErrorDelegate OnPermissionError;
  267. /// <summary>
  268. /// Fired when a script is run.
  269. /// </summary>
  270. /// <remarks>
  271. /// Occurs after OnNewScript.
  272. /// Triggered by <see cref="TriggerRezScript"/>
  273. /// in <see cref="SceneObjectPartInventory.CreateScriptInstance"/>
  274. /// </remarks>
  275. public event NewRezScript OnRezScript;
  276. public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource);
  277. public delegate void RemoveScript(uint localID, UUID itemID);
  278. /// <summary>
  279. /// Triggered when a script is removed from an object.
  280. /// </summary>
  281. /// <remarks>
  282. /// Triggered by <see cref="TriggerRemoveScript"/>
  283. /// in <see cref="Scene.RemoveTaskInventory"/>,
  284. /// <see cref="Scene.CreateAgentInventoryItemFromTask"/>,
  285. /// <see cref="SceneObjectPartInventory.RemoveScriptInstance"/>,
  286. /// <see cref="SceneObjectPartInventory.RemoveInventoryItem"/>
  287. /// </remarks>
  288. public event RemoveScript OnRemoveScript;
  289. public delegate void StartScript(uint localID, UUID itemID);
  290. /// <summary>
  291. /// Triggered when a script starts.
  292. /// </summary>
  293. /// <remarks>
  294. /// Triggered by <see cref="TriggerStartScript"/>
  295. /// in <see cref="Scene.SetScriptRunning"/>
  296. /// via <see cref="OpenSim.Framework.IClientAPI.OnSetScriptRunning"/>,
  297. /// via <see cref="OpenSim.Region.ClientStack.LindenUDP.HandleSetScriptRunning"/>
  298. /// </remarks>
  299. public event StartScript OnStartScript;
  300. public delegate void StopScript(uint localID, UUID itemID);
  301. /// <summary>
  302. /// Triggered when a script stops.
  303. /// </summary>
  304. /// <remarks>
  305. /// Triggered by <see cref="TriggerStopScript"/>,
  306. /// in <see cref="SceneObjectPartInventory.CreateScriptInstance"/>,
  307. /// <see cref="SceneObjectPartInventory.StopScriptInstance"/>,
  308. /// <see cref="Scene.SetScriptRunning"/>
  309. /// </remarks>
  310. public event StopScript OnStopScript;
  311. public delegate bool SceneGroupMoved(UUID groupID, Vector3 delta);
  312. /// <summary>
  313. /// Triggered when an object is moved.
  314. /// </summary>
  315. /// <remarks>
  316. /// Triggered by <see cref="TriggerGroupMove"/>
  317. /// in <see cref="SceneObjectGroup.UpdateGroupPosition"/>,
  318. /// <see cref="SceneObjectGroup.GrabMovement"/>
  319. /// </remarks>
  320. public event SceneGroupMoved OnSceneGroupMove;
  321. public delegate void SceneGroupGrabed(UUID groupID, Vector3 offset, UUID userID);
  322. /// <summary>
  323. /// Triggered when an object is grabbed.
  324. /// </summary>
  325. /// <remarks>
  326. /// Triggered by <see cref="TriggerGroupGrab"/>
  327. /// in <see cref="SceneObjectGroup.OnGrabGroup"/>
  328. /// via <see cref="SceneObjectGroup.ObjectGrabHandler"/>
  329. /// via <see cref="Scene.ProcessObjectGrab"/>
  330. /// via <see cref="OpenSim.Framework.IClientAPI.OnGrabObject"/>
  331. /// via <see cref="OpenSim.Region.ClientStack.LindenUDP.LLClientView.HandleObjectGrab"/>
  332. /// </remarks>
  333. public event SceneGroupGrabed OnSceneGroupGrab;
  334. public delegate bool SceneGroupSpinStarted(UUID groupID);
  335. /// <summary>
  336. /// Triggered when an object starts to spin.
  337. /// </summary>
  338. /// <remarks>
  339. /// Triggered by <see cref="TriggerGroupSpinStart"/>
  340. /// in <see cref="SceneObjectGroup.SpinStart"/>
  341. /// via <see cref="SceneGraph.SpinStart"/>
  342. /// via <see cref="OpenSim.Framework.IClientAPI.OnSpinStart"/>
  343. /// via <see cref="OpenSim.Region.ClientStack.LindenUDP.LLClientView.HandleObjectSpinStart"/>
  344. /// </remarks>
  345. public event SceneGroupSpinStarted OnSceneGroupSpinStart;
  346. public delegate bool SceneGroupSpun(UUID groupID, Quaternion rotation);
  347. /// <summary>
  348. /// Triggered when an object is being spun.
  349. /// </summary>
  350. /// <remarks>
  351. /// Triggered by <see cref="TriggerGroupSpin"/>
  352. /// in <see cref="SceneObjectGroup.SpinMovement"/>
  353. /// via <see cref="SceneGraph.SpinObject"/>
  354. /// via <see cref="OpenSim.Framework.IClientAPI.OnSpinUpdate"/>
  355. /// via <see cref="OpenSim.Region.ClientStack.LindenUDP.LLClientView.HandleObjectSpinUpdate"/>
  356. /// </remarks>
  357. public event SceneGroupSpun OnSceneGroupSpin;
  358. public delegate void LandObjectAdded(ILandObject newParcel);
  359. public event LandObjectAdded OnLandObjectAdded;
  360. public delegate void LandObjectRemoved(UUID globalID);
  361. public event LandObjectRemoved OnLandObjectRemoved;
  362. public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID);
  363. public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
  364. public delegate void AvatarAppearanceChange(ScenePresence avatar);
  365. public event AvatarAppearanceChange OnAvatarAppearanceChange;
  366. public event Action<ScenePresence> OnSignificantClientMovement;
  367. public delegate void IncomingInstantMessage(GridInstantMessage message);
  368. public event IncomingInstantMessage OnIncomingInstantMessage;
  369. public event IncomingInstantMessage OnUnhandledInstantMessage;
  370. public delegate void ClientClosed(UUID clientID, Scene scene);
  371. /// <summary>
  372. /// Fired when a client is removed from a scene whether it's a child or a root agent.
  373. /// </summary>
  374. /// <remarks>
  375. /// At the point of firing, the scene still contains the client's scene presence.
  376. ///
  377. /// This is triggered under per-agent lock. So if you want to perform any long-running operations, please
  378. /// do this on a separate thread.
  379. /// </remarks>
  380. public event ClientClosed OnClientClosed;
  381. public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID);
  382. /// <summary>
  383. /// Fired when a script is created.
  384. /// </summary>
  385. /// <remarks>
  386. /// Occurs before OnRezScript
  387. /// Triggered by <see cref="TriggerNewScript"/>
  388. /// in <see cref="Scene.RezScriptFromAgentInventory"/>,
  389. /// <see cref="Scene.RezNewScript"/>
  390. /// </remarks>
  391. public event NewScript OnNewScript;
  392. public delegate void ExtraSettingChangedDelegate(Scene scene, string name, string value);
  393. public event ExtraSettingChangedDelegate OnExtraSettingChanged;
  394. public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID)
  395. {
  396. NewScript handlerNewScript = OnNewScript;
  397. if (handlerNewScript != null)
  398. {
  399. foreach (NewScript d in handlerNewScript.GetInvocationList())
  400. {
  401. try
  402. {
  403. d(clientID, part, itemID);
  404. }
  405. catch (Exception e)
  406. {
  407. m_log.ErrorFormat(
  408. "[EVENT MANAGER]: Delegate for TriggerNewScript failed - continuing. {0} {1}",
  409. e.Message, e.StackTrace);
  410. }
  411. }
  412. }
  413. }
  414. public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID);
  415. /// <summary>
  416. /// An indication that the script has changed.
  417. /// </summary>
  418. /// <remarks>
  419. /// Triggered after the scene receives a client's upload of an updated script and has stored it in an asset.
  420. /// Triggered by <see cref="TriggerUpdateScript"/>
  421. /// in <see cref="Scene.CapsUpdateTaskInventoryScriptAsset"/>
  422. /// via <see cref="Scene.CapsUpdateTaskInventoryScriptAsset"/>
  423. /// via <see cref="OpenSim.Region.ClientStack.Linden.BunchOfCaps.TaskScriptUpdated"/>
  424. /// via <see cref="OpenSim.Region.ClientStack.Linden.TaskInventoryScriptUpdater.OnUpLoad"/>
  425. /// via <see cref="OpenSim.Region.ClientStack.Linden.TaskInventoryScriptUpdater.uploaderCaps"/>
  426. /// </remarks>
  427. public event UpdateScript OnUpdateScript;
  428. public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID)
  429. {
  430. UpdateScript handlerUpdateScript = OnUpdateScript;
  431. if (handlerUpdateScript != null)
  432. {
  433. foreach (UpdateScript d in handlerUpdateScript.GetInvocationList())
  434. {
  435. try
  436. {
  437. d(clientId, itemId, primId, isScriptRunning, newAssetID);
  438. }
  439. catch (Exception e)
  440. {
  441. m_log.ErrorFormat(
  442. "[EVENT MANAGER]: Delegate for TriggerUpdateScript failed - continuing. {0} {1}",
  443. e.Message, e.StackTrace);
  444. }
  445. }
  446. }
  447. }
  448. /// <summary>
  449. /// Triggered when some scene object properties change.
  450. /// </summary>
  451. /// <remarks>
  452. /// ScriptChangedEvent is fired when a scene object property that a script might be interested
  453. /// in (such as color, scale or inventory) changes. Only enough information sent is for the LSL changed event.
  454. /// This is not an indication that the script has changed (see OnUpdateScript for that).
  455. /// This event is sent to a script to tell it that some property changed on
  456. /// the object the script is in. See http://lslwiki.net/lslwiki/wakka.php?wakka=changed .
  457. /// Triggered by <see cref="TriggerOnScriptChangedEvent"/>
  458. /// in <see cref="OpenSim.Region.CoreModules.Framework.EntityTransfer.EntityTransferModule.TeleportAgentWithinRegion"/>,
  459. /// <see cref="SceneObjectPart.TriggerScriptChangedEvent"/>
  460. /// </remarks>
  461. public event ScriptChangedEvent OnScriptChangedEvent;
  462. public delegate void ScriptChangedEvent(uint localID, uint change);
  463. public delegate void ScriptControlEvent(UUID item, UUID avatarID, uint held, uint changed);
  464. /// <summary>
  465. /// Triggered when a script receives control input from an agent.
  466. /// </summary>
  467. /// <remarks>
  468. /// Triggered by <see cref="TriggerControlEvent"/>
  469. /// in <see cref="ScenePresence.SendControlsToScripts"/>
  470. /// via <see cref="ScenePresence.HandleAgentUpdate"/>
  471. /// via <see cref="OpenSim.Framework.IClientAPI.OnAgentUpdate"/>
  472. /// via <see cref="OpenSim.Region.ClientStack.LindenUDP.LLClientView.HandleAgentUpdate"/>
  473. /// </remarks>
  474. public event ScriptControlEvent OnScriptControlEvent;
  475. public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos);
  476. /// <summary>
  477. /// Triggered when an object has arrived within a tolerance distance
  478. /// of a motion target.
  479. /// </summary>
  480. /// <remarks>
  481. /// Triggered by <see cref="TriggerAtTargetEvent"/>
  482. /// in <see cref="SceneObjectGroup.checkAtTargets"/>
  483. /// via <see cref="SceneObjectGroup.ScheduleGroupForFullUpdate"/>,
  484. /// <see cref="Scene.CheckAtTargets"/> via <see cref="Scene.Update"/>
  485. /// </remarks>
  486. public event ScriptAtTargetEvent OnScriptAtTargetEvent;
  487. public delegate void ScriptNotAtTargetEvent(uint localID);
  488. /// <summary>
  489. /// Triggered when an object has a motion target but has not arrived
  490. /// within a tolerance distance.
  491. /// </summary>
  492. /// <remarks>
  493. /// Triggered by <see cref="TriggerNotAtTargetEvent"/>
  494. /// in <see cref="SceneObjectGroup.checkAtTargets"/>
  495. /// via <see cref="SceneObjectGroup.ScheduleGroupForFullUpdate"/>,
  496. /// <see cref="Scene.CheckAtTargets"/> via <see cref="Scene.Update"/>
  497. /// </remarks>
  498. public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent;
  499. public delegate void ScriptAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion atrot);
  500. /// <summary>
  501. /// Triggered when an object has arrived within a tolerance rotation
  502. /// of a rotation target.
  503. /// </summary>
  504. /// <remarks>
  505. /// Triggered by <see cref="TriggerAtRotTargetEvent"/>
  506. /// in <see cref="SceneObjectGroup.checkAtTargets"/>
  507. /// via <see cref="SceneObjectGroup.ScheduleGroupForFullUpdate"/>,
  508. /// <see cref="Scene.CheckAtTargets"/> via <see cref="Scene.Update"/>
  509. /// </remarks>
  510. public event ScriptAtRotTargetEvent OnScriptAtRotTargetEvent;
  511. public delegate void ScriptNotAtRotTargetEvent(uint localID);
  512. /// <summary>
  513. /// Triggered when an object has a rotation target but has not arrived
  514. /// within a tolerance rotation.
  515. /// </summary>
  516. /// <remarks>
  517. /// Triggered by <see cref="TriggerNotAtRotTargetEvent"/>
  518. /// in <see cref="SceneObjectGroup.checkAtTargets"/>
  519. /// via <see cref="SceneObjectGroup.ScheduleGroupForFullUpdate"/>,
  520. /// <see cref="Scene.CheckAtTargets"/> via <see cref="Scene.Update"/>
  521. /// </remarks>
  522. public event ScriptNotAtRotTargetEvent OnScriptNotAtRotTargetEvent;
  523. public delegate void ScriptColliding(uint localID, ColliderArgs colliders);
  524. /// <summary>
  525. /// Triggered when a physical collision has started between a prim
  526. /// and something other than the region terrain.
  527. /// </summary>
  528. /// <remarks>
  529. /// Triggered by <see cref="TriggerScriptCollidingStart"/>
  530. /// in <see cref="SceneObjectPart.SendCollisionEvent"/>
  531. /// via <see cref="SceneObjectPart.PhysicsCollision"/>
  532. /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.OnCollisionUpdate"/>
  533. /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.SendCollisionUpdate"/>
  534. /// </remarks>
  535. public event ScriptColliding OnScriptColliderStart;
  536. /// <summary>
  537. /// Triggered when something that previously collided with a prim has
  538. /// not stopped colliding with it.
  539. /// </summary>
  540. /// <remarks>
  541. /// <seealso cref="OnScriptColliderStart"/>
  542. /// Triggered by <see cref="TriggerScriptColliding"/>
  543. /// in <see cref="SceneObjectPart.SendCollisionEvent"/>
  544. /// via <see cref="SceneObjectPart.PhysicsCollision"/>
  545. /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.OnCollisionUpdate"/>
  546. /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.SendCollisionUpdate"/>
  547. /// </remarks>
  548. public event ScriptColliding OnScriptColliding;
  549. /// <summary>
  550. /// Triggered when something that previously collided with a prim has
  551. /// stopped colliding with it.
  552. /// </summary>
  553. /// <remarks>
  554. /// Triggered by <see cref="TriggerScriptCollidingEnd"/>
  555. /// in <see cref="SceneObjectPart.SendCollisionEvent"/>
  556. /// via <see cref="SceneObjectPart.PhysicsCollision"/>
  557. /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.OnCollisionUpdate"/>
  558. /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.SendCollisionUpdate"/>
  559. /// </remarks>
  560. public event ScriptColliding OnScriptCollidingEnd;
  561. /// <summary>
  562. /// Triggered when a physical collision has started between an object
  563. /// and the region terrain.
  564. /// </summary>
  565. /// <remarks>
  566. /// Triggered by <see cref="TriggerScriptLandCollidingStart"/>
  567. /// in <see cref="SceneObjectPart.SendLandCollisionEvent"/>
  568. /// via <see cref="SceneObjectPart.PhysicsCollision"/>
  569. /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.OnCollisionUpdate"/>
  570. /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.SendCollisionUpdate"/>
  571. /// </remarks>
  572. public event ScriptColliding OnScriptLandColliderStart;
  573. /// <summary>
  574. /// Triggered when an object that previously collided with the region
  575. /// terrain has not yet stopped colliding with it.
  576. /// </summary>
  577. /// <remarks>
  578. /// Triggered by <see cref="TriggerScriptLandColliding"/>
  579. /// in <see cref="SceneObjectPart.SendLandCollisionEvent"/>
  580. /// via <see cref="SceneObjectPart.PhysicsCollision"/>
  581. /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.OnCollisionUpdate"/>
  582. /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.SendCollisionUpdate"/>
  583. /// </remarks>
  584. public event ScriptColliding OnScriptLandColliding;
  585. /// <summary>
  586. /// Triggered when an object that previously collided with the region
  587. /// terrain has stopped colliding with it.
  588. /// </summary>
  589. /// <remarks>
  590. /// Triggered by <see cref="TriggerScriptLandCollidingEnd"/>
  591. /// in <see cref="SceneObjectPart.SendLandCollisionEvent"/>
  592. /// via <see cref="SceneObjectPart.PhysicsCollision"/>
  593. /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.OnCollisionUpdate"/>
  594. /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.SendCollisionUpdate"/>
  595. /// </remarks>
  596. public event ScriptColliding OnScriptLandColliderEnd;
  597. public delegate void OnMakeChildAgentDelegate(ScenePresence presence);
  598. /// <summary>
  599. /// Triggered when an agent has been made a child agent of a scene.
  600. /// </summary>
  601. /// <remarks>
  602. /// Triggered by <see cref="TriggerOnMakeChildAgent"/>
  603. /// in <see cref="ScenePresence.MakeChildAgent"/>
  604. /// via <see cref="OpenSim.Region.CoreModules.Framework.EntityTransfer.EntityTransferModule.CrossAgentToNewRegionAsync"/>,
  605. /// <see cref="OpenSim.Region.CoreModules.Framework.EntityTransfer.EntityTransferModule.DoTeleport"/>,
  606. /// <see cref="OpenSim.Region.CoreModules.InterGrid.KillAUser.ShutdownNoLogout"/>
  607. /// </remarks>
  608. public event OnMakeChildAgentDelegate OnMakeChildAgent;
  609. public delegate void OnSaveNewWindlightProfileDelegate();
  610. public delegate void OnSendNewWindlightProfileTargetedDelegate(RegionLightShareData wl, UUID user);
  611. /// <summary>
  612. /// Triggered after the grunt work for adding a root agent to a
  613. /// scene has been performed (resuming attachment scripts, physics,
  614. /// animations etc.)
  615. /// </summary>
  616. /// <remarks>
  617. /// This event is on the critical path for transferring an avatar from one region to another. Try and do
  618. /// as little work on this event as possible, or do work asynchronously.
  619. /// Triggered after <see cref="OnSetRootAgentScene"/>
  620. /// by <see cref="TriggerOnMakeRootAgent"/>
  621. /// in <see cref="ScenePresence.MakeRootAgent"/>
  622. /// via <see cref="Scene.AgentCrossing"/>
  623. /// and <see cref="ScenePresence.CompleteMovement"/>
  624. /// </remarks>
  625. public event Action<ScenePresence> OnMakeRootAgent;
  626. public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted;
  627. public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile;
  628. /// <summary>
  629. /// Triggered when an object or attachment enters a scene
  630. /// </summary>
  631. public event OnIncomingSceneObjectDelegate OnIncomingSceneObject;
  632. public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so);
  633. public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel);
  634. public event NewInventoryItemUploadComplete OnNewInventoryItemUploadComplete;
  635. public delegate void RequestChangeWaterHeight(float height);
  636. public event RequestChangeWaterHeight OnRequestChangeWaterHeight;
  637. /// <summary>
  638. /// Fired if any avatar is 'killed' due to its health falling to zero
  639. /// </summary>
  640. public event AvatarKillData OnAvatarKilled;
  641. public delegate void AvatarKillData(uint KillerLocalID, ScenePresence avatar);
  642. /*
  643. public delegate void ScriptTimerEvent(uint localID, double timerinterval);
  644. /// <summary>
  645. /// Used to be triggered when the LSL timer event fires.
  646. /// </summary>
  647. /// <remarks>
  648. /// Triggered by <see cref="TriggerTimerEvent"/>
  649. /// via <see cref="SceneObjectPart.handleTimerAccounting"/>
  650. /// </remarks>
  651. public event ScriptTimerEvent OnScriptTimerEvent;
  652. */
  653. public delegate void EstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour);
  654. public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID);
  655. public event EstateToolsSunUpdate OnEstateToolsSunUpdate;
  656. /// <summary>
  657. /// Triggered when an object is added to the scene.
  658. /// </summary>
  659. /// <remarks>
  660. /// Triggered by <see cref="TriggerObjectAddedToScene"/>
  661. /// in <see cref="Scene.AddNewSceneObject"/>,
  662. /// <see cref="Scene.DuplicateObject"/>,
  663. /// <see cref="Scene.doObjectDuplicateOnRay"/>
  664. /// </remarks>
  665. public event Action<SceneObjectGroup> OnObjectAddedToScene;
  666. /// <summary>
  667. /// Delegate for <see cref="OnObjectBeingRemovedFromScene"/>
  668. /// </summary>
  669. /// <param name="obj">The object being removed from the scene</param>
  670. public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj);
  671. /// <summary>
  672. /// Triggered when an object is removed from the scene.
  673. /// </summary>
  674. /// <remarks>
  675. /// Triggered by <see cref="TriggerObjectBeingRemovedFromScene"/>
  676. /// in <see cref="Scene.DeleteSceneObject"/>
  677. /// </remarks>
  678. public event ObjectBeingRemovedFromScene OnObjectBeingRemovedFromScene;
  679. public delegate void NoticeNoLandDataFromStorage();
  680. public event NoticeNoLandDataFromStorage OnNoticeNoLandDataFromStorage;
  681. public delegate void IncomingLandDataFromStorage(List<LandData> data);
  682. public event IncomingLandDataFromStorage OnIncomingLandDataFromStorage;
  683. public delegate void SetAllowForcefulBan(bool allow);
  684. public event SetAllowForcefulBan OnSetAllowForcefulBan;
  685. public delegate void RequestParcelPrimCountUpdate();
  686. public event RequestParcelPrimCountUpdate OnRequestParcelPrimCountUpdate;
  687. public delegate void ParcelPrimCountTainted();
  688. /// <summary>
  689. /// Triggered when the parcel prim count has been altered.
  690. /// </summary>
  691. /// <remarks>
  692. /// Triggered by <see cref="TriggerParcelPrimCountTainted"/> in
  693. /// <see cref="OpenSim.Region.CoreModules.Avatar.Attachments.AttachmentsModule.DetachSingleAttachmentToGround"/>,
  694. /// <see cref="OpenSim.Region.CoreModules.Avatar.Attachments.AttachmentsModule.AttachToAgent"/>,
  695. /// <see cref="Scene.DeleteSceneObject"/>,
  696. /// <see cref="Scene.SelectPrim"/>,
  697. /// <see cref="Scene.DeselectPrim"/>,
  698. /// <see cref="SceneObjectGroup.UpdatePrimFlags"/>,
  699. /// <see cref="SceneObjectGroup.AbsolutePosition"/>
  700. /// </remarks>
  701. public event ParcelPrimCountTainted OnParcelPrimCountTainted;
  702. public event GetScriptRunning OnGetScriptRunning;
  703. /// <summary>
  704. /// RegisterCapsEvent is called by Scene after the Caps object
  705. /// has been instantiated and before it is return to the
  706. /// client and provides region modules to add their caps.
  707. /// </summary>
  708. public delegate void RegisterCapsEvent(UUID agentID, Caps caps);
  709. public event RegisterCapsEvent OnRegisterCaps;
  710. /// <summary>
  711. /// DeregisterCapsEvent is called by Scene when the caps
  712. /// handler for an agent are removed.
  713. /// </summary>
  714. public delegate void DeregisterCapsEvent(UUID agentID, Caps caps);
  715. public event DeregisterCapsEvent OnDeregisterCaps;
  716. /// <summary>
  717. /// ChatFromWorldEvent is called via Scene when a chat message
  718. /// from world comes in.
  719. /// </summary>
  720. public delegate void ChatFromWorldEvent(Object sender, OSChatMessage chat);
  721. public event ChatFromWorldEvent OnChatFromWorld;
  722. /// <summary>
  723. /// ChatFromClientEvent is triggered via ChatModule (or
  724. /// substitutes thereof) when a chat message
  725. /// from the client comes in.
  726. /// </summary>
  727. public delegate void ChatFromClientEvent(Object sender, OSChatMessage chat);
  728. public event ChatFromClientEvent OnChatFromClient;
  729. /// <summary>
  730. /// ChatToClientsEvent is triggered via ChatModule (or
  731. /// substitutes thereof) when a chat message is actually sent to clients. Clients will only be sent a
  732. /// received chat message if they satisfy various conditions (within audible range, etc.)
  733. /// </summary>
  734. public delegate void ChatToClientsEvent(
  735. UUID senderID, HashSet<UUID> receiverIDs,
  736. string message, ChatTypeEnum type, Vector3 fromPos, string fromName,
  737. ChatSourceType src, ChatAudibleLevel level);
  738. public event ChatToClientsEvent OnChatToClients;
  739. /// <summary>
  740. /// ChatBroadcastEvent is called via Scene when a broadcast chat message
  741. /// from world comes in
  742. /// </summary>
  743. public delegate void ChatBroadcastEvent(Object sender, OSChatMessage chat);
  744. public event ChatBroadcastEvent OnChatBroadcast;
  745. public delegate float SunLindenHour();
  746. public event SunLindenHour OnGetCurrentTimeAsLindenSunHour;
  747. /// <summary>
  748. /// Called when oar file has finished loading, although
  749. /// the scripts may not have started yet
  750. /// Message is non empty string if there were problems loading the oar file
  751. /// </summary>
  752. public delegate void OarFileLoaded(Guid guid, List<UUID> loadedScenes, string message);
  753. public event OarFileLoaded OnOarFileLoaded;
  754. /// <summary>
  755. /// Called when an oar file has finished saving
  756. /// Message is non empty string if there were problems saving the oar file
  757. /// If a guid was supplied on the original call to identify, the request, this is returned. Otherwise
  758. /// Guid.Empty is returned.
  759. /// </summary>
  760. public delegate void OarFileSaved(Guid guid, string message);
  761. public event OarFileSaved OnOarFileSaved;
  762. /// <summary>
  763. /// Called when the script compile queue becomes empty
  764. /// Returns the number of scripts which failed to start
  765. /// </summary>
  766. public delegate void EmptyScriptCompileQueue(int numScriptsFailed, string message);
  767. public event EmptyScriptCompileQueue OnEmptyScriptCompileQueue;
  768. /// <summary>
  769. /// Called whenever an object is attached, or detached from an in-world presence.
  770. /// </summary>
  771. /// If the object is being attached, then the avatarID will be present. If the object is being detached then
  772. /// the avatarID is UUID.Zero (I know, this doesn't make much sense but now it's historical).
  773. public delegate void Attach(uint localID, UUID itemID, UUID avatarID);
  774. public event Attach OnAttach;
  775. /// <summary>
  776. /// Called immediately after an object is loaded from storage.
  777. /// </summary>
  778. public event SceneObjectDelegate OnSceneObjectLoaded;
  779. public delegate void SceneObjectDelegate(SceneObjectGroup so);
  780. /// <summary>
  781. /// Called immediately before an object is saved to storage.
  782. /// </summary>
  783. /// <param name="persistingSo">
  784. /// The scene object being persisted.
  785. /// 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.
  786. /// </param>
  787. /// <param name="originalSo">
  788. /// The original scene object being persisted. Changes here will stay in memory but will not be saved to storage on this save.
  789. /// </param>
  790. public event SceneObjectPreSaveDelegate OnSceneObjectPreSave;
  791. public delegate void SceneObjectPreSaveDelegate(SceneObjectGroup persistingSo, SceneObjectGroup originalSo);
  792. /// <summary>
  793. /// Called when a scene object part is cloned within the region.
  794. /// </summary>
  795. /// <param name="copy"></param>
  796. /// <param name="original"></param>
  797. /// <param name="userExposed">True if the duplicate will immediately be in the scene, false otherwise</param>
  798. /// <remarks>
  799. /// Triggered in <see cref="OpenSim.Region.Framework.Scenes.SceneObjectPart.Copy"/>
  800. /// </remarks>
  801. public event SceneObjectPartCopyDelegate OnSceneObjectPartCopy;
  802. public delegate void SceneObjectPartCopyDelegate(SceneObjectPart copy, SceneObjectPart original, bool userExposed);
  803. public delegate void SceneObjectPartUpdated(SceneObjectPart sop, bool full);
  804. public event SceneObjectPartUpdated OnSceneObjectPartUpdated;
  805. public delegate void ScenePresenceUpdated(ScenePresence sp);
  806. public event ScenePresenceUpdated OnScenePresenceUpdated;
  807. public delegate void RegionUp(GridRegion region);
  808. public event RegionUp OnRegionUp;
  809. public delegate void RegionStarted(Scene scene);
  810. public event RegionStarted OnRegionStarted;
  811. public delegate void RegionHeartbeatEnd(Scene scene);
  812. public event RegionHeartbeatEnd OnRegionHeartbeatEnd;
  813. /// <summary>
  814. /// Fired when logins to a region are enabled or disabled.
  815. /// </summary>
  816. /// <remarks>
  817. ///
  818. /// </remarks>
  819. /// Fired
  820. public event RegionLoginsStatusChange OnRegionLoginsStatusChange;
  821. public delegate void RegionLoginsStatusChange(IScene scene);
  822. /// <summary>
  823. /// Fired when a region is considered ready for use.
  824. /// </summary>
  825. /// <remarks>
  826. /// A region is considered ready when startup operations such as loading of scripts already on the region
  827. /// have been completed.
  828. /// </remarks>
  829. public event Action<IScene> OnRegionReadyStatusChange;
  830. public delegate void PrimsLoaded(Scene s);
  831. public event PrimsLoaded OnPrimsLoaded;
  832. public delegate void TeleportStart(IClientAPI client, GridRegion destination, GridRegion finalDestination, uint teleportFlags, bool gridLogout);
  833. /// <summary>
  834. /// Triggered when a teleport starts
  835. /// </summary>
  836. /// <remarks>
  837. /// Triggered by <see cref="TriggerTeleportStart"/>
  838. /// in <see cref="OpenSim.Region.CoreModules.Framework.EntityTransfer.EntityTransferModule.CreateAgent"/>
  839. /// and <see cref="OpenSim.Region.CoreModules.Framework.EntityTransfer.HGEntityTransferModule.CreateAgent"/>
  840. /// via <see cref="OpenSim.Region.CoreModules.Framework.EntityTransfer.EntityTransferModule.DoTeleport"/>
  841. /// </remarks>
  842. public event TeleportStart OnTeleportStart;
  843. public delegate void TeleportFail(IClientAPI client, bool gridLogout);
  844. /// <summary>
  845. /// Trigered when a teleport fails.
  846. /// </summary>
  847. /// <remarks>
  848. /// Triggered by <see cref="TriggerTeleportFail"/>
  849. /// in <see cref="OpenSim.Region.CoreModules.Framework.EntityTransfer.EntityTransferModule.Fail"/>
  850. /// via <see cref="OpenSim.Region.CoreModules.Framework.EntityTransfer.EntityTransferModule.DoTeleport"/>
  851. /// </remarks>
  852. public event TeleportFail OnTeleportFail;
  853. public class MoneyTransferArgs : EventArgs
  854. {
  855. public UUID sender;
  856. public UUID receiver;
  857. /// <summary>
  858. /// Always false. The SL protocol sucks.
  859. /// </summary>
  860. public bool authenticated = false;
  861. public int amount;
  862. public int transactiontype;
  863. public string description;
  864. public MoneyTransferArgs(UUID asender, UUID areceiver, int aamount, int atransactiontype, string adescription)
  865. {
  866. sender = asender;
  867. receiver = areceiver;
  868. amount = aamount;
  869. transactiontype = atransactiontype;
  870. description = adescription;
  871. }
  872. }
  873. public class LandBuyArgs : EventArgs
  874. {
  875. public UUID agentId = UUID.Zero;
  876. public UUID groupId = UUID.Zero;
  877. public UUID parcelOwnerID = UUID.Zero;
  878. public bool final = false;
  879. public bool groupOwned = false;
  880. public bool removeContribution = false;
  881. public int parcelLocalID = 0;
  882. public int parcelArea = 0;
  883. public int parcelPrice = 0;
  884. public bool authenticated = false;
  885. public bool landValidated = false;
  886. public bool economyValidated = false;
  887. public int transactionID = 0;
  888. public int amountDebited = 0;
  889. public LandBuyArgs(UUID pagentId, UUID pgroupId, bool pfinal, bool pgroupOwned,
  890. bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice,
  891. bool pauthenticated)
  892. {
  893. agentId = pagentId;
  894. groupId = pgroupId;
  895. final = pfinal;
  896. groupOwned = pgroupOwned;
  897. removeContribution = premoveContribution;
  898. parcelLocalID = pparcelLocalID;
  899. parcelArea = pparcelArea;
  900. parcelPrice = pparcelPrice;
  901. authenticated = pauthenticated;
  902. }
  903. }
  904. public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e);
  905. public delegate void LandBuy(Object sender, LandBuyArgs e);
  906. /// <summary>
  907. /// Triggered when an attempt to transfer grid currency occurs
  908. /// </summary>
  909. /// <remarks>
  910. /// Triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.ProcessMoneyTransferRequest"/>
  911. /// via <see cref="OpenSim.Region.Framework.Scenes.Scene.SubscribeToClientGridEvents"/>
  912. /// via <see cref="OpenSim.Region.Framework.Scenes.Scene.SubscribeToClientEvents"/>
  913. /// via <see cref="OpenSim.Region.Framework.Scenes.Scene.AddNewClient"/>
  914. /// </remarks>
  915. public event MoneyTransferEvent OnMoneyTransfer;
  916. /// <summary>
  917. /// Triggered after after <see cref="OnValidateLandBuy"/>
  918. /// </summary>
  919. public event LandBuy OnLandBuy;
  920. /// <summary>
  921. /// Triggered to allow or prevent a real estate transaction
  922. /// </summary>
  923. /// <remarks>
  924. /// Triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.ProcessParcelBuy"/>
  925. /// <seealso cref="OpenSim.Region.OptionalModules.World.MoneyModule.SampleMoneyModule.ValidateLandBuy"/>
  926. /// </remarks>
  927. public event LandBuy OnValidateLandBuy;
  928. public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID)
  929. {
  930. Attach handlerOnAttach = OnAttach;
  931. if (handlerOnAttach != null)
  932. {
  933. foreach (Attach d in handlerOnAttach.GetInvocationList())
  934. {
  935. try
  936. {
  937. d(localID, itemID, avatarID);
  938. }
  939. catch (Exception e)
  940. {
  941. m_log.ErrorFormat(
  942. "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
  943. e.Message, e.StackTrace);
  944. }
  945. }
  946. }
  947. }
  948. public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
  949. {
  950. GetScriptRunning handlerGetScriptRunning = OnGetScriptRunning;
  951. if (handlerGetScriptRunning != null)
  952. {
  953. foreach (GetScriptRunning d in handlerGetScriptRunning.GetInvocationList())
  954. {
  955. try
  956. {
  957. d(controllingClient, objectID, itemID);
  958. }
  959. catch (Exception e)
  960. {
  961. m_log.ErrorFormat(
  962. "[EVENT MANAGER]: Delegate for TriggerGetScriptRunning failed - continuing. {0} {1}",
  963. e.Message, e.StackTrace);
  964. }
  965. }
  966. }
  967. }
  968. public void TriggerOnScriptChangedEvent(uint localID, uint change)
  969. {
  970. ScriptChangedEvent handlerScriptChangedEvent = OnScriptChangedEvent;
  971. if (handlerScriptChangedEvent != null)
  972. {
  973. foreach (ScriptChangedEvent d in handlerScriptChangedEvent.GetInvocationList())
  974. {
  975. try
  976. {
  977. d(localID, change);
  978. }
  979. catch (Exception e)
  980. {
  981. m_log.ErrorFormat(
  982. "[EVENT MANAGER]: Delegate for TriggerOnScriptChangedEvent failed - continuing. {0} {1}",
  983. e.Message, e.StackTrace);
  984. }
  985. }
  986. }
  987. }
  988. public void TriggerOnClientMovement(ScenePresence avatar)
  989. {
  990. ClientMovement handlerClientMovement = OnClientMovement;
  991. if (handlerClientMovement != null)
  992. {
  993. foreach (ClientMovement d in handlerClientMovement.GetInvocationList())
  994. {
  995. try
  996. {
  997. d(avatar);
  998. }
  999. catch (Exception e)
  1000. {
  1001. m_log.ErrorFormat(
  1002. "[EVENT MANAGER]: Delegate for TriggerOnClientMovement failed - continuing. {0} {1}",
  1003. e.Message, e.StackTrace);
  1004. }
  1005. }
  1006. }
  1007. }
  1008. public void TriggerPermissionError(UUID user, string reason)
  1009. {
  1010. OnPermissionErrorDelegate handlerPermissionError = OnPermissionError;
  1011. if (handlerPermissionError != null)
  1012. {
  1013. foreach (OnPermissionErrorDelegate d in handlerPermissionError.GetInvocationList())
  1014. {
  1015. try
  1016. {
  1017. d(user, reason);
  1018. }
  1019. catch (Exception e)
  1020. {
  1021. m_log.ErrorFormat(
  1022. "[EVENT MANAGER]: Delegate for TriggerPermissionError failed - continuing. {0} {1}",
  1023. e.Message, e.StackTrace);
  1024. }
  1025. }
  1026. }
  1027. }
  1028. public void TriggerOnPluginConsole(string[] args)
  1029. {
  1030. OnPluginConsoleDelegate handlerPluginConsole = OnPluginConsole;
  1031. if (handlerPluginConsole != null)
  1032. {
  1033. foreach (OnPluginConsoleDelegate d in handlerPluginConsole.GetInvocationList())
  1034. {
  1035. try
  1036. {
  1037. d(args);
  1038. }
  1039. catch (Exception e)
  1040. {
  1041. m_log.ErrorFormat(
  1042. "[EVENT MANAGER]: Delegate for TriggerOnPluginConsole failed - continuing. {0} {1}",
  1043. e.Message, e.StackTrace);
  1044. }
  1045. }
  1046. }
  1047. }
  1048. public void TriggerOnFrame()
  1049. {
  1050. OnFrameDelegate handlerFrame = OnFrame;
  1051. if (handlerFrame != null)
  1052. {
  1053. foreach (OnFrameDelegate d in handlerFrame.GetInvocationList())
  1054. {
  1055. try
  1056. {
  1057. d();
  1058. }
  1059. catch (Exception e)
  1060. {
  1061. m_log.ErrorFormat(
  1062. "[EVENT MANAGER]: Delegate for TriggerOnFrame failed - continuing. {0} {1}",
  1063. e.Message, e.StackTrace);
  1064. }
  1065. }
  1066. }
  1067. }
  1068. public void TriggerOnNewClient(IClientAPI client)
  1069. {
  1070. OnNewClientDelegate handlerNewClient = OnNewClient;
  1071. if (handlerNewClient != null)
  1072. {
  1073. foreach (OnNewClientDelegate d in handlerNewClient.GetInvocationList())
  1074. {
  1075. try
  1076. {
  1077. d(client);
  1078. }
  1079. catch (Exception e)
  1080. {
  1081. m_log.ErrorFormat(
  1082. "[EVENT MANAGER]: Delegate for TriggerOnNewClient failed - continuing. {0} {1}",
  1083. e.Message, e.StackTrace);
  1084. }
  1085. }
  1086. }
  1087. if (client is IClientCore)
  1088. {
  1089. OnClientConnectCoreDelegate handlerClientConnect = OnClientConnect;
  1090. if (handlerClientConnect != null)
  1091. {
  1092. foreach (OnClientConnectCoreDelegate d in handlerClientConnect.GetInvocationList())
  1093. {
  1094. try
  1095. {
  1096. d((IClientCore)client);
  1097. }
  1098. catch (Exception e)
  1099. {
  1100. m_log.ErrorFormat(
  1101. "[EVENT MANAGER]: Delegate for TriggerOnNewClient (IClientCore) failed - continuing. {0} {1}",
  1102. e.Message, e.StackTrace);
  1103. }
  1104. }
  1105. }
  1106. }
  1107. }
  1108. public void TriggerOnClientLogin(IClientAPI client)
  1109. {
  1110. Action<IClientAPI> handlerClientLogin = OnClientLogin;
  1111. if (handlerClientLogin != null)
  1112. {
  1113. foreach (Action<IClientAPI> d in handlerClientLogin.GetInvocationList())
  1114. {
  1115. try
  1116. {
  1117. d(client);
  1118. }
  1119. catch (Exception e)
  1120. {
  1121. m_log.ErrorFormat(
  1122. "[EVENT MANAGER]: Delegate for TriggerOnClientLogin failed - continuing. {0} {1}",
  1123. e.Message, e.StackTrace);
  1124. }
  1125. }
  1126. }
  1127. }
  1128. public void TriggerOnNewPresence(ScenePresence presence)
  1129. {
  1130. OnNewPresenceDelegate handlerNewPresence = OnNewPresence;
  1131. if (handlerNewPresence != null)
  1132. {
  1133. foreach (OnNewPresenceDelegate d in handlerNewPresence.GetInvocationList())
  1134. {
  1135. try
  1136. {
  1137. d(presence);
  1138. }
  1139. catch (Exception e)
  1140. {
  1141. m_log.ErrorFormat(
  1142. "[EVENT MANAGER]: Delegate for TriggerOnNewPresence failed - continuing. {0} {1}",
  1143. e.Message, e.StackTrace);
  1144. }
  1145. }
  1146. }
  1147. }
  1148. public void TriggerOnRemovePresence(UUID agentId)
  1149. {
  1150. OnRemovePresenceDelegate handlerRemovePresence = OnRemovePresence;
  1151. if (handlerRemovePresence != null)
  1152. {
  1153. foreach (OnRemovePresenceDelegate d in handlerRemovePresence.GetInvocationList())
  1154. {
  1155. try
  1156. {
  1157. d(agentId);
  1158. }
  1159. catch (Exception e)
  1160. {
  1161. m_log.ErrorFormat(
  1162. "[EVENT MANAGER]: Delegate for TriggerOnRemovePresence failed - continuing. {0} {1}",
  1163. e.Message, e.StackTrace);
  1164. }
  1165. }
  1166. }
  1167. }
  1168. public void TriggerOnBackup(ISimulationDataService dstore, bool forced)
  1169. {
  1170. OnBackupDelegate handlerOnAttach = OnBackup;
  1171. if (handlerOnAttach != null)
  1172. {
  1173. foreach (OnBackupDelegate d in handlerOnAttach.GetInvocationList())
  1174. {
  1175. try
  1176. {
  1177. d(dstore, forced);
  1178. }
  1179. catch (Exception e)
  1180. {
  1181. m_log.ErrorFormat(
  1182. "[EVENT MANAGER]: Delegate for TriggerOnBackup failed - continuing. {0} {1}",
  1183. e.Message, e.StackTrace);
  1184. }
  1185. }
  1186. }
  1187. }
  1188. public void TriggerParcelPrimCountUpdate()
  1189. {
  1190. OnParcelPrimCountUpdateDelegate handlerParcelPrimCountUpdate = OnParcelPrimCountUpdate;
  1191. if (handlerParcelPrimCountUpdate != null)
  1192. {
  1193. foreach (OnParcelPrimCountUpdateDelegate d in handlerParcelPrimCountUpdate.GetInvocationList())
  1194. {
  1195. try
  1196. {
  1197. d();
  1198. }
  1199. catch (Exception e)
  1200. {
  1201. m_log.ErrorFormat(
  1202. "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountUpdate failed - continuing. {0} {1}",
  1203. e.Message, e.StackTrace);
  1204. }
  1205. }
  1206. }
  1207. }
  1208. public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs args)
  1209. {
  1210. MoneyTransferEvent handlerMoneyTransfer = OnMoneyTransfer;
  1211. if (handlerMoneyTransfer != null)
  1212. {
  1213. foreach (MoneyTransferEvent d in handlerMoneyTransfer.GetInvocationList())
  1214. {
  1215. try
  1216. {
  1217. d(sender, args);
  1218. }
  1219. catch (Exception e)
  1220. {
  1221. m_log.ErrorFormat(
  1222. "[EVENT MANAGER]: Delegate for TriggerMoneyTransfer failed - continuing. {0} {1}",
  1223. e.Message, e.StackTrace);
  1224. }
  1225. }
  1226. }
  1227. }
  1228. public void TriggerTerrainTick()
  1229. {
  1230. OnTerrainTickDelegate handlerTerrainTick = OnTerrainTick;
  1231. if (handlerTerrainTick != null)
  1232. {
  1233. foreach (OnTerrainTickDelegate d in handlerTerrainTick.GetInvocationList())
  1234. {
  1235. try
  1236. {
  1237. d();
  1238. }
  1239. catch (Exception e)
  1240. {
  1241. m_log.ErrorFormat(
  1242. "[EVENT MANAGER]: Delegate for TriggerTerrainTick failed - continuing. {0} {1}",
  1243. e.Message, e.StackTrace);
  1244. }
  1245. }
  1246. }
  1247. }
  1248. public void TriggerTerrainTainted()
  1249. {
  1250. OnTerrainTaintedDelegate handlerTerrainTainted = OnTerrainTainted;
  1251. if (handlerTerrainTainted != null)
  1252. {
  1253. foreach (OnTerrainTaintedDelegate d in handlerTerrainTainted.GetInvocationList())
  1254. {
  1255. try
  1256. {
  1257. d();
  1258. }
  1259. catch (Exception e)
  1260. {
  1261. m_log.ErrorFormat(
  1262. "[EVENT MANAGER]: Delegate for TriggerTerrainTainted failed - continuing. {0} {1}",
  1263. e.Message, e.StackTrace);
  1264. }
  1265. }
  1266. }
  1267. }
  1268. public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
  1269. {
  1270. OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = OnParcelPrimCountAdd;
  1271. if (handlerParcelPrimCountAdd != null)
  1272. {
  1273. foreach (OnParcelPrimCountAddDelegate d in handlerParcelPrimCountAdd.GetInvocationList())
  1274. {
  1275. try
  1276. {
  1277. d(obj);
  1278. }
  1279. catch (Exception e)
  1280. {
  1281. m_log.ErrorFormat(
  1282. "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountAdd failed - continuing. {0} {1}",
  1283. e.Message, e.StackTrace);
  1284. }
  1285. }
  1286. }
  1287. }
  1288. public void TriggerObjectAddedToScene(SceneObjectGroup obj)
  1289. {
  1290. Action<SceneObjectGroup> handler = OnObjectAddedToScene;
  1291. if (handler != null)
  1292. {
  1293. foreach (Action<SceneObjectGroup> d in handler.GetInvocationList())
  1294. {
  1295. try
  1296. {
  1297. d(obj);
  1298. }
  1299. catch (Exception e)
  1300. {
  1301. m_log.ErrorFormat(
  1302. "[EVENT MANAGER]: Delegate for TriggerObjectAddedToScene failed - continuing. {0} {1}",
  1303. e.Message, e.StackTrace);
  1304. }
  1305. }
  1306. }
  1307. }
  1308. public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj)
  1309. {
  1310. ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene;
  1311. if (handlerObjectBeingRemovedFromScene != null)
  1312. {
  1313. foreach (ObjectBeingRemovedFromScene d in handlerObjectBeingRemovedFromScene.GetInvocationList())
  1314. {
  1315. try
  1316. {
  1317. d(obj);
  1318. }
  1319. catch (Exception e)
  1320. {
  1321. m_log.ErrorFormat(
  1322. "[EVENT MANAGER]: Delegate for TriggerObjectBeingRemovedFromScene failed - continuing. {0} {1}",
  1323. e.Message, e.StackTrace);
  1324. }
  1325. }
  1326. }
  1327. }
  1328. public void TriggerShutdown()
  1329. {
  1330. Action handlerShutdown = OnShutdown;
  1331. if (handlerShutdown != null)
  1332. {
  1333. foreach (Action d in handlerShutdown.GetInvocationList())
  1334. {
  1335. try
  1336. {
  1337. d();
  1338. }
  1339. catch (Exception e)
  1340. {
  1341. m_log.ErrorFormat(
  1342. "[EVENT MANAGER]: Delegate for TriggerShutdown failed - continuing. {0} {1}",
  1343. e.Message, e.StackTrace);
  1344. }
  1345. }
  1346. }
  1347. }
  1348. public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
  1349. {
  1350. ObjectGrabDelegate handlerObjectGrab = OnObjectGrab;
  1351. if (handlerObjectGrab != null)
  1352. {
  1353. foreach (ObjectGrabDelegate d in handlerObjectGrab.GetInvocationList())
  1354. {
  1355. try
  1356. {
  1357. d(localID, originalID, offsetPos, remoteClient, surfaceArgs);
  1358. }
  1359. catch (Exception e)
  1360. {
  1361. m_log.ErrorFormat(
  1362. "[EVENT MANAGER]: Delegate for TriggerObjectGrab failed - continuing. {0} {1}",
  1363. e.Message, e.StackTrace);
  1364. }
  1365. }
  1366. }
  1367. }
  1368. public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
  1369. {
  1370. ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing;
  1371. if (handlerObjectGrabbing != null)
  1372. {
  1373. foreach (ObjectGrabDelegate d in handlerObjectGrabbing.GetInvocationList())
  1374. {
  1375. try
  1376. {
  1377. d(localID, originalID, offsetPos, remoteClient, surfaceArgs);
  1378. }
  1379. catch (Exception e)
  1380. {
  1381. m_log.ErrorFormat(
  1382. "[EVENT MANAGER]: Delegate for TriggerObjectGrabbing failed - continuing. {0} {1}",
  1383. e.Message, e.StackTrace);
  1384. }
  1385. }
  1386. }
  1387. }
  1388. public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
  1389. {
  1390. ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab;
  1391. if (handlerObjectDeGrab != null)
  1392. {
  1393. foreach (ObjectDeGrabDelegate d in handlerObjectDeGrab.GetInvocationList())
  1394. {
  1395. try
  1396. {
  1397. d(localID, originalID, remoteClient, surfaceArgs);
  1398. }
  1399. catch (Exception e)
  1400. {
  1401. m_log.ErrorFormat(
  1402. "[EVENT MANAGER]: Delegate for TriggerObjectDeGrab failed - continuing. {0} {1}",
  1403. e.Message, e.StackTrace);
  1404. }
  1405. }
  1406. }
  1407. }
  1408. public void TriggerScriptReset(uint localID, UUID itemID)
  1409. {
  1410. ScriptResetDelegate handlerScriptReset = OnScriptReset;
  1411. if (handlerScriptReset != null)
  1412. {
  1413. foreach (ScriptResetDelegate d in handlerScriptReset.GetInvocationList())
  1414. {
  1415. try
  1416. {
  1417. d(localID, itemID);
  1418. }
  1419. catch (Exception e)
  1420. {
  1421. m_log.ErrorFormat(
  1422. "[EVENT MANAGER]: Delegate for TriggerScriptReset failed - continuing. {0} {1}",
  1423. e.Message, e.StackTrace);
  1424. }
  1425. }
  1426. }
  1427. }
  1428. public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource)
  1429. {
  1430. NewRezScript handlerRezScript = OnRezScript;
  1431. if (handlerRezScript != null)
  1432. {
  1433. foreach (NewRezScript d in handlerRezScript.GetInvocationList())
  1434. {
  1435. try
  1436. {
  1437. d(localID, itemID, script, startParam, postOnRez, engine, stateSource);
  1438. }
  1439. catch (Exception e)
  1440. {
  1441. m_log.ErrorFormat(
  1442. "[EVENT MANAGER]: Delegate for TriggerRezScript failed - continuing. {0} {1}",
  1443. e.Message, e.StackTrace);
  1444. }
  1445. }
  1446. }
  1447. }
  1448. public void TriggerStartScript(uint localID, UUID itemID)
  1449. {
  1450. StartScript handlerStartScript = OnStartScript;
  1451. if (handlerStartScript != null)
  1452. {
  1453. foreach (StartScript d in handlerStartScript.GetInvocationList())
  1454. {
  1455. try
  1456. {
  1457. d(localID, itemID);
  1458. }
  1459. catch (Exception e)
  1460. {
  1461. m_log.ErrorFormat(
  1462. "[EVENT MANAGER]: Delegate for TriggerStartScript failed - continuing. {0} {1}",
  1463. e.Message, e.StackTrace);
  1464. }
  1465. }
  1466. }
  1467. }
  1468. public void TriggerStopScript(uint localID, UUID itemID)
  1469. {
  1470. StopScript handlerStopScript = OnStopScript;
  1471. if (handlerStopScript != null)
  1472. {
  1473. foreach (StopScript d in handlerStopScript.GetInvocationList())
  1474. {
  1475. try
  1476. {
  1477. d(localID, itemID);
  1478. }
  1479. catch (Exception e)
  1480. {
  1481. m_log.ErrorFormat(
  1482. "[EVENT MANAGER]: Delegate for TriggerStopScript failed - continuing. {0} {1}",
  1483. e.Message, e.StackTrace);
  1484. }
  1485. }
  1486. }
  1487. }
  1488. public void TriggerRemoveScript(uint localID, UUID itemID)
  1489. {
  1490. RemoveScript handlerRemoveScript = OnRemoveScript;
  1491. if (handlerRemoveScript != null)
  1492. {
  1493. foreach (RemoveScript d in handlerRemoveScript.GetInvocationList())
  1494. {
  1495. try
  1496. {
  1497. d(localID, itemID);
  1498. }
  1499. catch (Exception e)
  1500. {
  1501. m_log.ErrorFormat(
  1502. "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}",
  1503. e.Message, e.StackTrace);
  1504. }
  1505. }
  1506. }
  1507. }
  1508. public bool TriggerGroupMove(UUID groupID, Vector3 delta)
  1509. {
  1510. bool result = true;
  1511. SceneGroupMoved handlerSceneGroupMove = OnSceneGroupMove;
  1512. if (handlerSceneGroupMove != null)
  1513. {
  1514. foreach (SceneGroupMoved d in handlerSceneGroupMove.GetInvocationList())
  1515. {
  1516. try
  1517. {
  1518. if (d(groupID, delta) == false)
  1519. result = false;
  1520. }
  1521. catch (Exception e)
  1522. {
  1523. m_log.ErrorFormat(
  1524. "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
  1525. e.Message, e.StackTrace);
  1526. }
  1527. }
  1528. }
  1529. return result;
  1530. }
  1531. public bool TriggerGroupSpinStart(UUID groupID)
  1532. {
  1533. bool result = true;
  1534. SceneGroupSpinStarted handlerSceneGroupSpinStarted = OnSceneGroupSpinStart;
  1535. if (handlerSceneGroupSpinStarted != null)
  1536. {
  1537. foreach (SceneGroupSpinStarted d in handlerSceneGroupSpinStarted.GetInvocationList())
  1538. {
  1539. try
  1540. {
  1541. if (d(groupID) == false)
  1542. result = false;
  1543. }
  1544. catch (Exception e)
  1545. {
  1546. m_log.ErrorFormat(
  1547. "[EVENT MANAGER]: Delegate for TriggerGroupSpinStart failed - continuing. {0} {1}",
  1548. e.Message, e.StackTrace);
  1549. }
  1550. }
  1551. }
  1552. return result;
  1553. }
  1554. public bool TriggerGroupSpin(UUID groupID, Quaternion rotation)
  1555. {
  1556. bool result = true;
  1557. SceneGroupSpun handlerSceneGroupSpin = OnSceneGroupSpin;
  1558. if (handlerSceneGroupSpin != null)
  1559. {
  1560. foreach (SceneGroupSpun d in handlerSceneGroupSpin.GetInvocationList())
  1561. {
  1562. try
  1563. {
  1564. if (d(groupID, rotation) == false)
  1565. result = false;
  1566. }
  1567. catch (Exception e)
  1568. {
  1569. m_log.ErrorFormat(
  1570. "[EVENT MANAGER]: Delegate for TriggerGroupSpin failed - continuing. {0} {1}",
  1571. e.Message, e.StackTrace);
  1572. }
  1573. }
  1574. }
  1575. return result;
  1576. }
  1577. public void TriggerGroupGrab(UUID groupID, Vector3 offset, UUID userID)
  1578. {
  1579. SceneGroupGrabed handlerSceneGroupGrab = OnSceneGroupGrab;
  1580. if (handlerSceneGroupGrab != null)
  1581. {
  1582. foreach (SceneGroupGrabed d in handlerSceneGroupGrab.GetInvocationList())
  1583. {
  1584. try
  1585. {
  1586. d(groupID, offset, userID);
  1587. }
  1588. catch (Exception e)
  1589. {
  1590. m_log.ErrorFormat(
  1591. "[EVENT MANAGER]: Delegate for TriggerGroupGrab failed - continuing. {0} {1}",
  1592. e.Message, e.StackTrace);
  1593. }
  1594. }
  1595. }
  1596. }
  1597. public void TriggerLandObjectAdded(ILandObject newParcel)
  1598. {
  1599. LandObjectAdded handlerLandObjectAdded = OnLandObjectAdded;
  1600. if (handlerLandObjectAdded != null)
  1601. {
  1602. foreach (LandObjectAdded d in handlerLandObjectAdded.GetInvocationList())
  1603. {
  1604. try
  1605. {
  1606. d(newParcel);
  1607. }
  1608. catch (Exception e)
  1609. {
  1610. m_log.ErrorFormat(
  1611. "[EVENT MANAGER]: Delegate for TriggerLandObjectAdded failed - continuing. {0} {1}",
  1612. e.Message, e.StackTrace);
  1613. }
  1614. }
  1615. }
  1616. }
  1617. public void TriggerLandObjectRemoved(UUID globalID)
  1618. {
  1619. LandObjectRemoved handlerLandObjectRemoved = OnLandObjectRemoved;
  1620. if (handlerLandObjectRemoved != null)
  1621. {
  1622. foreach (LandObjectRemoved d in handlerLandObjectRemoved.GetInvocationList())
  1623. {
  1624. try
  1625. {
  1626. d(globalID);
  1627. }
  1628. catch (Exception e)
  1629. {
  1630. m_log.ErrorFormat(
  1631. "[EVENT MANAGER]: Delegate for TriggerLandObjectRemoved failed - continuing. {0} {1}",
  1632. e.Message, e.StackTrace);
  1633. }
  1634. }
  1635. }
  1636. }
  1637. public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel)
  1638. {
  1639. TriggerLandObjectAdded(newParcel);
  1640. }
  1641. public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID)
  1642. {
  1643. AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel;
  1644. if (handlerAvatarEnteringNewParcel != null)
  1645. {
  1646. foreach (AvatarEnteringNewParcel d in handlerAvatarEnteringNewParcel.GetInvocationList())
  1647. {
  1648. try
  1649. {
  1650. d(avatar, localLandID, regionID);
  1651. }
  1652. catch (Exception e)
  1653. {
  1654. m_log.ErrorFormat(
  1655. "[EVENT MANAGER]: Delegate for TriggerAvatarEnteringNewParcel failed - continuing. {0} {1}",
  1656. e.Message, e.StackTrace);
  1657. }
  1658. }
  1659. }
  1660. }
  1661. public void TriggerAvatarAppearanceChanged(ScenePresence avatar)
  1662. {
  1663. AvatarAppearanceChange handler = OnAvatarAppearanceChange;
  1664. if (handler != null)
  1665. {
  1666. foreach (AvatarAppearanceChange d in handler.GetInvocationList())
  1667. {
  1668. try
  1669. {
  1670. d(avatar);
  1671. }
  1672. catch (Exception e)
  1673. {
  1674. m_log.ErrorFormat(
  1675. "[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing. {0} {1}",
  1676. e.Message, e.StackTrace);
  1677. }
  1678. }
  1679. }
  1680. }
  1681. public void TriggerIncomingInstantMessage(GridInstantMessage message)
  1682. {
  1683. IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage;
  1684. if (handlerIncomingInstantMessage != null)
  1685. {
  1686. foreach (IncomingInstantMessage d in handlerIncomingInstantMessage.GetInvocationList())
  1687. {
  1688. try
  1689. {
  1690. d(message);
  1691. }
  1692. catch (Exception e)
  1693. {
  1694. m_log.ErrorFormat(
  1695. "[EVENT MANAGER]: Delegate for TriggerIncomingInstantMessage failed - continuing. {0} {1}",
  1696. e.Message, e.StackTrace);
  1697. }
  1698. }
  1699. }
  1700. }
  1701. public void TriggerUnhandledInstantMessage(GridInstantMessage message)
  1702. {
  1703. IncomingInstantMessage handlerUnhandledInstantMessage = OnUnhandledInstantMessage;
  1704. if (handlerUnhandledInstantMessage != null)
  1705. {
  1706. foreach (IncomingInstantMessage d in handlerUnhandledInstantMessage.GetInvocationList())
  1707. {
  1708. try
  1709. {
  1710. d(message);
  1711. }
  1712. catch (Exception e)
  1713. {
  1714. m_log.ErrorFormat(
  1715. "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
  1716. e.Message, e.StackTrace);
  1717. }
  1718. }
  1719. }
  1720. }
  1721. public void TriggerClientClosed(UUID ClientID, Scene scene)
  1722. {
  1723. ClientClosed handlerClientClosed = OnClientClosed;
  1724. if (handlerClientClosed != null)
  1725. {
  1726. foreach (ClientClosed d in handlerClientClosed.GetInvocationList())
  1727. {
  1728. try
  1729. {
  1730. d(ClientID, scene);
  1731. }
  1732. catch (Exception e)
  1733. {
  1734. m_log.ErrorFormat(
  1735. "[EVENT MANAGER]: Delegate for TriggerClientClosed failed - continuing. {0} {1}",
  1736. e.Message, e.StackTrace);
  1737. }
  1738. }
  1739. }
  1740. }
  1741. public void TriggerOnMakeChildAgent(ScenePresence presence)
  1742. {
  1743. OnMakeChildAgentDelegate handlerMakeChildAgent = OnMakeChildAgent;
  1744. if (handlerMakeChildAgent != null)
  1745. {
  1746. foreach (OnMakeChildAgentDelegate d in handlerMakeChildAgent.GetInvocationList())
  1747. {
  1748. try
  1749. {
  1750. d(presence);
  1751. }
  1752. catch (Exception e)
  1753. {
  1754. m_log.ErrorFormat(
  1755. "[EVENT MANAGER]: Delegate for TriggerOnMakeChildAgent failed - continuing. {0} {1}",
  1756. e.Message, e.StackTrace);
  1757. }
  1758. }
  1759. }
  1760. }
  1761. public void TriggerOnSendNewWindlightProfileTargeted(RegionLightShareData wl, UUID user)
  1762. {
  1763. OnSendNewWindlightProfileTargetedDelegate handlerSendNewWindlightProfileTargeted = OnSendNewWindlightProfileTargeted;
  1764. if (handlerSendNewWindlightProfileTargeted != null)
  1765. {
  1766. handlerSendNewWindlightProfileTargeted(wl, user);
  1767. }
  1768. }
  1769. public void TriggerOnSaveNewWindlightProfile()
  1770. {
  1771. OnSaveNewWindlightProfileDelegate handlerSaveNewWindlightProfile = OnSaveNewWindlightProfile;
  1772. if (handlerSaveNewWindlightProfile != null)
  1773. {
  1774. handlerSaveNewWindlightProfile();
  1775. }
  1776. }
  1777. public void TriggerOnMakeRootAgent(ScenePresence presence)
  1778. {
  1779. Action<ScenePresence> handlerMakeRootAgent = OnMakeRootAgent;
  1780. if (handlerMakeRootAgent != null)
  1781. {
  1782. foreach (Action<ScenePresence> d in handlerMakeRootAgent.GetInvocationList())
  1783. {
  1784. try
  1785. {
  1786. d(presence);
  1787. }
  1788. catch (Exception e)
  1789. {
  1790. m_log.ErrorFormat(
  1791. "[EVENT MANAGER]: Delegate for TriggerOnMakeRootAgent failed - continuing. {0} {1}",
  1792. e.Message, e.StackTrace);
  1793. }
  1794. }
  1795. }
  1796. }
  1797. public void TriggerOnIncomingSceneObject(SceneObjectGroup so)
  1798. {
  1799. OnIncomingSceneObjectDelegate handlerIncomingSceneObject = OnIncomingSceneObject;
  1800. if (handlerIncomingSceneObject != null)
  1801. {
  1802. foreach (OnIncomingSceneObjectDelegate d in handlerIncomingSceneObject.GetInvocationList())
  1803. {
  1804. try
  1805. {
  1806. d(so);
  1807. }
  1808. catch (Exception e)
  1809. {
  1810. m_log.ErrorFormat(
  1811. "[EVENT MANAGER]: Delegate for TriggerOnIncomingSceneObject failed - continuing. {0} {1}",
  1812. e.Message, e.StackTrace);
  1813. }
  1814. }
  1815. }
  1816. }
  1817. public void TriggerOnRegisterCaps(UUID agentID, Caps caps)
  1818. {
  1819. RegisterCapsEvent handlerRegisterCaps = OnRegisterCaps;
  1820. if (handlerRegisterCaps != null)
  1821. {
  1822. foreach (RegisterCapsEvent d in handlerRegisterCaps.GetInvocationList())
  1823. {
  1824. try
  1825. {
  1826. d(agentID, caps);
  1827. }
  1828. catch (Exception e)
  1829. {
  1830. m_log.ErrorFormat(
  1831. "[EVENT MANAGER]: Delegate for TriggerOnRegisterCaps failed - continuing. {0} {1}",
  1832. e.Message, e.StackTrace);
  1833. }
  1834. }
  1835. }
  1836. }
  1837. public void TriggerOnDeregisterCaps(UUID agentID, Caps caps)
  1838. {
  1839. DeregisterCapsEvent handlerDeregisterCaps = OnDeregisterCaps;
  1840. if (handlerDeregisterCaps != null)
  1841. {
  1842. foreach (DeregisterCapsEvent d in handlerDeregisterCaps.GetInvocationList())
  1843. {
  1844. try
  1845. {
  1846. d(agentID, caps);
  1847. }
  1848. catch (Exception e)
  1849. {
  1850. m_log.ErrorFormat(
  1851. "[EVENT MANAGER]: Delegate for TriggerOnDeregisterCaps failed - continuing. {0} {1}",
  1852. e.Message, e.StackTrace);
  1853. }
  1854. }
  1855. }
  1856. }
  1857. public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel)
  1858. {
  1859. NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete;
  1860. if (handlerNewInventoryItemUpdateComplete != null)
  1861. {
  1862. foreach (NewInventoryItemUploadComplete d in handlerNewInventoryItemUpdateComplete.GetInvocationList())
  1863. {
  1864. try
  1865. {
  1866. d(agentID, AssetID, AssetName, userlevel);
  1867. }
  1868. catch (Exception e)
  1869. {
  1870. m_log.ErrorFormat(
  1871. "[EVENT MANAGER]: Delegate for TriggerOnNewInventoryItemUploadComplete failed - continuing. {0} {1}",
  1872. e.Message, e.StackTrace);
  1873. }
  1874. }
  1875. }
  1876. }
  1877. public void TriggerLandBuy(Object sender, LandBuyArgs args)
  1878. {
  1879. LandBuy handlerLandBuy = OnLandBuy;
  1880. if (handlerLandBuy != null)
  1881. {
  1882. foreach (LandBuy d in handlerLandBuy.GetInvocationList())
  1883. {
  1884. try
  1885. {
  1886. d(sender, args);
  1887. }
  1888. catch (Exception e)
  1889. {
  1890. m_log.ErrorFormat(
  1891. "[EVENT MANAGER]: Delegate for TriggerLandBuy failed - continuing. {0} {1}",
  1892. e.Message, e.StackTrace);
  1893. }
  1894. }
  1895. }
  1896. }
  1897. public void TriggerValidateLandBuy(Object sender, LandBuyArgs args)
  1898. {
  1899. LandBuy handlerValidateLandBuy = OnValidateLandBuy;
  1900. if (handlerValidateLandBuy != null)
  1901. {
  1902. foreach (LandBuy d in handlerValidateLandBuy.GetInvocationList())
  1903. {
  1904. try
  1905. {
  1906. d(sender, args);
  1907. }
  1908. catch (Exception e)
  1909. {
  1910. m_log.ErrorFormat(
  1911. "[EVENT MANAGER]: Delegate for TriggerValidateLandBuy failed - continuing. {0} {1}",
  1912. e.Message, e.StackTrace);
  1913. }
  1914. }
  1915. }
  1916. }
  1917. public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos)
  1918. {
  1919. ScriptAtTargetEvent handlerScriptAtTargetEvent = OnScriptAtTargetEvent;
  1920. if (handlerScriptAtTargetEvent != null)
  1921. {
  1922. foreach (ScriptAtTargetEvent d in handlerScriptAtTargetEvent.GetInvocationList())
  1923. {
  1924. try
  1925. {
  1926. d(localID, handle, targetpos, currentpos);
  1927. }
  1928. catch (Exception e)
  1929. {
  1930. m_log.ErrorFormat(
  1931. "[EVENT MANAGER]: Delegate for TriggerAtTargetEvent failed - continuing. {0} {1}",
  1932. e.Message, e.StackTrace);
  1933. }
  1934. }
  1935. }
  1936. }
  1937. public void TriggerNotAtTargetEvent(uint localID)
  1938. {
  1939. ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = OnScriptNotAtTargetEvent;
  1940. if (handlerScriptNotAtTargetEvent != null)
  1941. {
  1942. foreach (ScriptNotAtTargetEvent d in handlerScriptNotAtTargetEvent.GetInvocationList())
  1943. {
  1944. try
  1945. {
  1946. d(localID);
  1947. }
  1948. catch (Exception e)
  1949. {
  1950. m_log.ErrorFormat(
  1951. "[EVENT MANAGER]: Delegate for TriggerNotAtTargetEvent failed - continuing. {0} {1}",
  1952. e.Message, e.StackTrace);
  1953. }
  1954. }
  1955. }
  1956. }
  1957. public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot)
  1958. {
  1959. ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent;
  1960. if (handlerScriptAtRotTargetEvent != null)
  1961. {
  1962. foreach (ScriptAtRotTargetEvent d in handlerScriptAtRotTargetEvent.GetInvocationList())
  1963. {
  1964. try
  1965. {
  1966. d(localID, handle, targetrot, currentrot);
  1967. }
  1968. catch (Exception e)
  1969. {
  1970. m_log.ErrorFormat(
  1971. "[EVENT MANAGER]: Delegate for TriggerAtRotTargetEvent failed - continuing. {0} {1}",
  1972. e.Message, e.StackTrace);
  1973. }
  1974. }
  1975. }
  1976. }
  1977. public void TriggerNotAtRotTargetEvent(uint localID)
  1978. {
  1979. ScriptNotAtRotTargetEvent handlerScriptNotAtRotTargetEvent = OnScriptNotAtRotTargetEvent;
  1980. if (handlerScriptNotAtRotTargetEvent != null)
  1981. {
  1982. foreach (ScriptNotAtRotTargetEvent d in handlerScriptNotAtRotTargetEvent.GetInvocationList())
  1983. {
  1984. try
  1985. {
  1986. d(localID);
  1987. }
  1988. catch (Exception e)
  1989. {
  1990. m_log.ErrorFormat(
  1991. "[EVENT MANAGER]: Delegate for TriggerNotAtRotTargetEvent failed - continuing. {0} {1}",
  1992. e.Message, e.StackTrace);
  1993. }
  1994. }
  1995. }
  1996. }
  1997. public void TriggerRequestChangeWaterHeight(float height)
  1998. {
  1999. if (height < 0)
  2000. {
  2001. // ignore negative water height
  2002. return;
  2003. }
  2004. RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight;
  2005. if (handlerRequestChangeWaterHeight != null)
  2006. {
  2007. foreach (RequestChangeWaterHeight d in handlerRequestChangeWaterHeight.GetInvocationList())
  2008. {
  2009. try
  2010. {
  2011. d(height);
  2012. }
  2013. catch (Exception e)
  2014. {
  2015. m_log.ErrorFormat(
  2016. "[EVENT MANAGER]: Delegate for TriggerRequestChangeWaterHeight failed - continuing. {0} {1}",
  2017. e.Message, e.StackTrace);
  2018. }
  2019. }
  2020. }
  2021. }
  2022. public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar)
  2023. {
  2024. AvatarKillData handlerAvatarKill = OnAvatarKilled;
  2025. if (handlerAvatarKill != null)
  2026. {
  2027. foreach (AvatarKillData d in handlerAvatarKill.GetInvocationList())
  2028. {
  2029. try
  2030. {
  2031. d(KillerObjectLocalID, DeadAvatar);
  2032. }
  2033. catch (Exception e)
  2034. {
  2035. m_log.ErrorFormat(
  2036. "[EVENT MANAGER]: Delegate for TriggerAvatarKill failed - continuing. {0} {1}",
  2037. e.Message, e.StackTrace);
  2038. }
  2039. }
  2040. }
  2041. }
  2042. public void TriggerSignificantClientMovement(ScenePresence presence)
  2043. {
  2044. Action<ScenePresence> handlerSignificantClientMovement = OnSignificantClientMovement;
  2045. if (handlerSignificantClientMovement != null)
  2046. {
  2047. foreach (Action<ScenePresence> d in handlerSignificantClientMovement.GetInvocationList())
  2048. {
  2049. try
  2050. {
  2051. d(presence);
  2052. }
  2053. catch (Exception e)
  2054. {
  2055. m_log.ErrorFormat(
  2056. "[EVENT MANAGER]: Delegate for TriggerSignificantClientMovement failed - continuing. {0} {1}",
  2057. e.Message, e.StackTrace);
  2058. }
  2059. }
  2060. }
  2061. }
  2062. public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat)
  2063. {
  2064. ChatFromWorldEvent handlerChatFromWorld = OnChatFromWorld;
  2065. if (handlerChatFromWorld != null)
  2066. {
  2067. foreach (ChatFromWorldEvent d in handlerChatFromWorld.GetInvocationList())
  2068. {
  2069. try
  2070. {
  2071. d(sender, chat);
  2072. }
  2073. catch (Exception e)
  2074. {
  2075. m_log.ErrorFormat(
  2076. "[EVENT MANAGER]: Delegate for TriggerOnChatFromWorld failed - continuing. {0} {1}",
  2077. e.Message, e.StackTrace);
  2078. }
  2079. }
  2080. }
  2081. }
  2082. public void TriggerOnChatFromClient(Object sender, OSChatMessage chat)
  2083. {
  2084. ChatFromClientEvent handlerChatFromClient = OnChatFromClient;
  2085. if (handlerChatFromClient != null)
  2086. {
  2087. foreach (ChatFromClientEvent d in handlerChatFromClient.GetInvocationList())
  2088. {
  2089. try
  2090. {
  2091. d(sender, chat);
  2092. }
  2093. catch (Exception e)
  2094. {
  2095. m_log.ErrorFormat(
  2096. "[EVENT MANAGER]: Delegate for TriggerOnChatFromClient failed - continuing. {0} {1}",
  2097. e.Message, e.StackTrace);
  2098. }
  2099. }
  2100. }
  2101. }
  2102. public void TriggerOnChatToClients(
  2103. UUID senderID, HashSet<UUID> receiverIDs,
  2104. string message, ChatTypeEnum type, Vector3 fromPos, string fromName,
  2105. ChatSourceType src, ChatAudibleLevel level)
  2106. {
  2107. ChatToClientsEvent handler = OnChatToClients;
  2108. if (handler != null)
  2109. {
  2110. foreach (ChatToClientsEvent d in handler.GetInvocationList())
  2111. {
  2112. try
  2113. {
  2114. d(senderID, receiverIDs, message, type, fromPos, fromName, src, level);
  2115. }
  2116. catch (Exception e)
  2117. {
  2118. m_log.ErrorFormat(
  2119. "[EVENT MANAGER]: Delegate for TriggerOnChatToClients failed - continuing. {0} {1}",
  2120. e.Message, e.StackTrace);
  2121. }
  2122. }
  2123. }
  2124. }
  2125. public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
  2126. {
  2127. ChatBroadcastEvent handlerChatBroadcast = OnChatBroadcast;
  2128. if (handlerChatBroadcast != null)
  2129. {
  2130. foreach (ChatBroadcastEvent d in handlerChatBroadcast.GetInvocationList())
  2131. {
  2132. try
  2133. {
  2134. d(sender, chat);
  2135. }
  2136. catch (Exception e)
  2137. {
  2138. m_log.ErrorFormat(
  2139. "[EVENT MANAGER]: Delegate for TriggerOnChatBroadcast failed - continuing. {0} {1}",
  2140. e.Message, e.StackTrace);
  2141. }
  2142. }
  2143. }
  2144. }
  2145. internal void TriggerControlEvent(UUID scriptUUID, UUID avatarID, uint held, uint _changed)
  2146. {
  2147. ScriptControlEvent handlerScriptControlEvent = OnScriptControlEvent;
  2148. if (handlerScriptControlEvent != null)
  2149. {
  2150. foreach (ScriptControlEvent d in handlerScriptControlEvent.GetInvocationList())
  2151. {
  2152. try
  2153. {
  2154. d(scriptUUID, avatarID, held, _changed);
  2155. }
  2156. catch (Exception e)
  2157. {
  2158. m_log.ErrorFormat(
  2159. "[EVENT MANAGER]: Delegate for TriggerControlEvent failed - continuing. {0} {1}",
  2160. e.Message, e.StackTrace);
  2161. }
  2162. }
  2163. }
  2164. }
  2165. public void TriggerNoticeNoLandDataFromStorage()
  2166. {
  2167. NoticeNoLandDataFromStorage handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage;
  2168. if (handlerNoticeNoLandDataFromStorage != null)
  2169. {
  2170. foreach (NoticeNoLandDataFromStorage d in handlerNoticeNoLandDataFromStorage.GetInvocationList())
  2171. {
  2172. try
  2173. {
  2174. d();
  2175. }
  2176. catch (Exception e)
  2177. {
  2178. m_log.ErrorFormat(
  2179. "[EVENT MANAGER]: Delegate for TriggerNoticeNoLandDataFromStorage failed - continuing. {0} {1}",
  2180. e.Message, e.StackTrace);
  2181. }
  2182. }
  2183. }
  2184. }
  2185. public void TriggerIncomingLandDataFromStorage(List<LandData> landData)
  2186. {
  2187. IncomingLandDataFromStorage handlerIncomingLandDataFromStorage = OnIncomingLandDataFromStorage;
  2188. if (handlerIncomingLandDataFromStorage != null)
  2189. {
  2190. foreach (IncomingLandDataFromStorage d in handlerIncomingLandDataFromStorage.GetInvocationList())
  2191. {
  2192. try
  2193. {
  2194. d(landData);
  2195. }
  2196. catch (Exception e)
  2197. {
  2198. m_log.ErrorFormat(
  2199. "[EVENT MANAGER]: Delegate for TriggerIncomingLandDataFromStorage failed - continuing. {0} {1}",
  2200. e.Message, e.StackTrace);
  2201. }
  2202. }
  2203. }
  2204. }
  2205. public void TriggerSetAllowForcefulBan(bool allow)
  2206. {
  2207. SetAllowForcefulBan handlerSetAllowForcefulBan = OnSetAllowForcefulBan;
  2208. if (handlerSetAllowForcefulBan != null)
  2209. {
  2210. foreach (SetAllowForcefulBan d in handlerSetAllowForcefulBan.GetInvocationList())
  2211. {
  2212. try
  2213. {
  2214. d(allow);
  2215. }
  2216. catch (Exception e)
  2217. {
  2218. m_log.ErrorFormat(
  2219. "[EVENT MANAGER]: Delegate for TriggerSetAllowForcefulBan failed - continuing. {0} {1}",
  2220. e.Message, e.StackTrace);
  2221. }
  2222. }
  2223. }
  2224. }
  2225. public void TriggerRequestParcelPrimCountUpdate()
  2226. {
  2227. RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate;
  2228. if (handlerRequestParcelPrimCountUpdate != null)
  2229. {
  2230. foreach (RequestParcelPrimCountUpdate d in handlerRequestParcelPrimCountUpdate.GetInvocationList())
  2231. {
  2232. try
  2233. {
  2234. d();
  2235. }
  2236. catch (Exception e)
  2237. {
  2238. m_log.ErrorFormat(
  2239. "[EVENT MANAGER]: Delegate for TriggerRequestParcelPrimCountUpdate failed - continuing. {0} {1}",
  2240. e.Message, e.StackTrace);
  2241. }
  2242. }
  2243. }
  2244. }
  2245. public void TriggerParcelPrimCountTainted()
  2246. {
  2247. ParcelPrimCountTainted handlerParcelPrimCountTainted = OnParcelPrimCountTainted;
  2248. if (handlerParcelPrimCountTainted != null)
  2249. {
  2250. foreach (ParcelPrimCountTainted d in handlerParcelPrimCountTainted.GetInvocationList())
  2251. {
  2252. try
  2253. {
  2254. d();
  2255. }
  2256. catch (Exception e)
  2257. {
  2258. m_log.ErrorFormat(
  2259. "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountTainted failed - continuing. {0} {1}",
  2260. e.Message, e.StackTrace);
  2261. }
  2262. }
  2263. }
  2264. }
  2265. /// <summary>
  2266. /// this lets us keep track of nasty script events like timer, etc.
  2267. /// </summary>
  2268. /// <param name="objLocalID"></param>
  2269. /// <param name="Interval"></param>
  2270. public void TriggerTimerEvent(uint objLocalID, double Interval)
  2271. {
  2272. 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");
  2273. //handlerScriptTimerEvent = OnScriptTimerEvent;
  2274. //if (handlerScriptTimerEvent != null)
  2275. //{
  2276. // handlerScriptTimerEvent(objLocalID, Interval);
  2277. //}
  2278. }
  2279. /// <summary>
  2280. /// Updates the system as to how the position of the sun should be handled.
  2281. /// </summary>
  2282. /// <param name="regionHandle"></param>
  2283. /// <param name="FixedTime">True if the Sun Position is fixed</param>
  2284. /// <param name="useEstateTime">True if the Estate Settings should be used instead of region</param>
  2285. /// <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>
  2286. public void TriggerEstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float FixedSunHour)
  2287. {
  2288. EstateToolsSunUpdate handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate;
  2289. if (handlerEstateToolsSunUpdate != null)
  2290. {
  2291. foreach (EstateToolsSunUpdate d in handlerEstateToolsSunUpdate.GetInvocationList())
  2292. {
  2293. try
  2294. {
  2295. d(regionHandle, FixedTime, useEstateTime, FixedSunHour);
  2296. }
  2297. catch (Exception e)
  2298. {
  2299. m_log.ErrorFormat(
  2300. "[EVENT MANAGER]: Delegate for TriggerEstateToolsSunUpdate failed - continuing. {0} {1}",
  2301. e.Message, e.StackTrace);
  2302. }
  2303. }
  2304. }
  2305. }
  2306. public float GetCurrentTimeAsSunLindenHour()
  2307. {
  2308. SunLindenHour handlerCurrentTimeAsLindenSunHour = OnGetCurrentTimeAsLindenSunHour;
  2309. if (handlerCurrentTimeAsLindenSunHour != null)
  2310. {
  2311. foreach (SunLindenHour d in handlerCurrentTimeAsLindenSunHour.GetInvocationList())
  2312. {
  2313. try
  2314. {
  2315. return d();
  2316. }
  2317. catch (Exception e)
  2318. {
  2319. m_log.ErrorFormat(
  2320. "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
  2321. e.Message, e.StackTrace);
  2322. }
  2323. }
  2324. }
  2325. return 6;
  2326. }
  2327. public void TriggerOarFileLoaded(Guid requestId, List<UUID> loadedScenes, string message)
  2328. {
  2329. OarFileLoaded handlerOarFileLoaded = OnOarFileLoaded;
  2330. if (handlerOarFileLoaded != null)
  2331. {
  2332. foreach (OarFileLoaded d in handlerOarFileLoaded.GetInvocationList())
  2333. {
  2334. try
  2335. {
  2336. d(requestId, loadedScenes, message);
  2337. }
  2338. catch (Exception e)
  2339. {
  2340. m_log.ErrorFormat(
  2341. "[EVENT MANAGER]: Delegate for TriggerOarFileLoaded failed - continuing. {0} {1}",
  2342. e.Message, e.StackTrace);
  2343. }
  2344. }
  2345. }
  2346. }
  2347. public void TriggerOarFileSaved(Guid requestId, string message)
  2348. {
  2349. OarFileSaved handlerOarFileSaved = OnOarFileSaved;
  2350. if (handlerOarFileSaved != null)
  2351. {
  2352. foreach (OarFileSaved d in handlerOarFileSaved.GetInvocationList())
  2353. {
  2354. try
  2355. {
  2356. d(requestId, message);
  2357. }
  2358. catch (Exception e)
  2359. {
  2360. m_log.ErrorFormat(
  2361. "[EVENT MANAGER]: Delegate for TriggerOarFileSaved failed - continuing. {0} {1}",
  2362. e.Message, e.StackTrace);
  2363. }
  2364. }
  2365. }
  2366. }
  2367. public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message)
  2368. {
  2369. EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = OnEmptyScriptCompileQueue;
  2370. if (handlerEmptyScriptCompileQueue != null)
  2371. {
  2372. foreach (EmptyScriptCompileQueue d in handlerEmptyScriptCompileQueue.GetInvocationList())
  2373. {
  2374. try
  2375. {
  2376. d(numScriptsFailed, message);
  2377. }
  2378. catch (Exception e)
  2379. {
  2380. m_log.ErrorFormat(
  2381. "[EVENT MANAGER]: Delegate for TriggerEmptyScriptCompileQueue failed - continuing. {0} {1}",
  2382. e.Message, e.StackTrace);
  2383. }
  2384. }
  2385. }
  2386. }
  2387. public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders)
  2388. {
  2389. ScriptColliding handlerCollidingStart = OnScriptColliderStart;
  2390. if (handlerCollidingStart != null)
  2391. {
  2392. foreach (ScriptColliding d in handlerCollidingStart.GetInvocationList())
  2393. {
  2394. try
  2395. {
  2396. d(localId, colliders);
  2397. }
  2398. catch (Exception e)
  2399. {
  2400. m_log.ErrorFormat(
  2401. "[EVENT MANAGER]: Delegate for TriggerScriptCollidingStart failed - continuing. {0} {1}",
  2402. e.Message, e.StackTrace);
  2403. }
  2404. }
  2405. }
  2406. }
  2407. public void TriggerScriptColliding(uint localId, ColliderArgs colliders)
  2408. {
  2409. ScriptColliding handlerColliding = OnScriptColliding;
  2410. if (handlerColliding != null)
  2411. {
  2412. foreach (ScriptColliding d in handlerColliding.GetInvocationList())
  2413. {
  2414. try
  2415. {
  2416. d(localId, colliders);
  2417. }
  2418. catch (Exception e)
  2419. {
  2420. m_log.ErrorFormat(
  2421. "[EVENT MANAGER]: Delegate for TriggerScriptColliding failed - continuing. {0} {1}",
  2422. e.Message, e.StackTrace);
  2423. }
  2424. }
  2425. }
  2426. }
  2427. public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders)
  2428. {
  2429. ScriptColliding handlerCollidingEnd = OnScriptCollidingEnd;
  2430. if (handlerCollidingEnd != null)
  2431. {
  2432. foreach (ScriptColliding d in handlerCollidingEnd.GetInvocationList())
  2433. {
  2434. try
  2435. {
  2436. d(localId, colliders);
  2437. }
  2438. catch (Exception e)
  2439. {
  2440. m_log.ErrorFormat(
  2441. "[EVENT MANAGER]: Delegate for TriggerScriptCollidingEnd failed - continuing. {0} {1}",
  2442. e.Message, e.StackTrace);
  2443. }
  2444. }
  2445. }
  2446. }
  2447. public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders)
  2448. {
  2449. ScriptColliding handlerLandCollidingStart = OnScriptLandColliderStart;
  2450. if (handlerLandCollidingStart != null)
  2451. {
  2452. foreach (ScriptColliding d in handlerLandCollidingStart.GetInvocationList())
  2453. {
  2454. try
  2455. {
  2456. d(localId, colliders);
  2457. }
  2458. catch (Exception e)
  2459. {
  2460. m_log.ErrorFormat(
  2461. "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingStart failed - continuing. {0} {1}",
  2462. e.Message, e.StackTrace);
  2463. }
  2464. }
  2465. }
  2466. }
  2467. public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders)
  2468. {
  2469. ScriptColliding handlerLandColliding = OnScriptLandColliding;
  2470. if (handlerLandColliding != null)
  2471. {
  2472. foreach (ScriptColliding d in handlerLandColliding.GetInvocationList())
  2473. {
  2474. try
  2475. {
  2476. d(localId, colliders);
  2477. }
  2478. catch (Exception e)
  2479. {
  2480. m_log.ErrorFormat(
  2481. "[EVENT MANAGER]: Delegate for TriggerScriptLandColliding failed - continuing. {0} {1}",
  2482. e.Message, e.StackTrace);
  2483. }
  2484. }
  2485. }
  2486. }
  2487. public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders)
  2488. {
  2489. ScriptColliding handlerLandCollidingEnd = OnScriptLandColliderEnd;
  2490. if (handlerLandCollidingEnd != null)
  2491. {
  2492. foreach (ScriptColliding d in handlerLandCollidingEnd.GetInvocationList())
  2493. {
  2494. try
  2495. {
  2496. d(localId, colliders);
  2497. }
  2498. catch (Exception e)
  2499. {
  2500. m_log.ErrorFormat(
  2501. "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingEnd failed - continuing. {0} {1}",
  2502. e.Message, e.StackTrace);
  2503. }
  2504. }
  2505. }
  2506. }
  2507. public void TriggerSetRootAgentScene(UUID agentID, Scene scene)
  2508. {
  2509. OnSetRootAgentSceneDelegate handlerSetRootAgentScene = OnSetRootAgentScene;
  2510. if (handlerSetRootAgentScene != null)
  2511. {
  2512. foreach (OnSetRootAgentSceneDelegate d in handlerSetRootAgentScene.GetInvocationList())
  2513. {
  2514. try
  2515. {
  2516. d(agentID, scene);
  2517. }
  2518. catch (Exception e)
  2519. {
  2520. m_log.ErrorFormat(
  2521. "[EVENT MANAGER]: Delegate for TriggerSetRootAgentScene failed - continuing. {0} {1}",
  2522. e.Message, e.StackTrace);
  2523. }
  2524. }
  2525. }
  2526. }
  2527. public void TriggerOnRegionUp(GridRegion otherRegion)
  2528. {
  2529. RegionUp handlerOnRegionUp = OnRegionUp;
  2530. if (handlerOnRegionUp != null)
  2531. {
  2532. foreach (RegionUp d in handlerOnRegionUp.GetInvocationList())
  2533. {
  2534. try
  2535. {
  2536. d(otherRegion);
  2537. }
  2538. catch (Exception e)
  2539. {
  2540. m_log.ErrorFormat(
  2541. "[EVENT MANAGER]: Delegate for TriggerOnRegionUp failed - continuing. {0} {1}",
  2542. e.Message, e.StackTrace);
  2543. }
  2544. }
  2545. }
  2546. }
  2547. public void TriggerOnSceneObjectLoaded(SceneObjectGroup so)
  2548. {
  2549. SceneObjectDelegate handler = OnSceneObjectLoaded;
  2550. if (handler != null)
  2551. {
  2552. foreach (SceneObjectDelegate d in handler.GetInvocationList())
  2553. {
  2554. try
  2555. {
  2556. d(so);
  2557. }
  2558. catch (Exception e)
  2559. {
  2560. m_log.ErrorFormat(
  2561. "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectLoaded failed - continuing. {0} {1}",
  2562. e.Message, e.StackTrace);
  2563. }
  2564. }
  2565. }
  2566. }
  2567. public void TriggerOnSceneObjectPreSave(SceneObjectGroup persistingSo, SceneObjectGroup originalSo)
  2568. {
  2569. SceneObjectPreSaveDelegate handler = OnSceneObjectPreSave;
  2570. if (handler != null)
  2571. {
  2572. foreach (SceneObjectPreSaveDelegate d in handler.GetInvocationList())
  2573. {
  2574. try
  2575. {
  2576. d(persistingSo, originalSo);
  2577. }
  2578. catch (Exception e)
  2579. {
  2580. m_log.ErrorFormat(
  2581. "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPreSave failed - continuing. {0} {1}",
  2582. e.Message, e.StackTrace);
  2583. }
  2584. }
  2585. }
  2586. }
  2587. public void TriggerOnSceneObjectPartCopy(SceneObjectPart copy, SceneObjectPart original, bool userExposed)
  2588. {
  2589. SceneObjectPartCopyDelegate handler = OnSceneObjectPartCopy;
  2590. if (handler != null)
  2591. {
  2592. foreach (SceneObjectPartCopyDelegate d in handler.GetInvocationList())
  2593. {
  2594. try
  2595. {
  2596. d(copy, original, userExposed);
  2597. }
  2598. catch (Exception e)
  2599. {
  2600. m_log.ErrorFormat(
  2601. "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}",
  2602. e.Message, e.StackTrace);
  2603. }
  2604. }
  2605. }
  2606. }
  2607. public void TriggerSceneObjectPartUpdated(SceneObjectPart sop, bool full)
  2608. {
  2609. SceneObjectPartUpdated handler = OnSceneObjectPartUpdated;
  2610. if (handler != null)
  2611. {
  2612. foreach (SceneObjectPartUpdated d in handler.GetInvocationList())
  2613. {
  2614. try
  2615. {
  2616. d(sop, full);
  2617. }
  2618. catch (Exception e)
  2619. {
  2620. m_log.ErrorFormat(
  2621. "[EVENT MANAGER]: Delegate for TriggerSceneObjectPartUpdated failed - continuing. {0} {1}",
  2622. e.Message, e.StackTrace);
  2623. }
  2624. }
  2625. }
  2626. }
  2627. public void TriggerScenePresenceUpdated(ScenePresence sp)
  2628. {
  2629. ScenePresenceUpdated handler = OnScenePresenceUpdated;
  2630. if (handler != null)
  2631. {
  2632. foreach (ScenePresenceUpdated d in handler.GetInvocationList())
  2633. {
  2634. try
  2635. {
  2636. d(sp);
  2637. }
  2638. catch (Exception e)
  2639. {
  2640. m_log.ErrorFormat(
  2641. "[EVENT MANAGER]: Delegate for TriggerScenePresenceUpdated failed - continuing. {0} {1}",
  2642. e.Message, e.StackTrace);
  2643. }
  2644. }
  2645. }
  2646. }
  2647. public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args,
  2648. int local_id, IClientAPI remote_client)
  2649. {
  2650. ParcelPropertiesUpdateRequest handler = OnParcelPropertiesUpdateRequest;
  2651. if (handler != null)
  2652. {
  2653. foreach (ParcelPropertiesUpdateRequest d in handler.GetInvocationList())
  2654. {
  2655. try
  2656. {
  2657. d(args, local_id, remote_client);
  2658. }
  2659. catch (Exception e)
  2660. {
  2661. m_log.ErrorFormat(
  2662. "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}",
  2663. e.Message, e.StackTrace);
  2664. }
  2665. }
  2666. }
  2667. }
  2668. public void TriggerSceneShuttingDown(Scene s)
  2669. {
  2670. Action<Scene> handler = OnSceneShuttingDown;
  2671. if (handler != null)
  2672. {
  2673. foreach (Action<Scene> d in handler.GetInvocationList())
  2674. {
  2675. try
  2676. {
  2677. d(s);
  2678. }
  2679. catch (Exception e)
  2680. {
  2681. m_log.ErrorFormat(
  2682. "[EVENT MANAGER]: Delegate for TriggerSceneShuttingDown failed - continuing. {0} {1}",
  2683. e.Message, e.StackTrace);
  2684. }
  2685. }
  2686. }
  2687. }
  2688. public void TriggerOnRegionStarted(Scene scene)
  2689. {
  2690. RegionStarted handler = OnRegionStarted;
  2691. if (handler != null)
  2692. {
  2693. foreach (RegionStarted d in handler.GetInvocationList())
  2694. {
  2695. try
  2696. {
  2697. d(scene);
  2698. }
  2699. catch (Exception e)
  2700. {
  2701. m_log.ErrorFormat("[EVENT MANAGER]: Delegate for RegionStarted failed - continuing {0} - {1}",
  2702. e.Message, e.StackTrace);
  2703. }
  2704. }
  2705. }
  2706. }
  2707. public void TriggerRegionHeartbeatEnd(Scene scene)
  2708. {
  2709. RegionHeartbeatEnd handler = OnRegionHeartbeatEnd;
  2710. if (handler != null)
  2711. {
  2712. foreach (RegionHeartbeatEnd d in handler.GetInvocationList())
  2713. {
  2714. try
  2715. {
  2716. d(scene);
  2717. }
  2718. catch (Exception e)
  2719. {
  2720. m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionHeartbeatEnd failed - continuing {0} - {1}",
  2721. e.Message, e.StackTrace);
  2722. }
  2723. }
  2724. }
  2725. }
  2726. public void TriggerRegionLoginsStatusChange(IScene scene)
  2727. {
  2728. RegionLoginsStatusChange handler = OnRegionLoginsStatusChange;
  2729. if (handler != null)
  2730. {
  2731. foreach (RegionLoginsStatusChange d in handler.GetInvocationList())
  2732. {
  2733. try
  2734. {
  2735. d(scene);
  2736. }
  2737. catch (Exception e)
  2738. {
  2739. m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionLoginsStatusChange failed - continuing {0} - {1}",
  2740. e.Message, e.StackTrace);
  2741. }
  2742. }
  2743. }
  2744. }
  2745. public void TriggerRegionReadyStatusChange(IScene scene)
  2746. {
  2747. Action<IScene> handler = OnRegionReadyStatusChange;
  2748. if (handler != null)
  2749. {
  2750. foreach (Action<IScene> d in handler.GetInvocationList())
  2751. {
  2752. try
  2753. {
  2754. d(scene);
  2755. }
  2756. catch (Exception e)
  2757. {
  2758. m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionReadyStatusChange failed - continuing {0} - {1}",
  2759. e.Message, e.StackTrace);
  2760. }
  2761. }
  2762. }
  2763. }
  2764. public void TriggerPrimsLoaded(Scene s)
  2765. {
  2766. PrimsLoaded handler = OnPrimsLoaded;
  2767. if (handler != null)
  2768. {
  2769. foreach (PrimsLoaded d in handler.GetInvocationList())
  2770. {
  2771. try
  2772. {
  2773. d(s);
  2774. }
  2775. catch (Exception e)
  2776. {
  2777. m_log.ErrorFormat("[EVENT MANAGER]: Delegate for PrimsLoaded failed - continuing {0} - {1}",
  2778. e.Message, e.StackTrace);
  2779. }
  2780. }
  2781. }
  2782. }
  2783. public void TriggerTeleportStart(IClientAPI client, GridRegion destination, GridRegion finalDestination, uint teleportFlags, bool gridLogout)
  2784. {
  2785. TeleportStart handler = OnTeleportStart;
  2786. if (handler != null)
  2787. {
  2788. foreach (TeleportStart d in handler.GetInvocationList())
  2789. {
  2790. try
  2791. {
  2792. d(client, destination, finalDestination, teleportFlags, gridLogout);
  2793. }
  2794. catch (Exception e)
  2795. {
  2796. m_log.ErrorFormat("[EVENT MANAGER]: Delegate for TeleportStart failed - continuing {0} - {1}",
  2797. e.Message, e.StackTrace);
  2798. }
  2799. }
  2800. }
  2801. }
  2802. public void TriggerTeleportFail(IClientAPI client, bool gridLogout)
  2803. {
  2804. TeleportFail handler = OnTeleportFail;
  2805. if (handler != null)
  2806. {
  2807. foreach (TeleportFail d in handler.GetInvocationList())
  2808. {
  2809. try
  2810. {
  2811. d(client, gridLogout);
  2812. }
  2813. catch (Exception e)
  2814. {
  2815. m_log.ErrorFormat("[EVENT MANAGER]: Delegate for TeleportFail failed - continuing {0} - {1}",
  2816. e.Message, e.StackTrace);
  2817. }
  2818. }
  2819. }
  2820. }
  2821. public void TriggerExtraSettingChanged(Scene scene, string name, string val)
  2822. {
  2823. ExtraSettingChangedDelegate handler = OnExtraSettingChanged;
  2824. if (handler != null)
  2825. {
  2826. foreach (ExtraSettingChangedDelegate d in handler.GetInvocationList())
  2827. {
  2828. try
  2829. {
  2830. d(scene, name, val);
  2831. }
  2832. catch (Exception e)
  2833. {
  2834. m_log.ErrorFormat("[EVENT MANAGER]: Delegate for ExtraSettingChanged failed - continuing {0} - {1}",
  2835. e.Message, e.StackTrace);
  2836. }
  2837. }
  2838. }
  2839. }
  2840. }
  2841. }