aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/EventManager.cs
diff options
context:
space:
mode:
authorDr Scofield2009-02-06 16:55:34 +0000
committerDr Scofield2009-02-06 16:55:34 +0000
commit9b66108081a8c8cf79faaa6c541554091c40850e (patch)
tree095a232ae5a9de3a9244bcd34da08294f61eeea5 /OpenSim/Region/Framework/Scenes/EventManager.cs
parent* removed superfluous constants class (diff)
downloadopensim-SC_OLD-9b66108081a8c8cf79faaa6c541554091c40850e.zip
opensim-SC_OLD-9b66108081a8c8cf79faaa6c541554091c40850e.tar.gz
opensim-SC_OLD-9b66108081a8c8cf79faaa6c541554091c40850e.tar.bz2
opensim-SC_OLD-9b66108081a8c8cf79faaa6c541554091c40850e.tar.xz
This changeset is the step 1 of 2 in refactoring
OpenSim.Region.Environment into a "framework" part and a modules only part. This first changeset refactors OpenSim.Region.Environment.Scenes, OpenSim.Region.Environment.Interfaces, and OpenSim.Region.Interfaces into OpenSim.Region.Framework.{Interfaces,Scenes} leaving only region modules in OpenSim.Region.Environment. The next step will be to move region modules up from OpenSim.Region.Environment.Modules to OpenSim.Region.CoreModules and then sort out which modules are really core modules and which should move out to forge. I've been very careful to NOT BREAK anything. i hope i've succeeded. as this is the work of a whole week i hope i managed to keep track with the applied patches of the last week --- could any of you that did check in stuff have a look at whether it survived? thx!
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs981
1 files changed, 981 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
new file mode 100644
index 0000000..23e1278
--- /dev/null
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -0,0 +1,981 @@
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
28using System;
29using OpenMetaverse;
30using OpenSim.Framework;
31using OpenSim.Framework.Client;
32using OpenSim.Region.Framework.Interfaces;
33using OpenSim.Region.Framework.Scenes;
34using Caps = OpenSim.Framework.Communications.Capabilities.Caps;
35using System.Collections.Generic;
36
37namespace OpenSim.Region.Framework.Scenes
38{
39 /// <summary>
40 /// A class for triggering remote scene events.
41 /// </summary>
42 public class EventManager
43 {
44 public delegate void OnFrameDelegate();
45
46 public event OnFrameDelegate OnFrame;
47
48 public delegate void ClientMovement(ScenePresence client);
49
50 public event ClientMovement OnClientMovement;
51
52 public delegate void OnTerrainTickDelegate();
53
54 public event OnTerrainTickDelegate OnTerrainTick;
55
56 public delegate void OnBackupDelegate(IRegionDataStore datastore, bool forceBackup);
57
58 public event OnBackupDelegate OnBackup;
59
60 public delegate void OnClientConnectCoreDelegate(IClientCore client);
61
62 public event OnClientConnectCoreDelegate OnClientConnect;
63
64 public delegate void OnNewClientDelegate(IClientAPI client);
65
66 /// <summary>
67 /// Depreciated in favour of OnClientConnect.
68 /// Will be marked Obsolete after IClientCore has 100% of IClientAPI interfaces.
69 /// </summary>
70 public event OnNewClientDelegate OnNewClient;
71
72 public delegate void OnNewPresenceDelegate(ScenePresence presence);
73
74 public event OnNewPresenceDelegate OnNewPresence;
75
76 public delegate void OnRemovePresenceDelegate(UUID agentId);
77
78 public event OnRemovePresenceDelegate OnRemovePresence;
79
80 public delegate void OnParcelPrimCountUpdateDelegate();
81
82 public event OnParcelPrimCountUpdateDelegate OnParcelPrimCountUpdate;
83
84 public delegate void OnParcelPrimCountAddDelegate(SceneObjectGroup obj);
85
86 public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd;
87
88 public delegate void OnPluginConsoleDelegate(string[] args);
89
90 public event OnPluginConsoleDelegate OnPluginConsole;
91
92 public delegate void OnShutdownDelegate();
93
94 public event OnShutdownDelegate OnShutdown;
95
96 public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs);
97 public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient);
98 public delegate void ScriptResetDelegate(uint localID, UUID itemID);
99
100 public delegate void OnPermissionErrorDelegate(UUID user, string reason);
101
102 public delegate void OnSetRootAgentSceneDelegate(UUID agentID, Scene scene);
103
104 public event OnSetRootAgentSceneDelegate OnSetRootAgentScene;
105
106 public event ObjectGrabDelegate OnObjectGrab;
107 public event ObjectDeGrabDelegate OnObjectDeGrab;
108 public event ScriptResetDelegate OnScriptReset;
109
110 public event OnPermissionErrorDelegate OnPermissionError;
111
112 public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource);
113
114 public event NewRezScript OnRezScript;
115
116 public delegate void RemoveScript(uint localID, UUID itemID);
117
118 public event RemoveScript OnRemoveScript;
119
120 public delegate void StartScript(uint localID, UUID itemID);
121
122 public event StartScript OnStartScript;
123
124 public delegate void StopScript(uint localID, UUID itemID);
125
126 public event StopScript OnStopScript;
127
128 public delegate bool SceneGroupMoved(UUID groupID, Vector3 delta);
129
130 public event SceneGroupMoved OnSceneGroupMove;
131
132 public delegate void SceneGroupGrabed(UUID groupID, Vector3 offset, UUID userID);
133
134 public event SceneGroupGrabed OnSceneGroupGrab;
135
136 public delegate void LandObjectAdded(ILandObject newParcel);
137
138 public event LandObjectAdded OnLandObjectAdded;
139
140 public delegate void LandObjectRemoved(UUID globalID);
141
142 public event LandObjectRemoved OnLandObjectRemoved;
143
144 public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID);
145
146 public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
147
148 public delegate void SignificantClientMovement(IClientAPI remote_client);
149
150 public event SignificantClientMovement OnSignificantClientMovement;
151
152 public delegate void IncomingInstantMessage(GridInstantMessage message);
153
154 public event IncomingInstantMessage OnIncomingInstantMessage;
155
156 public event IncomingInstantMessage OnUnhandledInstantMessage;
157
158 public delegate void ClientClosed(UUID clientID);
159
160 public event ClientClosed OnClientClosed;
161
162 public delegate void ScriptChangedEvent(uint localID, uint change);
163
164 public event ScriptChangedEvent OnScriptChangedEvent;
165
166 public delegate void ScriptControlEvent(uint localID, UUID item, UUID avatarID, uint held, uint changed);
167
168 public event ScriptControlEvent OnScriptControlEvent;
169
170 public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos);
171
172 public event ScriptAtTargetEvent OnScriptAtTargetEvent;
173
174 public delegate void ScriptNotAtTargetEvent(uint localID);
175
176 public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent;
177
178 public delegate void ScriptColliding(uint localID, ColliderArgs colliders);
179
180 public event ScriptColliding OnScriptColliderStart;
181 public event ScriptColliding OnScriptColliding;
182 public event ScriptColliding OnScriptCollidingEnd;
183
184 public delegate void OnMakeChildAgentDelegate(ScenePresence presence);
185 public event OnMakeChildAgentDelegate OnMakeChildAgent;
186
187 public delegate void OnMakeRootAgentDelegate(ScenePresence presence);
188 public event OnMakeRootAgentDelegate OnMakeRootAgent;
189
190 public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel);
191
192 public event NewInventoryItemUploadComplete OnNewInventoryItemUploadComplete;
193
194 public delegate void RequestChangeWaterHeight(float height);
195
196 public event RequestChangeWaterHeight OnRequestChangeWaterHeight;
197
198 public delegate void AvatarKillData(uint KillerLocalID, ScenePresence avatar);
199
200 public event AvatarKillData OnAvatarKilled;
201
202 public delegate void ScriptTimerEvent(uint localID, double timerinterval);
203
204 public event ScriptTimerEvent OnScriptTimerEvent;
205
206 public delegate void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour);
207 public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID);
208
209 public event EstateToolsTimeUpdate OnEstateToolsTimeUpdate;
210
211 public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj);
212 public event ObjectBeingRemovedFromScene OnObjectBeingRemovedFromScene;
213
214 public delegate void NoticeNoLandDataFromStorage();
215 public event NoticeNoLandDataFromStorage OnNoticeNoLandDataFromStorage;
216
217 public delegate void IncomingLandDataFromStorage(List<LandData> data);
218 public event IncomingLandDataFromStorage OnIncomingLandDataFromStorage;
219
220 public delegate void SetAllowForcefulBan(bool allow);
221 public event SetAllowForcefulBan OnSetAllowForcefulBan;
222
223 public delegate void RequestParcelPrimCountUpdate();
224 public event RequestParcelPrimCountUpdate OnRequestParcelPrimCountUpdate;
225
226 public delegate void ParcelPrimCountTainted();
227 public event ParcelPrimCountTainted OnParcelPrimCountTainted;
228 public event GetScriptRunning OnGetScriptRunning;
229
230 /// <summary>
231 /// RegisterCapsEvent is called by Scene after the Caps object
232 /// has been instantiated and before it is return to the
233 /// client and provides region modules to add their caps.
234 /// </summary>
235 public delegate void RegisterCapsEvent(UUID agentID, Caps caps);
236 public event RegisterCapsEvent OnRegisterCaps;
237
238 /// <summary>
239 /// DeregisterCapsEvent is called by Scene when the caps
240 /// handler for an agent are removed.
241 /// </summary>
242 public delegate void DeregisterCapsEvent(UUID agentID, Caps caps);
243 public event DeregisterCapsEvent OnDeregisterCaps;
244
245 /// <summary>
246 /// ChatFromWorldEvent is called via Scene when a chat message
247 /// from world comes in.
248 /// </summary>
249 public delegate void ChatFromWorldEvent(Object sender, OSChatMessage chat);
250 public event ChatFromWorldEvent OnChatFromWorld;
251
252 /// <summary>
253 /// ChatFromClientEvent is triggered via ChatModule (or
254 /// substitutes thereof) when a chat message
255 /// from the client comes in.
256 /// </summary>
257 public delegate void ChatFromClientEvent(Object sender, OSChatMessage chat);
258 public event ChatFromClientEvent OnChatFromClient;
259
260 /// <summary>
261 /// ChatBroadcastEvent is called via Scene when a broadcast chat message
262 /// from world comes in
263 /// </summary>
264 public delegate void ChatBroadcastEvent(Object sender, OSChatMessage chat);
265 public event ChatBroadcastEvent OnChatBroadcast;
266
267 public delegate float SunLindenHour();
268 public event SunLindenHour OnGetSunLindenHour;
269
270 /// <summary>
271 /// Called when oar file has finished loading, although
272 /// the scripts may not have started yet
273 /// Message is non empty string if there were problems loading the oar file
274 /// </summary>
275 public delegate void OarFileLoaded(string message);
276 public event OarFileLoaded OnOarFileLoaded;
277
278 /// <summary>
279 /// Called when an oar file has finished saving
280 /// Message is non empty string if there were problems saving the oar file
281 /// </summary>
282 public delegate void OarFileSaved(string message);
283 public event OarFileSaved OnOarFileSaved;
284
285 /// <summary>
286 /// Called when the script compile queue becomes empty
287 /// Returns the number of scripts which failed to start
288 /// </summary>
289 public delegate void EmptyScriptCompileQueue(int numScriptsFailed, string message);
290 public event EmptyScriptCompileQueue OnEmptyScriptCompileQueue;
291
292 public class MoneyTransferArgs : EventArgs
293 {
294 public UUID sender;
295 public UUID receiver;
296
297 // Always false. The SL protocol sucks.
298 public bool authenticated = false;
299
300 public int amount;
301 public int transactiontype;
302 public string description;
303
304 public MoneyTransferArgs(UUID asender, UUID areceiver, int aamount, int atransactiontype, string adescription)
305 {
306 sender = asender;
307 receiver = areceiver;
308 amount = aamount;
309 transactiontype = atransactiontype;
310 description = adescription;
311 }
312 }
313
314 public class LandBuyArgs : EventArgs
315 {
316 public UUID agentId = UUID.Zero;
317
318 public UUID groupId = UUID.Zero;
319
320 public UUID parcelOwnerID = UUID.Zero;
321
322 public bool final = false;
323 public bool groupOwned = false;
324 public bool removeContribution = false;
325 public int parcelLocalID = 0;
326 public int parcelArea = 0;
327 public int parcelPrice = 0;
328 public bool authenticated = false;
329 public bool landValidated = false;
330 public bool economyValidated = false;
331 public int transactionID = 0;
332 public int amountDebited = 0;
333
334 public LandBuyArgs(UUID pagentId, UUID pgroupId, bool pfinal, bool pgroupOwned,
335 bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice,
336 bool pauthenticated)
337 {
338 agentId = pagentId;
339 groupId = pgroupId;
340 final = pfinal;
341 groupOwned = pgroupOwned;
342 removeContribution = premoveContribution;
343 parcelLocalID = pparcelLocalID;
344 parcelArea = pparcelArea;
345 parcelPrice = pparcelPrice;
346 authenticated = pauthenticated;
347 }
348 }
349
350 public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e);
351
352 public delegate void LandBuy(Object sender, LandBuyArgs e);
353
354 public event MoneyTransferEvent OnMoneyTransfer;
355 public event LandBuy OnLandBuy;
356 public event LandBuy OnValidateLandBuy;
357
358 /* Designated Event Deletage Instances */
359
360 private ScriptChangedEvent handlerScriptChangedEvent = null; //OnScriptChangedEvent;
361 private ScriptAtTargetEvent handlerScriptAtTargetEvent = null;
362 private ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = null;
363 private ClientMovement handlerClientMovement = null; //OnClientMovement;
364 private OnPermissionErrorDelegate handlerPermissionError = null; //OnPermissionError;
365 private OnPluginConsoleDelegate handlerPluginConsole = null; //OnPluginConsole;
366 private OnFrameDelegate handlerFrame = null; //OnFrame;
367 private OnNewClientDelegate handlerNewClient = null; //OnNewClient;
368 private OnClientConnectCoreDelegate handlerClientConnect = null; //OnClientConnect
369 private OnNewPresenceDelegate handlerNewPresence = null; //OnNewPresence;
370 private OnRemovePresenceDelegate handlerRemovePresence = null; //OnRemovePresence;
371 private OnBackupDelegate handlerBackup = null; //OnBackup;
372 private OnParcelPrimCountUpdateDelegate handlerParcelPrimCountUpdate = null; //OnParcelPrimCountUpdate;
373 private MoneyTransferEvent handlerMoneyTransfer = null; //OnMoneyTransfer;
374 private OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = null; //OnParcelPrimCountAdd;
375 private OnShutdownDelegate handlerShutdown = null; //OnShutdown;
376 private ObjectGrabDelegate handlerObjectGrab = null; //OnObjectGrab;
377 private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab;
378 private ScriptResetDelegate handlerScriptReset = null; // OnScriptReset
379 private NewRezScript handlerRezScript = null; //OnRezScript;
380 private RemoveScript handlerRemoveScript = null; //OnRemoveScript;
381 private StartScript handlerStartScript = null; //OnStartScript;
382 private StopScript handlerStopScript = null; //OnStopScript;
383 private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove;
384 private SceneGroupGrabed handlerSceneGroupGrab = null; //OnSceneGroupGrab;
385 private LandObjectAdded handlerLandObjectAdded = null; //OnLandObjectAdded;
386 private LandObjectRemoved handlerLandObjectRemoved = null; //OnLandObjectRemoved;
387 private AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = null; //OnAvatarEnteringNewParcel;
388 private IncomingInstantMessage handlerIncomingInstantMessage = null; //OnIncomingInstantMessage;
389 private IncomingInstantMessage handlerUnhandledInstantMessage = null; //OnUnhandledInstantMessage;
390 private ClientClosed handlerClientClosed = null; //OnClientClosed;
391 private OnMakeChildAgentDelegate handlerMakeChildAgent = null; //OnMakeChildAgent;
392 private OnMakeRootAgentDelegate handlerMakeRootAgent = null; //OnMakeRootAgent;
393 private OnTerrainTickDelegate handlerTerrainTick = null; // OnTerainTick;
394 private RegisterCapsEvent handlerRegisterCaps = null; // OnRegisterCaps;
395 private DeregisterCapsEvent handlerDeregisterCaps = null; // OnDeregisterCaps;
396 private ChatFromWorldEvent handlerChatFromWorld = null; // OnChatFromWorld;
397 private ChatFromClientEvent handlerChatFromClient = null; // OnChatFromClient;
398 private ChatBroadcastEvent handlerChatBroadcast = null; // OnChatBroadcast;
399 private NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = null;
400 private RequestChangeWaterHeight handlerRequestChangeWaterHeight = null; //OnRequestChangeWaterHeight
401 private ScriptControlEvent handlerScriptControlEvent = null;
402 private SignificantClientMovement handlerSignificantClientMovement = null;
403
404 private LandBuy handlerLandBuy = null;
405 private LandBuy handlerValidateLandBuy = null;
406 private AvatarKillData handlerAvatarKill = null;
407
408 private NoticeNoLandDataFromStorage handlerNoticeNoLandDataFromStorage = null;
409 private IncomingLandDataFromStorage handlerIncomingLandDataFromStorage = null;
410 private SetAllowForcefulBan handlerSetAllowForcefulBan = null;
411 private RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = null;
412 private ParcelPrimCountTainted handlerParcelPrimCountTainted = null;
413 private ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = null;
414 private ScriptTimerEvent handlerScriptTimerEvent = null;
415 private EstateToolsTimeUpdate handlerEstateToolsTimeUpdate = null;
416
417 private ScriptColliding handlerCollidingStart = null;
418 private ScriptColliding handlerColliding = null;
419 private ScriptColliding handlerCollidingEnd = null;
420 private GetScriptRunning handlerGetScriptRunning = null;
421
422 private SunLindenHour handlerSunGetLindenHour = null;
423 private OnSetRootAgentSceneDelegate handlerSetRootAgentScene = null;
424
425 private OarFileLoaded handlerOarFileLoaded = null;
426 private OarFileSaved handlerOarFileSaved = null;
427
428 private EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = null;
429
430 public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
431 {
432 handlerGetScriptRunning = OnGetScriptRunning;
433 if (handlerGetScriptRunning != null)
434 handlerGetScriptRunning(controllingClient, objectID, itemID);
435 }
436
437 public void TriggerOnScriptChangedEvent(uint localID, uint change)
438 {
439 handlerScriptChangedEvent = OnScriptChangedEvent;
440 if (handlerScriptChangedEvent != null)
441 handlerScriptChangedEvent(localID, change);
442 }
443
444 public void TriggerOnClientMovement(ScenePresence avatar)
445 {
446 handlerClientMovement = OnClientMovement;
447 if (handlerClientMovement != null)
448 handlerClientMovement(avatar);
449 }
450
451 public void TriggerPermissionError(UUID user, string reason)
452 {
453 handlerPermissionError = OnPermissionError;
454 if (handlerPermissionError != null)
455 handlerPermissionError(user, reason);
456 }
457
458 public void TriggerOnPluginConsole(string[] args)
459 {
460 handlerPluginConsole = OnPluginConsole;
461 if (handlerPluginConsole != null)
462 handlerPluginConsole(args);
463 }
464
465 public void TriggerOnFrame()
466 {
467 handlerFrame = OnFrame;
468 if (handlerFrame != null)
469 {
470 handlerFrame();
471 }
472 }
473
474 public void TriggerOnNewClient(IClientAPI client)
475 {
476 handlerNewClient = OnNewClient;
477 if (handlerNewClient != null)
478 handlerNewClient(client);
479
480 if (client is IClientCore)
481 {
482 handlerClientConnect = OnClientConnect;
483 handlerClientConnect((IClientCore) client);
484 }
485 }
486
487 public void TriggerOnNewPresence(ScenePresence presence)
488 {
489 handlerNewPresence = OnNewPresence;
490 if (handlerNewPresence != null)
491 handlerNewPresence(presence);
492 }
493
494 public void TriggerOnRemovePresence(UUID agentId)
495 {
496 handlerRemovePresence = OnRemovePresence;
497 if (handlerRemovePresence != null)
498 {
499 handlerRemovePresence(agentId);
500 }
501 }
502
503 public void TriggerOnBackup(IRegionDataStore dstore)
504 {
505 handlerBackup = OnBackup;
506 if (handlerBackup != null)
507 {
508 handlerBackup(dstore, false);
509 }
510 }
511
512 public void TriggerParcelPrimCountUpdate()
513 {
514 handlerParcelPrimCountUpdate = OnParcelPrimCountUpdate;
515 if (handlerParcelPrimCountUpdate != null)
516 {
517 handlerParcelPrimCountUpdate();
518 }
519 }
520
521 public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs e)
522 {
523 handlerMoneyTransfer = OnMoneyTransfer;
524 if (handlerMoneyTransfer != null)
525 {
526 handlerMoneyTransfer(sender, e);
527 }
528 }
529
530 public void TriggerTerrainTick()
531 {
532 handlerTerrainTick = OnTerrainTick;
533 if (handlerTerrainTick != null)
534 {
535 handlerTerrainTick();
536 }
537 }
538
539 public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
540 {
541 handlerParcelPrimCountAdd = OnParcelPrimCountAdd;
542 if (handlerParcelPrimCountAdd != null)
543 {
544 handlerParcelPrimCountAdd(obj);
545 }
546 }
547
548 public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj)
549 {
550 handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene;
551 if (handlerObjectBeingRemovedFromScene != null)
552 {
553 handlerObjectBeingRemovedFromScene(obj);
554 }
555 }
556
557 public void TriggerShutdown()
558 {
559 handlerShutdown = OnShutdown;
560 if (handlerShutdown != null)
561 handlerShutdown();
562 }
563
564 public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
565 {
566 handlerObjectGrab = OnObjectGrab;
567 if (handlerObjectGrab != null)
568 {
569 handlerObjectGrab(localID, originalID, offsetPos, remoteClient, surfaceArgs);
570 }
571 }
572
573 public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient)
574 {
575 handlerObjectDeGrab = OnObjectDeGrab;
576 if (handlerObjectDeGrab != null)
577 {
578 handlerObjectDeGrab(localID, originalID, remoteClient);
579 }
580 }
581
582 public void TriggerScriptReset(uint localID, UUID itemID)
583 {
584 handlerScriptReset = OnScriptReset;
585 if (handlerScriptReset != null)
586 {
587 handlerScriptReset(localID, itemID);
588 }
589 }
590
591 public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource)
592 {
593 handlerRezScript = OnRezScript;
594 if (handlerRezScript != null)
595 {
596 handlerRezScript(localID, itemID, script, startParam,
597 postOnRez, engine, stateSource);
598 }
599 }
600
601 public void TriggerStartScript(uint localID, UUID itemID)
602 {
603 handlerStartScript = OnStartScript;
604 if (handlerStartScript != null)
605 {
606 handlerStartScript(localID, itemID);
607 }
608 }
609
610 public void TriggerStopScript(uint localID, UUID itemID)
611 {
612 handlerStopScript = OnStopScript;
613 if (handlerStopScript != null)
614 {
615 handlerStopScript(localID, itemID);
616 }
617 }
618
619 public void TriggerRemoveScript(uint localID, UUID itemID)
620 {
621 handlerRemoveScript = OnRemoveScript;
622 if (handlerRemoveScript != null)
623 {
624 handlerRemoveScript(localID, itemID);
625 }
626 }
627
628 public bool TriggerGroupMove(UUID groupID, Vector3 delta)
629 {
630 handlerSceneGroupMove = OnSceneGroupMove;
631
632 if (handlerSceneGroupMove != null)
633 {
634 return handlerSceneGroupMove(groupID, delta);
635 }
636 return true;
637 }
638
639 public void TriggerGroupGrab(UUID groupID, Vector3 offset, UUID userID)
640 {
641 handlerSceneGroupGrab = OnSceneGroupGrab;
642 if (handlerSceneGroupGrab != null)
643 {
644 handlerSceneGroupGrab(groupID, offset, userID);
645 }
646 }
647
648 public void TriggerLandObjectAdded(ILandObject newParcel)
649 {
650 handlerLandObjectAdded = OnLandObjectAdded;
651
652 if (handlerLandObjectAdded != null)
653 {
654 handlerLandObjectAdded(newParcel);
655 }
656 }
657
658 public void TriggerLandObjectRemoved(UUID globalID)
659 {
660 handlerLandObjectRemoved = OnLandObjectRemoved;
661 if (handlerLandObjectRemoved != null)
662 {
663 handlerLandObjectRemoved(globalID);
664 }
665 }
666
667 public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel)
668 {
669 //triggerLandObjectRemoved(localParcelID);
670
671 TriggerLandObjectAdded(newParcel);
672 }
673
674 public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID)
675 {
676 handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel;
677
678 if (handlerAvatarEnteringNewParcel != null)
679 {
680 handlerAvatarEnteringNewParcel(avatar, localLandID, regionID);
681 }
682 }
683
684 public void TriggerIncomingInstantMessage(GridInstantMessage message)
685 {
686 handlerIncomingInstantMessage = OnIncomingInstantMessage;
687 if (handlerIncomingInstantMessage != null)
688 {
689 handlerIncomingInstantMessage(message);
690 }
691 }
692
693 public void TriggerUnhandledInstantMessage(GridInstantMessage message)
694 {
695 handlerUnhandledInstantMessage = OnUnhandledInstantMessage;
696 if (handlerUnhandledInstantMessage != null)
697 {
698 handlerUnhandledInstantMessage(message);
699 }
700 }
701
702 public void TriggerClientClosed(UUID ClientID)
703 {
704 handlerClientClosed = OnClientClosed;
705 if (handlerClientClosed != null)
706 {
707 handlerClientClosed(ClientID);
708 }
709 }
710
711 public void TriggerOnMakeChildAgent(ScenePresence presence)
712 {
713 handlerMakeChildAgent = OnMakeChildAgent;
714 if (handlerMakeChildAgent != null)
715 {
716 handlerMakeChildAgent(presence);
717 }
718 }
719
720 public void TriggerOnMakeRootAgent(ScenePresence presence)
721 {
722 handlerMakeRootAgent = OnMakeRootAgent;
723 if (handlerMakeRootAgent != null)
724 {
725 handlerMakeRootAgent(presence);
726 }
727 }
728
729 public void TriggerOnRegisterCaps(UUID agentID, Caps caps)
730 {
731 handlerRegisterCaps = OnRegisterCaps;
732 if (handlerRegisterCaps != null)
733 {
734 handlerRegisterCaps(agentID, caps);
735 }
736 }
737
738 public void TriggerOnDeregisterCaps(UUID agentID, Caps caps)
739 {
740 handlerDeregisterCaps = OnDeregisterCaps;
741 if (handlerDeregisterCaps != null)
742 {
743 handlerDeregisterCaps(agentID, caps);
744 }
745 }
746
747 public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel)
748 {
749 handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete;
750 if (handlerNewInventoryItemUpdateComplete != null)
751 {
752 handlerNewInventoryItemUpdateComplete(agentID, AssetID, AssetName, userlevel);
753 }
754 }
755
756 public void TriggerLandBuy(Object sender, LandBuyArgs e)
757 {
758 handlerLandBuy = OnLandBuy;
759 if (handlerLandBuy != null)
760 {
761 handlerLandBuy(sender, e);
762 }
763 }
764
765 public void TriggerValidateLandBuy(Object sender, LandBuyArgs e)
766 {
767 handlerValidateLandBuy = OnValidateLandBuy;
768 if (handlerValidateLandBuy != null)
769 {
770 handlerValidateLandBuy(sender, e);
771 }
772 }
773
774 public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos)
775 {
776 handlerScriptAtTargetEvent = OnScriptAtTargetEvent;
777 if (handlerScriptAtTargetEvent != null)
778 {
779 handlerScriptAtTargetEvent(localID, handle, targetpos, currentpos);
780 }
781 }
782
783 public void TriggerNotAtTargetEvent(uint localID)
784 {
785 handlerScriptNotAtTargetEvent = OnScriptNotAtTargetEvent;
786 if (handlerScriptNotAtTargetEvent != null)
787 {
788 handlerScriptNotAtTargetEvent(localID);
789 }
790 }
791
792 public void TriggerRequestChangeWaterHeight(float height)
793 {
794 handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight;
795 if (handlerRequestChangeWaterHeight != null)
796 {
797 handlerRequestChangeWaterHeight(height);
798 }
799 }
800
801 public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar)
802 {
803 handlerAvatarKill = OnAvatarKilled;
804 if (handlerAvatarKill != null)
805 {
806 handlerAvatarKill(KillerObjectLocalID, DeadAvatar);
807 }
808 }
809
810 public void TriggerSignificantClientMovement(IClientAPI client)
811 {
812 handlerSignificantClientMovement = OnSignificantClientMovement;
813 if (handlerSignificantClientMovement != null)
814 {
815 handlerSignificantClientMovement(client);
816 }
817 }
818
819 public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat)
820 {
821 handlerChatFromWorld = OnChatFromWorld;
822 if (handlerChatFromWorld != null)
823 {
824 handlerChatFromWorld(sender, chat);
825 }
826 }
827
828 public void TriggerOnChatFromClient(Object sender, OSChatMessage chat)
829 {
830 handlerChatFromClient = OnChatFromClient;
831 if (handlerChatFromClient != null)
832 {
833 handlerChatFromClient(sender, chat);
834 }
835 }
836
837 public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
838 {
839 handlerChatBroadcast = OnChatBroadcast;
840 if (handlerChatBroadcast != null)
841 {
842 handlerChatBroadcast(sender, chat);
843 }
844 }
845
846 internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed)
847 {
848 handlerScriptControlEvent = OnScriptControlEvent;
849 if (handlerScriptControlEvent != null)
850 {
851 handlerScriptControlEvent(p, scriptUUID, avatarID, held, _changed);
852 }
853 }
854
855 public void TriggerNoticeNoLandDataFromStorage()
856 {
857 handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage;
858 if (handlerNoticeNoLandDataFromStorage != null)
859 {
860 handlerNoticeNoLandDataFromStorage();
861
862 }
863 }
864
865 public void TriggerIncomingLandDataFromStorage(List<LandData> landData)
866 {
867 handlerIncomingLandDataFromStorage = OnIncomingLandDataFromStorage;
868 if (handlerIncomingLandDataFromStorage != null)
869 {
870 handlerIncomingLandDataFromStorage(landData);
871
872 }
873 }
874
875 public void TriggerSetAllowForcefulBan(bool allow)
876 {
877 handlerSetAllowForcefulBan = OnSetAllowForcefulBan;
878 if (handlerSetAllowForcefulBan != null)
879 {
880 handlerSetAllowForcefulBan(allow);
881
882 }
883 }
884
885 public void TriggerRequestParcelPrimCountUpdate()
886 {
887 handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate;
888 if (handlerRequestParcelPrimCountUpdate != null)
889 {
890 handlerRequestParcelPrimCountUpdate();
891 }
892 }
893
894 public void TriggerParcelPrimCountTainted()
895 {
896 handlerParcelPrimCountTainted = OnParcelPrimCountTainted;
897 if (handlerParcelPrimCountTainted != null)
898 {
899 handlerParcelPrimCountTainted();
900 }
901 }
902
903 // this lets us keep track of nasty script events like timer, etc.
904 public void TriggerTimerEvent(uint objLocalID, double Interval)
905 {
906 handlerScriptTimerEvent = OnScriptTimerEvent;
907 if (handlerScriptTimerEvent != null)
908 {
909 handlerScriptTimerEvent(objLocalID, Interval);
910 }
911 }
912
913 public void TriggerEstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour)
914 {
915 handlerEstateToolsTimeUpdate = OnEstateToolsTimeUpdate;
916 if (handlerEstateToolsTimeUpdate != null)
917 {
918 handlerEstateToolsTimeUpdate(regionHandle, FixedTime, useEstateTime, LindenHour);
919 }
920 }
921
922 public float GetSunLindenHour()
923 {
924 handlerSunGetLindenHour = OnGetSunLindenHour;
925 if (handlerSunGetLindenHour != null)
926 {
927 return handlerSunGetLindenHour();
928 }
929 return 6;
930 }
931
932 public void TriggerOarFileLoaded(string message)
933 {
934 handlerOarFileLoaded = OnOarFileLoaded;
935 if (handlerOarFileLoaded != null)
936 handlerOarFileLoaded(message);
937 }
938
939 public void TriggerOarFileSaved(string message)
940 {
941 handlerOarFileSaved = OnOarFileSaved;
942 if (handlerOarFileSaved != null)
943 handlerOarFileSaved(message);
944 }
945
946 public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message)
947 {
948 handlerEmptyScriptCompileQueue = OnEmptyScriptCompileQueue;
949 if (handlerEmptyScriptCompileQueue != null)
950 handlerEmptyScriptCompileQueue(numScriptsFailed, message);
951 }
952
953 public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders)
954 {
955 handlerCollidingStart = OnScriptColliderStart;
956 if (handlerCollidingStart != null)
957 handlerCollidingStart(localId, colliders);
958 }
959
960 public void TriggerScriptColliding(uint localId, ColliderArgs colliders)
961 {
962 handlerColliding = OnScriptColliding;
963 if (handlerColliding != null)
964 handlerColliding(localId, colliders);
965 }
966
967 public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders)
968 {
969 handlerCollidingEnd = OnScriptCollidingEnd;
970 if (handlerCollidingEnd != null)
971 handlerCollidingEnd(localId, colliders);
972 }
973
974 public void TriggerSetRootAgentScene(UUID agentID, Scene scene)
975 {
976 handlerSetRootAgentScene = OnSetRootAgentScene;
977 if (handlerSetRootAgentScene != null)
978 handlerSetRootAgentScene(agentID, scene);
979 }
980 }
981}