EventManager.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814
  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 OpenSim 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 libsecondlife;
  29. using OpenSim.Framework;
  30. using OpenSim.Region.Environment.Interfaces;
  31. using Caps=OpenSim.Framework.Communications.Capabilities.Caps;
  32. using System.Collections.Generic;
  33. namespace OpenSim.Region.Environment.Scenes
  34. {
  35. /// <summary>
  36. /// A class for triggering remote scene events.
  37. /// </summary>
  38. public class EventManager
  39. {
  40. public delegate void OnFrameDelegate();
  41. public event OnFrameDelegate OnFrame;
  42. public delegate void ClientMovement(ScenePresence client);
  43. public event ClientMovement OnClientMovement;
  44. public delegate void OnTerrainTickDelegate();
  45. public event OnTerrainTickDelegate OnTerrainTick;
  46. public delegate void OnBackupDelegate(IRegionDataStore datastore);
  47. public event OnBackupDelegate OnBackup;
  48. public delegate void OnNewClientDelegate(IClientAPI client);
  49. public event OnNewClientDelegate OnNewClient;
  50. public delegate void OnNewPresenceDelegate(ScenePresence presence);
  51. public event OnNewPresenceDelegate OnNewPresence;
  52. public delegate void OnRemovePresenceDelegate(LLUUID agentId);
  53. public event OnRemovePresenceDelegate OnRemovePresence;
  54. public delegate void OnParcelPrimCountUpdateDelegate();
  55. public event OnParcelPrimCountUpdateDelegate OnParcelPrimCountUpdate;
  56. public delegate void OnParcelPrimCountAddDelegate(SceneObjectGroup obj);
  57. public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd;
  58. public delegate void OnPluginConsoleDelegate(string[] args);
  59. public event OnPluginConsoleDelegate OnPluginConsole;
  60. public delegate void OnShutdownDelegate();
  61. public event OnShutdownDelegate OnShutdown;
  62. public delegate void ObjectGrabDelegate(uint localID, LLVector3 offsetPos, IClientAPI remoteClient);
  63. public delegate void ObjectDeGrabDelegate(uint localID, IClientAPI remoteClient);
  64. public delegate void ScriptResetDelegate(uint localID, LLUUID itemID);
  65. public delegate void OnPermissionErrorDelegate(LLUUID user, string reason);
  66. public event ObjectGrabDelegate OnObjectGrab;
  67. public event ObjectDeGrabDelegate OnObjectDeGrab;
  68. public event ScriptResetDelegate OnScriptReset;
  69. public event OnPermissionErrorDelegate OnPermissionError;
  70. public delegate void NewRezScript(uint localID, LLUUID itemID, string script);
  71. public event NewRezScript OnRezScript;
  72. public delegate void RemoveScript(uint localID, LLUUID itemID);
  73. public event RemoveScript OnRemoveScript;
  74. public delegate bool SceneGroupMoved(LLUUID groupID, LLVector3 delta);
  75. public event SceneGroupMoved OnSceneGroupMove;
  76. public delegate void SceneGroupGrabed(LLUUID groupID, LLVector3 offset, LLUUID userID);
  77. public event SceneGroupGrabed OnSceneGroupGrab;
  78. public delegate void LandObjectAdded(ILandObject newParcel);
  79. public event LandObjectAdded OnLandObjectAdded;
  80. public delegate void LandObjectRemoved(LLUUID globalID);
  81. public event LandObjectRemoved OnLandObjectRemoved;
  82. public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, LLUUID regionID);
  83. public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
  84. public delegate void SignificantClientMovement(IClientAPI remote_client);
  85. public event SignificantClientMovement OnSignificantClientMovement;
  86. public delegate void NewGridInstantMessage(GridInstantMessage message);
  87. public event NewGridInstantMessage OnGridInstantMessageToIMModule;
  88. public event NewGridInstantMessage OnGridInstantMessageToFriendsModule;
  89. public event NewGridInstantMessage OnGridInstantMessageToGroupsModule;
  90. public delegate void ClientClosed(LLUUID clientID);
  91. public event ClientClosed OnClientClosed;
  92. public delegate void ScriptChangedEvent(uint localID, uint change);
  93. public event ScriptChangedEvent OnScriptChangedEvent;
  94. public delegate void ScriptControlEvent(uint localID, LLUUID item, LLUUID avatarID, uint held, uint changed);
  95. public event ScriptControlEvent OnScriptControlEvent;
  96. public delegate void ScriptAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos);
  97. public event ScriptAtTargetEvent OnScriptAtTargetEvent;
  98. public delegate void ScriptNotAtTargetEvent(uint localID);
  99. public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent;
  100. public delegate void OnMakeChildAgentDelegate(ScenePresence presence);
  101. public event OnMakeChildAgentDelegate OnMakeChildAgent;
  102. public delegate void OnMakeRootAgentDelegate(ScenePresence presence);
  103. public event OnMakeRootAgentDelegate OnMakeRootAgent;
  104. public delegate void NewInventoryItemUploadComplete(LLUUID avatarID, LLUUID assetID, string name, int userlevel);
  105. public event NewInventoryItemUploadComplete OnNewInventoryItemUploadComplete;
  106. public delegate void RequestChangeWaterHeight(float height);
  107. public event RequestChangeWaterHeight OnRequestChangeWaterHeight;
  108. public delegate void AvatarKillData(uint KillerLocalID, ScenePresence avatar);
  109. public event AvatarKillData OnAvatarKilled;
  110. public delegate void ScriptTimerEvent(uint localID, double timerinterval);
  111. public event ScriptTimerEvent OnScriptTimerEvent;
  112. public delegate void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour);
  113. public event EstateToolsTimeUpdate OnEstateToolsTimeUpdate;
  114. public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj);
  115. public event ObjectBeingRemovedFromScene OnObjectBeingRemovedFromScene;
  116. public delegate void NoticeNoLandDataFromStorage();
  117. public event NoticeNoLandDataFromStorage OnNoticeNoLandDataFromStorage;
  118. public delegate void IncomingLandDataFromStorage(List<LandData> data);
  119. public event IncomingLandDataFromStorage OnIncomingLandDataFromStorage;
  120. public delegate void SetAllowForcefulBan(bool allow);
  121. public event SetAllowForcefulBan OnSetAllowForcefulBan;
  122. public delegate void RequestParcelPrimCountUpdate();
  123. public event RequestParcelPrimCountUpdate OnRequestParcelPrimCountUpdate;
  124. public delegate void ParcelPrimCountTainted();
  125. public event ParcelPrimCountTainted OnParcelPrimCountTainted;
  126. /// <summary>
  127. /// RegisterCapsEvent is called by Scene after the Caps object
  128. /// has been instantiated and before it is return to the
  129. /// client and provides region modules to add their caps.
  130. /// </summary>
  131. public delegate void RegisterCapsEvent(LLUUID agentID, Caps caps);
  132. public event RegisterCapsEvent OnRegisterCaps;
  133. /// <summary>
  134. /// DeregisterCapsEvent is called by Scene when the caps
  135. /// handler for an agent are removed.
  136. /// </summary>
  137. public delegate void DeregisterCapsEvent(LLUUID agentID, Caps caps);
  138. public event DeregisterCapsEvent OnDeregisterCaps;
  139. /// <summary>
  140. /// ChatFromWorldEvent is called via Scene when a chat message
  141. /// from world comes in (chat from viewer is available via
  142. /// client.OnChatFromViewer).
  143. /// </summary>
  144. public delegate void ChatFromWorldEvent(Object sender, ChatFromViewerArgs chat);
  145. public event ChatFromWorldEvent OnChatFromWorld;
  146. /// <summary>
  147. /// ChatBroadcastEvent is called via Scene when a broadcast chat message
  148. /// from world comes in (chat from viewer is available via client.OnChatFromViewer).
  149. /// </summary>
  150. public delegate void ChatBroadcastEvent(Object sender, ChatFromViewerArgs chat);
  151. public event ChatBroadcastEvent OnChatBroadcast;
  152. public class MoneyTransferArgs : EventArgs
  153. {
  154. public LLUUID sender;
  155. public LLUUID receiver;
  156. // Always false. The SL protocol sucks.
  157. public bool authenticated = false;
  158. public int amount;
  159. public int transactiontype;
  160. public string description;
  161. public MoneyTransferArgs(LLUUID asender, LLUUID areceiver, int aamount, int atransactiontype, string adescription)
  162. {
  163. sender = asender;
  164. receiver = areceiver;
  165. amount = aamount;
  166. transactiontype = atransactiontype;
  167. description = adescription;
  168. }
  169. }
  170. public class LandBuyArgs : EventArgs
  171. {
  172. public LLUUID agentId = LLUUID.Zero;
  173. public LLUUID groupId = LLUUID.Zero;
  174. public LLUUID parcelOwnerID = LLUUID.Zero;
  175. public bool final = false;
  176. public bool groupOwned = false;
  177. public bool removeContribution = false;
  178. public int parcelLocalID = 0;
  179. public int parcelArea = 0;
  180. public int parcelPrice = 0;
  181. public bool authenticated = false;
  182. public bool landValidated = false;
  183. public bool economyValidated = false;
  184. public int transactionID = 0;
  185. public int amountDebited = 0;
  186. public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned,
  187. bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice,
  188. bool pauthenticated)
  189. {
  190. agentId = pagentId;
  191. groupId = pgroupId;
  192. final = pfinal;
  193. groupOwned = pgroupOwned;
  194. removeContribution = premoveContribution;
  195. parcelLocalID = pparcelLocalID;
  196. parcelArea = pparcelArea;
  197. parcelPrice = pparcelPrice;
  198. authenticated = pauthenticated;
  199. }
  200. }
  201. public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e);
  202. public delegate void LandBuy(Object sender, LandBuyArgs e);
  203. public event MoneyTransferEvent OnMoneyTransfer;
  204. public event LandBuy OnLandBuy;
  205. public event LandBuy OnValidateLandBuy;
  206. /* Designated Event Deletage Instances */
  207. private ScriptChangedEvent handlerScriptChangedEvent = null; //OnScriptChangedEvent;
  208. private ScriptAtTargetEvent handlerScriptAtTargetEvent = null;
  209. private ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = null;
  210. private ClientMovement handlerClientMovement = null; //OnClientMovement;
  211. private OnPermissionErrorDelegate handlerPermissionError = null; //OnPermissionError;
  212. private OnPluginConsoleDelegate handlerPluginConsole = null; //OnPluginConsole;
  213. private OnFrameDelegate handlerFrame = null; //OnFrame;
  214. private OnNewClientDelegate handlerNewClient = null; //OnNewClient;
  215. private OnNewPresenceDelegate handlerNewPresence = null; //OnNewPresence;
  216. private OnRemovePresenceDelegate handlerRemovePresence = null; //OnRemovePresence;
  217. private OnBackupDelegate handlerBackup = null; //OnBackup;
  218. private OnParcelPrimCountUpdateDelegate handlerParcelPrimCountUpdate = null; //OnParcelPrimCountUpdate;
  219. private MoneyTransferEvent handlerMoneyTransfer = null; //OnMoneyTransfer;
  220. private OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = null; //OnParcelPrimCountAdd;
  221. private OnShutdownDelegate handlerShutdown = null; //OnShutdown;
  222. private ObjectGrabDelegate handlerObjectGrab = null; //OnObjectGrab;
  223. private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab;
  224. private ScriptResetDelegate handlerScriptReset = null; // OnScriptReset
  225. private NewRezScript handlerRezScript = null; //OnRezScript;
  226. private RemoveScript handlerRemoveScript = null; //OnRemoveScript;
  227. private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove;
  228. private SceneGroupGrabed handlerSceneGroupGrab = null; //OnSceneGroupGrab;
  229. private LandObjectAdded handlerLandObjectAdded = null; //OnLandObjectAdded;
  230. private LandObjectRemoved handlerLandObjectRemoved = null; //OnLandObjectRemoved;
  231. private AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = null; //OnAvatarEnteringNewParcel;
  232. private NewGridInstantMessage handlerGridInstantMessageToIM = null; //OnGridInstantMessageToIMModule;
  233. private NewGridInstantMessage handlerGridInstantMessageToFriends = null; //OnGridInstantMessageToFriendsModule;
  234. private ClientClosed handlerClientClosed = null; //OnClientClosed;
  235. private OnMakeChildAgentDelegate handlerMakeChildAgent = null; //OnMakeChildAgent;
  236. private OnMakeRootAgentDelegate handlerMakeRootAgent = null; //OnMakeRootAgent;
  237. private OnTerrainTickDelegate handlerTerrainTick = null; // OnTerainTick;
  238. private RegisterCapsEvent handlerRegisterCaps = null; // OnRegisterCaps;
  239. private DeregisterCapsEvent handlerDeregisterCaps = null; // OnDeregisterCaps;
  240. private ChatFromWorldEvent handlerChatFromWorld = null; // OnChatFromWorld;
  241. private ChatBroadcastEvent handlerChatBroadcast = null; // OnChatBroadcast;
  242. private NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = null;
  243. private RequestChangeWaterHeight handlerRequestChangeWaterHeight = null; //OnRequestChangeWaterHeight
  244. private ScriptControlEvent handlerScriptControlEvent = null;
  245. private SignificantClientMovement handlerSignificantClientMovement = null;
  246. private LandBuy handlerLandBuy = null;
  247. private LandBuy handlerValidateLandBuy = null;
  248. private AvatarKillData handlerAvatarKill = null;
  249. private NoticeNoLandDataFromStorage handlerNoticeNoLandDataFromStorage = null;
  250. private IncomingLandDataFromStorage handlerIncomingLandDataFromStorage = null;
  251. private SetAllowForcefulBan handlerSetAllowForcefulBan = null;
  252. private RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = null;
  253. private ParcelPrimCountTainted handlerParcelPrimCountTainted = null;
  254. private ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = null;
  255. private ScriptTimerEvent handlerScriptTimerEvent = null;
  256. private EstateToolsTimeUpdate handlerEstateToolsTimeUpdate = null;
  257. public void TriggerOnScriptChangedEvent(uint localID, uint change)
  258. {
  259. handlerScriptChangedEvent = OnScriptChangedEvent;
  260. if (handlerScriptChangedEvent != null)
  261. handlerScriptChangedEvent(localID, change);
  262. }
  263. public void TriggerOnClientMovement(ScenePresence avatar)
  264. {
  265. handlerClientMovement = OnClientMovement;
  266. if (handlerClientMovement != null)
  267. handlerClientMovement(avatar);
  268. }
  269. public void TriggerPermissionError(LLUUID user, string reason)
  270. {
  271. handlerPermissionError = OnPermissionError;
  272. if (handlerPermissionError != null)
  273. handlerPermissionError(user, reason);
  274. }
  275. public void TriggerOnPluginConsole(string[] args)
  276. {
  277. handlerPluginConsole = OnPluginConsole;
  278. if (handlerPluginConsole != null)
  279. handlerPluginConsole(args);
  280. }
  281. public void TriggerOnFrame()
  282. {
  283. handlerFrame = OnFrame;
  284. if (handlerFrame != null)
  285. {
  286. handlerFrame();
  287. }
  288. }
  289. public void TriggerOnNewClient(IClientAPI client)
  290. {
  291. handlerNewClient = OnNewClient;
  292. if (handlerNewClient != null)
  293. handlerNewClient(client);
  294. }
  295. public void TriggerOnNewPresence(ScenePresence presence)
  296. {
  297. handlerNewPresence = OnNewPresence;
  298. if (handlerNewPresence != null)
  299. handlerNewPresence(presence);
  300. }
  301. public void TriggerOnRemovePresence(LLUUID agentId)
  302. {
  303. handlerRemovePresence = OnRemovePresence;
  304. if (handlerRemovePresence != null)
  305. {
  306. handlerRemovePresence(agentId);
  307. }
  308. }
  309. public void TriggerOnBackup(IRegionDataStore dstore)
  310. {
  311. handlerBackup = OnBackup;
  312. if (handlerBackup != null)
  313. {
  314. handlerBackup(dstore);
  315. }
  316. }
  317. public void TriggerParcelPrimCountUpdate()
  318. {
  319. handlerParcelPrimCountUpdate = OnParcelPrimCountUpdate;
  320. if (handlerParcelPrimCountUpdate != null)
  321. {
  322. handlerParcelPrimCountUpdate();
  323. }
  324. }
  325. public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs e)
  326. {
  327. handlerMoneyTransfer = OnMoneyTransfer;
  328. if (handlerMoneyTransfer != null)
  329. {
  330. handlerMoneyTransfer(sender, e);
  331. }
  332. }
  333. public void TriggerTerrainTick()
  334. {
  335. handlerTerrainTick = OnTerrainTick;
  336. if (handlerTerrainTick != null)
  337. {
  338. handlerTerrainTick();
  339. }
  340. }
  341. public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
  342. {
  343. handlerParcelPrimCountAdd = OnParcelPrimCountAdd;
  344. if (handlerParcelPrimCountAdd != null)
  345. {
  346. handlerParcelPrimCountAdd(obj);
  347. }
  348. }
  349. public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj)
  350. {
  351. handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene;
  352. if (handlerObjectBeingRemovedFromScene != null)
  353. {
  354. handlerObjectBeingRemovedFromScene(obj);
  355. }
  356. }
  357. public void TriggerShutdown()
  358. {
  359. handlerShutdown = OnShutdown;
  360. if (handlerShutdown != null)
  361. handlerShutdown();
  362. }
  363. public void TriggerObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
  364. {
  365. handlerObjectGrab = OnObjectGrab;
  366. if (handlerObjectGrab != null)
  367. {
  368. handlerObjectGrab(localID, offsetPos, remoteClient);
  369. }
  370. }
  371. public void TriggerObjectDeGrab(uint localID, IClientAPI remoteClient)
  372. {
  373. handlerObjectDeGrab = OnObjectDeGrab;
  374. if (handlerObjectDeGrab != null)
  375. {
  376. handlerObjectDeGrab(localID, remoteClient);
  377. }
  378. }
  379. public void TriggerScriptReset(uint localID, LLUUID itemID)
  380. {
  381. handlerScriptReset = OnScriptReset;
  382. if (handlerScriptReset != null)
  383. {
  384. handlerScriptReset(localID, itemID);
  385. }
  386. }
  387. public void TriggerRezScript(uint localID, LLUUID itemID, string script)
  388. {
  389. handlerRezScript = OnRezScript;
  390. if (handlerRezScript != null)
  391. {
  392. handlerRezScript(localID, itemID, script);
  393. }
  394. }
  395. public void TriggerRemoveScript(uint localID, LLUUID itemID)
  396. {
  397. handlerRemoveScript = OnRemoveScript;
  398. if (handlerRemoveScript != null)
  399. {
  400. handlerRemoveScript(localID, itemID);
  401. }
  402. }
  403. public bool TriggerGroupMove(LLUUID groupID, LLVector3 delta)
  404. {
  405. handlerSceneGroupMove = OnSceneGroupMove;
  406. if (handlerSceneGroupMove != null)
  407. {
  408. return handlerSceneGroupMove(groupID, delta);
  409. }
  410. return true;
  411. }
  412. public void TriggerGroupGrab(LLUUID groupID, LLVector3 offset, LLUUID userID)
  413. {
  414. handlerSceneGroupGrab = OnSceneGroupGrab;
  415. if (handlerSceneGroupGrab != null)
  416. {
  417. handlerSceneGroupGrab(groupID, offset, userID);
  418. }
  419. }
  420. public void TriggerLandObjectAdded(ILandObject newParcel)
  421. {
  422. handlerLandObjectAdded = OnLandObjectAdded;
  423. if (handlerLandObjectAdded != null)
  424. {
  425. handlerLandObjectAdded(newParcel);
  426. }
  427. }
  428. public void TriggerLandObjectRemoved(LLUUID globalID)
  429. {
  430. handlerLandObjectRemoved = OnLandObjectRemoved;
  431. if (handlerLandObjectRemoved != null)
  432. {
  433. handlerLandObjectRemoved(globalID);
  434. }
  435. }
  436. public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel)
  437. {
  438. //triggerLandObjectRemoved(localParcelID);
  439. TriggerLandObjectAdded(newParcel);
  440. }
  441. public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, LLUUID regionID)
  442. {
  443. handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel;
  444. if (handlerAvatarEnteringNewParcel != null)
  445. {
  446. handlerAvatarEnteringNewParcel(avatar, localLandID, regionID);
  447. }
  448. }
  449. ///<summary>Used to pass instnat messages around between the Scene, the Friends Module and the Instant Messsage Module</summary>
  450. ///<param name="message">Object containing the Instant Message Data</param>
  451. ///<param name="whichModule">A bit vector containing the modules to send the message to</param>
  452. public void TriggerGridInstantMessage(GridInstantMessage message, InstantMessageReceiver whichModule)
  453. {
  454. if ((whichModule & InstantMessageReceiver.IMModule) != 0)
  455. {
  456. handlerGridInstantMessageToIM = OnGridInstantMessageToIMModule;
  457. if (handlerGridInstantMessageToIM != null)
  458. {
  459. handlerGridInstantMessageToIM(message);
  460. }
  461. }
  462. if ((whichModule & InstantMessageReceiver.FriendsModule) != 0)
  463. {
  464. handlerGridInstantMessageToFriends = OnGridInstantMessageToFriendsModule;
  465. if (handlerGridInstantMessageToFriends != null)
  466. {
  467. handlerGridInstantMessageToFriends(message);
  468. }
  469. }
  470. }
  471. public void TriggerClientClosed(LLUUID ClientID)
  472. {
  473. handlerClientClosed = OnClientClosed;
  474. if (handlerClientClosed != null)
  475. {
  476. handlerClientClosed(ClientID);
  477. }
  478. }
  479. public void TriggerOnMakeChildAgent(ScenePresence presence)
  480. {
  481. handlerMakeChildAgent = OnMakeChildAgent;
  482. if (handlerMakeChildAgent != null)
  483. {
  484. handlerMakeChildAgent(presence);
  485. }
  486. }
  487. public void TriggerOnMakeRootAgent(ScenePresence presence)
  488. {
  489. handlerMakeRootAgent = OnMakeRootAgent;
  490. if (handlerMakeRootAgent != null)
  491. {
  492. handlerMakeRootAgent(presence);
  493. }
  494. }
  495. public void TriggerOnRegisterCaps(LLUUID agentID, Caps caps)
  496. {
  497. handlerRegisterCaps = OnRegisterCaps;
  498. if (handlerRegisterCaps != null)
  499. {
  500. handlerRegisterCaps(agentID, caps);
  501. }
  502. }
  503. public void TriggerOnDeregisterCaps(LLUUID agentID, Caps caps)
  504. {
  505. handlerDeregisterCaps = OnDeregisterCaps;
  506. if (handlerDeregisterCaps != null)
  507. {
  508. handlerDeregisterCaps(agentID, caps);
  509. }
  510. }
  511. public void TriggerOnNewInventoryItemUploadComplete(LLUUID agentID, LLUUID AssetID, String AssetName, int userlevel)
  512. {
  513. handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete;
  514. if (handlerNewInventoryItemUpdateComplete != null)
  515. {
  516. handlerNewInventoryItemUpdateComplete(agentID, AssetID, AssetName, userlevel);
  517. }
  518. }
  519. public void TriggerLandBuy (Object sender, LandBuyArgs e)
  520. {
  521. handlerLandBuy = OnLandBuy;
  522. if (handlerLandBuy != null)
  523. {
  524. handlerLandBuy(sender, e);
  525. }
  526. }
  527. public void TriggerValidateLandBuy(Object sender, LandBuyArgs e)
  528. {
  529. handlerValidateLandBuy = OnValidateLandBuy;
  530. if (handlerValidateLandBuy != null)
  531. {
  532. handlerValidateLandBuy(sender, e);
  533. }
  534. }
  535. public void TriggerAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 currentpos)
  536. {
  537. handlerScriptAtTargetEvent = OnScriptAtTargetEvent;
  538. if (handlerScriptAtTargetEvent != null)
  539. {
  540. handlerScriptAtTargetEvent(localID, handle, targetpos, currentpos);
  541. }
  542. }
  543. public void TriggerNotAtTargetEvent(uint localID)
  544. {
  545. handlerScriptNotAtTargetEvent = OnScriptNotAtTargetEvent;
  546. if (handlerScriptNotAtTargetEvent != null)
  547. {
  548. handlerScriptNotAtTargetEvent(localID);
  549. }
  550. }
  551. public void TriggerRequestChangeWaterHeight(float height)
  552. {
  553. handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight;
  554. if (handlerRequestChangeWaterHeight != null)
  555. {
  556. handlerRequestChangeWaterHeight(height);
  557. }
  558. }
  559. public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar)
  560. {
  561. handlerAvatarKill = OnAvatarKilled;
  562. if (handlerAvatarKill != null)
  563. {
  564. handlerAvatarKill(KillerObjectLocalID, DeadAvatar);
  565. }
  566. }
  567. public void TriggerSignificantClientMovement(IClientAPI client)
  568. {
  569. handlerSignificantClientMovement = OnSignificantClientMovement;
  570. if (handlerSignificantClientMovement != null)
  571. {
  572. handlerSignificantClientMovement(client);
  573. }
  574. }
  575. public void TriggerOnChatFromWorld(Object sender, ChatFromViewerArgs chat)
  576. {
  577. handlerChatFromWorld = OnChatFromWorld;
  578. if (handlerChatFromWorld != null)
  579. {
  580. handlerChatFromWorld(sender, chat);
  581. }
  582. }
  583. public void TriggerOnChatBroadcast(Object sender, ChatFromViewerArgs chat)
  584. {
  585. handlerChatBroadcast = OnChatBroadcast;
  586. if (handlerChatBroadcast != null)
  587. {
  588. handlerChatBroadcast(sender, chat);
  589. }
  590. }
  591. internal void TriggerControlEvent(uint p, LLUUID scriptUUID, LLUUID avatarID, uint held, uint _changed)
  592. {
  593. handlerScriptControlEvent = OnScriptControlEvent;
  594. if (handlerScriptControlEvent != null)
  595. {
  596. handlerScriptControlEvent(p, scriptUUID, avatarID, held, _changed);
  597. }
  598. }
  599. public void TriggerNoticeNoLandDataFromStorage()
  600. {
  601. handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage;
  602. if (handlerNoticeNoLandDataFromStorage != null)
  603. {
  604. handlerNoticeNoLandDataFromStorage();
  605. }
  606. }
  607. public void TriggerIncomingLandDataFromStorage(List<LandData> landData)
  608. {
  609. handlerIncomingLandDataFromStorage = OnIncomingLandDataFromStorage;
  610. if (handlerIncomingLandDataFromStorage != null)
  611. {
  612. handlerIncomingLandDataFromStorage(landData);
  613. }
  614. }
  615. public void TriggerSetAllowForcefulBan(bool allow)
  616. {
  617. handlerSetAllowForcefulBan = OnSetAllowForcefulBan;
  618. if (handlerSetAllowForcefulBan != null)
  619. {
  620. handlerSetAllowForcefulBan(allow);
  621. }
  622. }
  623. public void TriggerRequestParcelPrimCountUpdate()
  624. {
  625. handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate;
  626. if (handlerRequestParcelPrimCountUpdate != null)
  627. {
  628. handlerRequestParcelPrimCountUpdate();
  629. }
  630. }
  631. public void TriggerParcelPrimCountTainted()
  632. {
  633. handlerParcelPrimCountTainted = OnParcelPrimCountTainted;
  634. if (handlerParcelPrimCountTainted != null)
  635. {
  636. handlerParcelPrimCountTainted();
  637. }
  638. }
  639. // this lets us keep track of nasty script events like timer, etc.
  640. public void TriggerTimerEvent(uint objLocalID, double Interval)
  641. {
  642. handlerScriptTimerEvent = OnScriptTimerEvent;
  643. if (handlerScriptTimerEvent != null)
  644. {
  645. handlerScriptTimerEvent(objLocalID, Interval);
  646. }
  647. }
  648. public void TriggerEstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour)
  649. {
  650. handlerEstateToolsTimeUpdate = OnEstateToolsTimeUpdate;
  651. if (handlerEstateToolsTimeUpdate != null)
  652. {
  653. handlerEstateToolsTimeUpdate(regionHandle, FixedTime, useEstateTime, LindenHour);
  654. }
  655. }
  656. }
  657. }