aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/EventManager.cs
diff options
context:
space:
mode:
authorMelanie2010-02-08 15:53:20 +0000
committerMelanie2010-02-08 15:53:38 +0000
commitbaaf660511214e52ea4ed20b8e80ec8e1ff06a3a (patch)
tree1e90c7a22ea3354d6bfd5d2b3f8f64f199dbd477 /OpenSim/Region/Framework/Scenes/EventManager.cs
parentAdded missing configs to Standalone.ini (diff)
parentAdding the Careminster "Configger" tool to OpenSim. The tool will, when launched (diff)
downloadopensim-SC_OLD-baaf660511214e52ea4ed20b8e80ec8e1ff06a3a.zip
opensim-SC_OLD-baaf660511214e52ea4ed20b8e80ec8e1ff06a3a.tar.gz
opensim-SC_OLD-baaf660511214e52ea4ed20b8e80ec8e1ff06a3a.tar.bz2
opensim-SC_OLD-baaf660511214e52ea4ed20b8e80ec8e1ff06a3a.tar.xz
Merge branch 'master' into presence-refactor
This was a large, heavily conflicted merge and things MAY have got broken. Please check!
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs1511
1 files changed, 1173 insertions, 338 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 399379e..473920e 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -27,11 +27,13 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection;
31using log4net;
30using OpenMetaverse; 32using OpenMetaverse;
31using OpenSim.Framework; 33using OpenSim.Framework;
32using OpenSim.Framework.Client; 34using OpenSim.Framework.Client;
33using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
34using Caps=OpenSim.Framework.Capabilities.Caps; 36using Caps = OpenSim.Framework.Capabilities.Caps;
35using GridRegion = OpenSim.Services.Interfaces.GridRegion; 37using GridRegion = OpenSim.Services.Interfaces.GridRegion;
36 38
37namespace OpenSim.Region.Framework.Scenes 39namespace OpenSim.Region.Framework.Scenes
@@ -41,6 +43,8 @@ namespace OpenSim.Region.Framework.Scenes
41 /// </summary> 43 /// </summary>
42 public class EventManager 44 public class EventManager
43 { 45 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47
44 public delegate void OnFrameDelegate(); 48 public delegate void OnFrameDelegate();
45 49
46 public event OnFrameDelegate OnFrame; 50 public event OnFrameDelegate OnFrame;
@@ -92,8 +96,7 @@ namespace OpenSim.Region.Framework.Scenes
92 public delegate void OnShutdownDelegate(); 96 public delegate void OnShutdownDelegate();
93 97
94 public event OnShutdownDelegate OnShutdown; 98 public event OnShutdownDelegate OnShutdown;
95 99
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, SurfaceTouchEventArgs surfaceArgs); 100 public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs);
98 public delegate void ScriptResetDelegate(uint localID, UUID itemID); 101 public delegate void ScriptResetDelegate(uint localID, UUID itemID);
99 102
@@ -103,62 +106,57 @@ namespace OpenSim.Region.Framework.Scenes
103 106
104 public event OnSetRootAgentSceneDelegate OnSetRootAgentScene; 107 public event OnSetRootAgentSceneDelegate OnSetRootAgentScene;
105 108
109 /// <summary>
110 /// Called when an object is touched/grabbed.
111 /// </summary>
112 /// The originalID is the local ID of the part that was actually touched. The localID itself is always that of
113 /// the root part.
114 public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs);
106 public event ObjectGrabDelegate OnObjectGrab; 115 public event ObjectGrabDelegate OnObjectGrab;
116
117 public event ObjectGrabDelegate OnObjectGrabbing;
107 public event ObjectDeGrabDelegate OnObjectDeGrab; 118 public event ObjectDeGrabDelegate OnObjectDeGrab;
108 public event ScriptResetDelegate OnScriptReset; 119 public event ScriptResetDelegate OnScriptReset;
109 120
110 public event OnPermissionErrorDelegate OnPermissionError; 121 public event OnPermissionErrorDelegate OnPermissionError;
111 122
112 public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource); 123 public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource);
113
114 public event NewRezScript OnRezScript; 124 public event NewRezScript OnRezScript;
115 125
116 public delegate void RemoveScript(uint localID, UUID itemID); 126 public delegate void RemoveScript(uint localID, UUID itemID);
117
118 public event RemoveScript OnRemoveScript; 127 public event RemoveScript OnRemoveScript;
119 128
120 public delegate void StartScript(uint localID, UUID itemID); 129 public delegate void StartScript(uint localID, UUID itemID);
121
122 public event StartScript OnStartScript; 130 public event StartScript OnStartScript;
123 131
124 public delegate void StopScript(uint localID, UUID itemID); 132 public delegate void StopScript(uint localID, UUID itemID);
125
126 public event StopScript OnStopScript; 133 public event StopScript OnStopScript;
127 134
128 public delegate bool SceneGroupMoved(UUID groupID, Vector3 delta); 135 public delegate bool SceneGroupMoved(UUID groupID, Vector3 delta);
129
130 public event SceneGroupMoved OnSceneGroupMove; 136 public event SceneGroupMoved OnSceneGroupMove;
131 137
132 public delegate void SceneGroupGrabed(UUID groupID, Vector3 offset, UUID userID); 138 public delegate void SceneGroupGrabed(UUID groupID, Vector3 offset, UUID userID);
133
134 public event SceneGroupGrabed OnSceneGroupGrab; 139 public event SceneGroupGrabed OnSceneGroupGrab;
135 140
136 public delegate bool SceneGroupSpinStarted(UUID groupID); 141 public delegate bool SceneGroupSpinStarted(UUID groupID);
137
138 public event SceneGroupSpinStarted OnSceneGroupSpinStart; 142 public event SceneGroupSpinStarted OnSceneGroupSpinStart;
139 143
140 public delegate bool SceneGroupSpun(UUID groupID, Quaternion rotation); 144 public delegate bool SceneGroupSpun(UUID groupID, Quaternion rotation);
141
142 public event SceneGroupSpun OnSceneGroupSpin; 145 public event SceneGroupSpun OnSceneGroupSpin;
143 146
144 public delegate void LandObjectAdded(ILandObject newParcel); 147 public delegate void LandObjectAdded(ILandObject newParcel);
145
146 public event LandObjectAdded OnLandObjectAdded; 148 public event LandObjectAdded OnLandObjectAdded;
147 149
148 public delegate void LandObjectRemoved(UUID globalID); 150 public delegate void LandObjectRemoved(UUID globalID);
149
150 public event LandObjectRemoved OnLandObjectRemoved; 151 public event LandObjectRemoved OnLandObjectRemoved;
151 152
152 public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID); 153 public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID);
153
154 public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; 154 public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
155 155
156 public delegate void SignificantClientMovement(IClientAPI remote_client); 156 public delegate void SignificantClientMovement(IClientAPI remote_client);
157
158 public event SignificantClientMovement OnSignificantClientMovement; 157 public event SignificantClientMovement OnSignificantClientMovement;
159 158
160 public delegate void IncomingInstantMessage(GridInstantMessage message); 159 public delegate void IncomingInstantMessage(GridInstantMessage message);
161
162 public event IncomingInstantMessage OnIncomingInstantMessage; 160 public event IncomingInstantMessage OnIncomingInstantMessage;
163 161
164 public event IncomingInstantMessage OnUnhandledInstantMessage; 162 public event IncomingInstantMessage OnUnhandledInstantMessage;
@@ -214,14 +212,16 @@ namespace OpenSim.Region.Framework.Scenes
214 public delegate void RequestChangeWaterHeight(float height); 212 public delegate void RequestChangeWaterHeight(float height);
215 213
216 public event RequestChangeWaterHeight OnRequestChangeWaterHeight; 214 public event RequestChangeWaterHeight OnRequestChangeWaterHeight;
217 215
218 public delegate void AvatarKillData(uint KillerLocalID, ScenePresence avatar); 216 /// <summary>
219 217 /// Fired if any avatar is 'killed' due to its health falling to zero
218 /// </summary>
220 public event AvatarKillData OnAvatarKilled; 219 public event AvatarKillData OnAvatarKilled;
220 public delegate void AvatarKillData(uint KillerLocalID, ScenePresence avatar);
221 221
222 public delegate void ScriptTimerEvent(uint localID, double timerinterval); 222// public delegate void ScriptTimerEvent(uint localID, double timerinterval);
223 223
224 public event ScriptTimerEvent OnScriptTimerEvent; 224// public event ScriptTimerEvent OnScriptTimerEvent;
225 225
226 public delegate void EstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour); 226 public delegate void EstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour);
227 public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); 227 public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID);
@@ -312,9 +312,10 @@ namespace OpenSim.Region.Framework.Scenes
312 public event EmptyScriptCompileQueue OnEmptyScriptCompileQueue; 312 public event EmptyScriptCompileQueue OnEmptyScriptCompileQueue;
313 313
314 /// <summary> 314 /// <summary>
315 /// Called whenever an object is attached, or detached 315 /// Called whenever an object is attached, or detached from an in-world presence.
316 /// from an in-world presence.
317 /// </summary> 316 /// </summary>
317 /// If the object is being attached, then the avatarID will be present. If the object is being detached then
318 /// the avatarID is UUID.Zero (I know, this doesn't make much sense but now it's historical).
318 public delegate void Attach(uint localID, UUID itemID, UUID avatarID); 319 public delegate void Attach(uint localID, UUID itemID, UUID avatarID);
319 public event Attach OnAttach; 320 public event Attach OnAttach;
320 321
@@ -387,607 +388,1263 @@ namespace OpenSim.Region.Framework.Scenes
387 public event LandBuy OnLandBuy; 388 public event LandBuy OnLandBuy;
388 public event LandBuy OnValidateLandBuy; 389 public event LandBuy OnValidateLandBuy;
389 390
390 /* Designated Event Deletage Instances */
391
392 private ScriptChangedEvent handlerScriptChangedEvent = null; //OnScriptChangedEvent;
393 private ScriptAtTargetEvent handlerScriptAtTargetEvent = null;
394 private ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = null;
395 private ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = null;
396 private ScriptNotAtRotTargetEvent handlerScriptNotAtRotTargetEvent = null;
397 private ClientMovement handlerClientMovement = null; //OnClientMovement;
398 private OnPermissionErrorDelegate handlerPermissionError = null; //OnPermissionError;
399 private OnPluginConsoleDelegate handlerPluginConsole = null; //OnPluginConsole;
400 private OnFrameDelegate handlerFrame = null; //OnFrame;
401 private OnNewClientDelegate handlerNewClient = null; //OnNewClient;
402 private OnClientConnectCoreDelegate handlerClientConnect = null; //OnClientConnect
403 private OnNewPresenceDelegate handlerNewPresence = null; //OnNewPresence;
404 private OnRemovePresenceDelegate handlerRemovePresence = null; //OnRemovePresence;
405 private OnBackupDelegate handlerBackup = null; //OnBackup;
406 private OnParcelPrimCountUpdateDelegate handlerParcelPrimCountUpdate = null; //OnParcelPrimCountUpdate;
407 private MoneyTransferEvent handlerMoneyTransfer = null; //OnMoneyTransfer;
408 private OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = null; //OnParcelPrimCountAdd;
409 private OnShutdownDelegate handlerShutdown = null; //OnShutdown;
410 private ObjectGrabDelegate handlerObjectGrab = null; //OnObjectGrab;
411 private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab;
412 private ScriptResetDelegate handlerScriptReset = null; // OnScriptReset
413 private NewRezScript handlerRezScript = null; //OnRezScript;
414 private RemoveScript handlerRemoveScript = null; //OnRemoveScript;
415 private StartScript handlerStartScript = null; //OnStartScript;
416 private StopScript handlerStopScript = null; //OnStopScript;
417 private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove;
418 private SceneGroupGrabed handlerSceneGroupGrab = null; //OnSceneGroupGrab;
419 private SceneGroupSpinStarted handlerSceneGroupSpinStarted = null; //OnSceneGroupSpinStart;
420 private SceneGroupSpun handlerSceneGroupSpin = null; //OnSceneGroupSpin;
421 private LandObjectAdded handlerLandObjectAdded = null; //OnLandObjectAdded;
422 private LandObjectRemoved handlerLandObjectRemoved = null; //OnLandObjectRemoved;
423 private AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = null; //OnAvatarEnteringNewParcel;
424 private IncomingInstantMessage handlerIncomingInstantMessage = null; //OnIncomingInstantMessage;
425 private IncomingInstantMessage handlerUnhandledInstantMessage = null; //OnUnhandledInstantMessage;
426 private ClientClosed handlerClientClosed = null; //OnClientClosed;
427 private OnMakeChildAgentDelegate handlerMakeChildAgent = null; //OnMakeChildAgent;
428 private OnMakeRootAgentDelegate handlerMakeRootAgent = null; //OnMakeRootAgent;
429 private OnTerrainTickDelegate handlerTerrainTick = null; // OnTerainTick;
430 private RegisterCapsEvent handlerRegisterCaps = null; // OnRegisterCaps;
431 private DeregisterCapsEvent handlerDeregisterCaps = null; // OnDeregisterCaps;
432 private ChatFromWorldEvent handlerChatFromWorld = null; // OnChatFromWorld;
433 private ChatFromClientEvent handlerChatFromClient = null; // OnChatFromClient;
434 private ChatBroadcastEvent handlerChatBroadcast = null; // OnChatBroadcast;
435 private NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = null;
436 private RequestChangeWaterHeight handlerRequestChangeWaterHeight = null; //OnRequestChangeWaterHeight
437 private ScriptControlEvent handlerScriptControlEvent = null;
438 private SignificantClientMovement handlerSignificantClientMovement = null;
439
440 private LandBuy handlerLandBuy = null;
441 private LandBuy handlerValidateLandBuy = null;
442 private AvatarKillData handlerAvatarKill = null;
443
444 private NoticeNoLandDataFromStorage handlerNoticeNoLandDataFromStorage = null;
445 private IncomingLandDataFromStorage handlerIncomingLandDataFromStorage = null;
446 private SetAllowForcefulBan handlerSetAllowForcefulBan = null;
447 private RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = null;
448 private ParcelPrimCountTainted handlerParcelPrimCountTainted = null;
449 private ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = null;
450 // TODO: unused: private ScriptTimerEvent handlerScriptTimerEvent = null;
451 private EstateToolsSunUpdate handlerEstateToolsSunUpdate = null;
452
453 private ScriptColliding handlerCollidingStart = null;
454 private ScriptColliding handlerColliding = null;
455 private ScriptColliding handlerCollidingEnd = null;
456 private ScriptColliding handlerLandCollidingStart = null;
457 private ScriptColliding handlerLandColliding = null;
458 private ScriptColliding handlerLandCollidingEnd = null;
459 private GetScriptRunning handlerGetScriptRunning = null;
460
461 private SunLindenHour handlerCurrentTimeAsLindenSunHour = null;
462 private OnSetRootAgentSceneDelegate handlerSetRootAgentScene = null;
463
464 private OarFileLoaded handlerOarFileLoaded = null;
465 private OarFileSaved handlerOarFileSaved = null;
466
467 private EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = null;
468
469 private Attach handlerOnAttach = null;
470 private RegionUp handlerOnRegionUp = null;
471
472 public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID) 391 public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID)
473 { 392 {
474 handlerOnAttach = OnAttach; 393 Attach handlerOnAttach = OnAttach;
475 if (handlerOnAttach != null) 394 if (handlerOnAttach != null)
476 handlerOnAttach(localID, itemID, avatarID); 395 {
396 foreach (Attach d in handlerOnAttach.GetInvocationList())
397 {
398 try
399 {
400 d(localID, itemID, avatarID);
401 }
402 catch (Exception e)
403 {
404 m_log.ErrorFormat(
405 "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
406 e.Message, e.StackTrace);
407 }
408 }
409 }
477 } 410 }
478 411
479 public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) 412 public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
480 { 413 {
481 handlerGetScriptRunning = OnGetScriptRunning; 414 GetScriptRunning handlerGetScriptRunning = OnGetScriptRunning;
482 if (handlerGetScriptRunning != null) 415 if (handlerGetScriptRunning != null)
483 handlerGetScriptRunning(controllingClient, objectID, itemID); 416 {
417 foreach (GetScriptRunning d in handlerGetScriptRunning.GetInvocationList())
418 {
419 try
420 {
421 d(controllingClient, objectID, itemID);
422 }
423 catch (Exception e)
424 {
425 m_log.ErrorFormat(
426 "[EVENT MANAGER]: Delegate for TriggerGetScriptRunning failed - continuing. {0} {1}",
427 e.Message, e.StackTrace);
428 }
429 }
430 }
484 } 431 }
485 432
486 public void TriggerOnScriptChangedEvent(uint localID, uint change) 433 public void TriggerOnScriptChangedEvent(uint localID, uint change)
487 { 434 {
488 handlerScriptChangedEvent = OnScriptChangedEvent; 435 ScriptChangedEvent handlerScriptChangedEvent = OnScriptChangedEvent;
489 if (handlerScriptChangedEvent != null) 436 if (handlerScriptChangedEvent != null)
490 handlerScriptChangedEvent(localID, change); 437 {
438 foreach (ScriptChangedEvent d in handlerScriptChangedEvent.GetInvocationList())
439 {
440 try
441 {
442 d(localID, change);
443 }
444 catch (Exception e)
445 {
446 m_log.ErrorFormat(
447 "[EVENT MANAGER]: Delegate for TriggerOnScriptChangedEvent failed - continuing. {0} {1}",
448 e.Message, e.StackTrace);
449 }
450 }
451 }
491 } 452 }
492 453
493 public void TriggerOnClientMovement(ScenePresence avatar) 454 public void TriggerOnClientMovement(ScenePresence avatar)
494 { 455 {
495 handlerClientMovement = OnClientMovement; 456 ClientMovement handlerClientMovement = OnClientMovement;
496 if (handlerClientMovement != null) 457 if (handlerClientMovement != null)
497 handlerClientMovement(avatar); 458 {
459 foreach (ClientMovement d in handlerClientMovement.GetInvocationList())
460 {
461 try
462 {
463 d(avatar);
464 }
465 catch (Exception e)
466 {
467 m_log.ErrorFormat(
468 "[EVENT MANAGER]: Delegate for TriggerOnClientMovement failed - continuing. {0} {1}",
469 e.Message, e.StackTrace);
470 }
471 }
472 }
498 } 473 }
499 474
500 public void TriggerPermissionError(UUID user, string reason) 475 public void TriggerPermissionError(UUID user, string reason)
501 { 476 {
502 handlerPermissionError = OnPermissionError; 477 OnPermissionErrorDelegate handlerPermissionError = OnPermissionError;
503 if (handlerPermissionError != null) 478 if (handlerPermissionError != null)
504 handlerPermissionError(user, reason); 479 {
480 foreach (OnPermissionErrorDelegate d in handlerPermissionError.GetInvocationList())
481 {
482 try
483 {
484 d(user, reason);
485 }
486 catch (Exception e)
487 {
488 m_log.ErrorFormat(
489 "[EVENT MANAGER]: Delegate for TriggerPermissionError failed - continuing. {0} {1}",
490 e.Message, e.StackTrace);
491 }
492 }
493 }
505 } 494 }
506 495
507 public void TriggerOnPluginConsole(string[] args) 496 public void TriggerOnPluginConsole(string[] args)
508 { 497 {
509 handlerPluginConsole = OnPluginConsole; 498 OnPluginConsoleDelegate handlerPluginConsole = OnPluginConsole;
510 if (handlerPluginConsole != null) 499 if (handlerPluginConsole != null)
511 handlerPluginConsole(args); 500 {
501 foreach (OnPluginConsoleDelegate d in handlerPluginConsole.GetInvocationList())
502 {
503 try
504 {
505 d(args);
506 }
507 catch (Exception e)
508 {
509 m_log.ErrorFormat(
510 "[EVENT MANAGER]: Delegate for TriggerOnPluginConsole failed - continuing. {0} {1}",
511 e.Message, e.StackTrace);
512 }
513 }
514 }
512 } 515 }
513 516
514 public void TriggerOnFrame() 517 public void TriggerOnFrame()
515 { 518 {
516 handlerFrame = OnFrame; 519 OnFrameDelegate handlerFrame = OnFrame;
517 if (handlerFrame != null) 520 if (handlerFrame != null)
518 { 521 {
519 handlerFrame(); 522 foreach (OnFrameDelegate d in handlerFrame.GetInvocationList())
520 } 523 {
524 try
525 {
526 d();
527 }
528 catch (Exception e)
529 {
530 m_log.ErrorFormat(
531 "[EVENT MANAGER]: Delegate for TriggerOnFrame failed - continuing. {0} {1}",
532 e.Message, e.StackTrace);
533 }
534 }
535 }
521 } 536 }
522 537
523 public void TriggerOnNewClient(IClientAPI client) 538 public void TriggerOnNewClient(IClientAPI client)
524 { 539 {
525 handlerNewClient = OnNewClient; 540 OnNewClientDelegate handlerNewClient = OnNewClient;
526 if (handlerNewClient != null) 541 if (handlerNewClient != null)
527 handlerNewClient(client); 542 {
543 foreach (OnNewClientDelegate d in handlerNewClient.GetInvocationList())
544 {
545 try
546 {
547 d(client);
548 }
549 catch (Exception e)
550 {
551 m_log.ErrorFormat(
552 "[EVENT MANAGER]: Delegate for TriggerOnNewClient failed - continuing. {0} {1}",
553 e.Message, e.StackTrace);
554 }
555 }
556 }
528 557
529 if (client is IClientCore) 558 if (client is IClientCore)
530 { 559 {
531 handlerClientConnect = OnClientConnect; 560 OnClientConnectCoreDelegate handlerClientConnect = OnClientConnect;
532 if (handlerClientConnect != null) 561 if (handlerClientConnect != null)
533 handlerClientConnect((IClientCore)client); 562 {
563 foreach (OnClientConnectCoreDelegate d in handlerClientConnect.GetInvocationList())
564 {
565 try
566 {
567 d((IClientCore)client);
568 }
569 catch (Exception e)
570 {
571 m_log.ErrorFormat(
572 "[EVENT MANAGER]: Delegate for TriggerOnNewClient (IClientCore) failed - continuing. {0} {1}",
573 e.Message, e.StackTrace);
574 }
575 }
576 }
534 } 577 }
535 } 578 }
536 579
537 public void TriggerOnNewPresence(ScenePresence presence) 580 public void TriggerOnNewPresence(ScenePresence presence)
538 { 581 {
539 handlerNewPresence = OnNewPresence; 582 OnNewPresenceDelegate handlerNewPresence = OnNewPresence;
540 if (handlerNewPresence != null) 583 if (handlerNewPresence != null)
541 handlerNewPresence(presence); 584 {
585 foreach (OnNewPresenceDelegate d in handlerNewPresence.GetInvocationList())
586 {
587 try
588 {
589 d(presence);
590 }
591 catch (Exception e)
592 {
593 m_log.ErrorFormat(
594 "[EVENT MANAGER]: Delegate for TriggerOnNewPresence failed - continuing. {0} {1}",
595 e.Message, e.StackTrace);
596 }
597 }
598 }
542 } 599 }
543 600
544 public void TriggerOnRemovePresence(UUID agentId) 601 public void TriggerOnRemovePresence(UUID agentId)
545 { 602 {
546 handlerRemovePresence = OnRemovePresence; 603 OnRemovePresenceDelegate handlerRemovePresence = OnRemovePresence;
547 if (handlerRemovePresence != null) 604 if (handlerRemovePresence != null)
548 { 605 {
549 handlerRemovePresence(agentId); 606 foreach (OnRemovePresenceDelegate d in handlerRemovePresence.GetInvocationList())
550 } 607 {
608 try
609 {
610 d(agentId);
611 }
612 catch (Exception e)
613 {
614 m_log.ErrorFormat(
615 "[EVENT MANAGER]: Delegate for TriggerOnRemovePresence failed - continuing. {0} {1}",
616 e.Message, e.StackTrace);
617 }
618 }
619 }
551 } 620 }
552 621
553 public void TriggerOnBackup(IRegionDataStore dstore) 622 public void TriggerOnBackup(IRegionDataStore dstore)
554 { 623 {
555 handlerBackup = OnBackup; 624 OnBackupDelegate handlerOnAttach = OnBackup;
556 if (handlerBackup != null) 625 if (handlerOnAttach != null)
557 { 626 {
558 handlerBackup(dstore, false); 627 foreach (OnBackupDelegate d in handlerOnAttach.GetInvocationList())
559 } 628 {
629 try
630 {
631 d(dstore, false);
632 }
633 catch (Exception e)
634 {
635 m_log.ErrorFormat(
636 "[EVENT MANAGER]: Delegate for TriggerOnBackup failed - continuing. {0} {1}",
637 e.Message, e.StackTrace);
638 }
639 }
640 }
560 } 641 }
561 642
562 public void TriggerParcelPrimCountUpdate() 643 public void TriggerParcelPrimCountUpdate()
563 { 644 {
564 handlerParcelPrimCountUpdate = OnParcelPrimCountUpdate; 645 OnParcelPrimCountUpdateDelegate handlerParcelPrimCountUpdate = OnParcelPrimCountUpdate;
565 if (handlerParcelPrimCountUpdate != null) 646 if (handlerParcelPrimCountUpdate != null)
566 { 647 {
567 handlerParcelPrimCountUpdate(); 648 foreach (OnParcelPrimCountUpdateDelegate d in handlerParcelPrimCountUpdate.GetInvocationList())
568 } 649 {
569 } 650 try
570 651 {
571 public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs e) 652 d();
572 { 653 }
573 handlerMoneyTransfer = OnMoneyTransfer; 654 catch (Exception e)
655 {
656 m_log.ErrorFormat(
657 "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountUpdate failed - continuing. {0} {1}",
658 e.Message, e.StackTrace);
659 }
660 }
661 }
662 }
663
664 public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs args)
665 {
666 MoneyTransferEvent handlerMoneyTransfer = OnMoneyTransfer;
574 if (handlerMoneyTransfer != null) 667 if (handlerMoneyTransfer != null)
575 { 668 {
576 handlerMoneyTransfer(sender, e); 669 foreach (MoneyTransferEvent d in handlerMoneyTransfer.GetInvocationList())
577 } 670 {
671 try
672 {
673 d(sender, args);
674 }
675 catch (Exception e)
676 {
677 m_log.ErrorFormat(
678 "[EVENT MANAGER]: Delegate for TriggerMoneyTransfer failed - continuing. {0} {1}",
679 e.Message, e.StackTrace);
680 }
681 }
682 }
578 } 683 }
579 684
580 public void TriggerTerrainTick() 685 public void TriggerTerrainTick()
581 { 686 {
582 handlerTerrainTick = OnTerrainTick; 687 OnTerrainTickDelegate handlerTerrainTick = OnTerrainTick;
583 if (handlerTerrainTick != null) 688 if (handlerTerrainTick != null)
584 { 689 {
585 handlerTerrainTick(); 690 foreach (OnTerrainTickDelegate d in handlerTerrainTick.GetInvocationList())
586 } 691 {
692 try
693 {
694 d();
695 }
696 catch (Exception e)
697 {
698 m_log.ErrorFormat(
699 "[EVENT MANAGER]: Delegate for TriggerTerrainTick failed - continuing. {0} {1}",
700 e.Message, e.StackTrace);
701 }
702 }
703 }
587 } 704 }
588 705
589 public void TriggerParcelPrimCountAdd(SceneObjectGroup obj) 706 public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
590 { 707 {
591 handlerParcelPrimCountAdd = OnParcelPrimCountAdd; 708 OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = OnParcelPrimCountAdd;
592 if (handlerParcelPrimCountAdd != null) 709 if (handlerParcelPrimCountAdd != null)
593 { 710 {
594 handlerParcelPrimCountAdd(obj); 711 foreach (OnParcelPrimCountAddDelegate d in handlerParcelPrimCountAdd.GetInvocationList())
595 } 712 {
713 try
714 {
715 d(obj);
716 }
717 catch (Exception e)
718 {
719 m_log.ErrorFormat(
720 "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountAdd failed - continuing. {0} {1}",
721 e.Message, e.StackTrace);
722 }
723 }
724 }
596 } 725 }
597 726
598 public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj) 727 public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj)
599 { 728 {
600 handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene; 729 ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene;
601 if (handlerObjectBeingRemovedFromScene != null) 730 if (handlerObjectBeingRemovedFromScene != null)
602 { 731 {
603 handlerObjectBeingRemovedFromScene(obj); 732 foreach (ObjectBeingRemovedFromScene d in handlerObjectBeingRemovedFromScene.GetInvocationList())
604 } 733 {
734 try
735 {
736 d(obj);
737 }
738 catch (Exception e)
739 {
740 m_log.ErrorFormat(
741 "[EVENT MANAGER]: Delegate for TriggerObjectBeingRemovedFromScene failed - continuing. {0} {1}",
742 e.Message, e.StackTrace);
743 }
744 }
745 }
605 } 746 }
606 747
607 public void TriggerShutdown() 748 public void TriggerShutdown()
608 { 749 {
609 handlerShutdown = OnShutdown; 750 OnShutdownDelegate handlerShutdown = OnShutdown;
610 if (handlerShutdown != null) 751 if (handlerShutdown != null)
611 handlerShutdown(); 752 {
753 foreach (OnShutdownDelegate d in handlerShutdown.GetInvocationList())
754 {
755 try
756 {
757 d();
758 }
759 catch (Exception e)
760 {
761 m_log.ErrorFormat(
762 "[EVENT MANAGER]: Delegate for TriggerShutdown failed - continuing. {0} {1}",
763 e.Message, e.StackTrace);
764 }
765 }
766 }
612 } 767 }
613 768
614 public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) 769 public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
615 { 770 {
616 handlerObjectGrab = OnObjectGrab; 771 ObjectGrabDelegate handlerObjectGrab = OnObjectGrab;
617 if (handlerObjectGrab != null) 772 if (handlerObjectGrab != null)
618 { 773 {
619 handlerObjectGrab(localID, originalID, offsetPos, remoteClient, surfaceArgs); 774 foreach (ObjectGrabDelegate d in handlerObjectGrab.GetInvocationList())
620 } 775 {
621 } 776 try
777 {
778 d(localID, originalID, offsetPos, remoteClient, surfaceArgs);
779 }
780 catch (Exception e)
781 {
782 m_log.ErrorFormat(
783 "[EVENT MANAGER]: Delegate for TriggerObjectGrab failed - continuing. {0} {1}",
784 e.Message, e.StackTrace);
785 }
786 }
787 }
788 }
789
790 public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
791 {
792 ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing;
793 if (handlerObjectGrabbing != null)
794 {
795 foreach (ObjectGrabDelegate d in handlerObjectGrabbing.GetInvocationList())
796 {
797 try
798 {
799 d(localID, originalID, offsetPos, remoteClient, surfaceArgs);
800 }
801 catch (Exception e)
802 {
803 m_log.ErrorFormat(
804 "[EVENT MANAGER]: Delegate for TriggerObjectGrabbing failed - continuing. {0} {1}",
805 e.Message, e.StackTrace);
806 }
807 }
808 }
809 }
622 810
623 public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) 811 public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
624 { 812 {
625 handlerObjectDeGrab = OnObjectDeGrab; 813 ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab;
626 if (handlerObjectDeGrab != null) 814 if (handlerObjectDeGrab != null)
627 { 815 {
628 handlerObjectDeGrab(localID, originalID, remoteClient, surfaceArgs); 816 foreach (ObjectDeGrabDelegate d in handlerObjectDeGrab.GetInvocationList())
629 } 817 {
818 try
819 {
820 d(localID, originalID, remoteClient, surfaceArgs);
821 }
822 catch (Exception e)
823 {
824 m_log.ErrorFormat(
825 "[EVENT MANAGER]: Delegate for TriggerObjectDeGrab failed - continuing. {0} {1}",
826 e.Message, e.StackTrace);
827 }
828 }
829 }
630 } 830 }
631 831
632 public void TriggerScriptReset(uint localID, UUID itemID) 832 public void TriggerScriptReset(uint localID, UUID itemID)
633 { 833 {
634 handlerScriptReset = OnScriptReset; 834 ScriptResetDelegate handlerScriptReset = OnScriptReset;
635 if (handlerScriptReset != null) 835 if (handlerScriptReset != null)
636 { 836 {
637 handlerScriptReset(localID, itemID); 837 foreach (ScriptResetDelegate d in handlerScriptReset.GetInvocationList())
638 } 838 {
839 try
840 {
841 d(localID, itemID);
842 }
843 catch (Exception e)
844 {
845 m_log.ErrorFormat(
846 "[EVENT MANAGER]: Delegate for TriggerScriptReset failed - continuing. {0} {1}",
847 e.Message, e.StackTrace);
848 }
849 }
850 }
639 } 851 }
640 852
641 public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource) 853 public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource)
642 { 854 {
643 handlerRezScript = OnRezScript; 855 NewRezScript handlerRezScript = OnRezScript;
644 if (handlerRezScript != null) 856 if (handlerRezScript != null)
645 { 857 {
646 handlerRezScript(localID, itemID, script, startParam, 858 foreach (NewRezScript d in handlerRezScript.GetInvocationList())
647 postOnRez, engine, stateSource); 859 {
648 } 860 try
861 {
862 d(localID, itemID, script, startParam, postOnRez, engine, stateSource);
863 }
864 catch (Exception e)
865 {
866 m_log.ErrorFormat(
867 "[EVENT MANAGER]: Delegate for TriggerRezScript failed - continuing. {0} {1}",
868 e.Message, e.StackTrace);
869 }
870 }
871 }
649 } 872 }
650 873
651 public void TriggerStartScript(uint localID, UUID itemID) 874 public void TriggerStartScript(uint localID, UUID itemID)
652 { 875 {
653 handlerStartScript = OnStartScript; 876 StartScript handlerStartScript = OnStartScript;
654 if (handlerStartScript != null) 877 if (handlerStartScript != null)
655 { 878 {
656 handlerStartScript(localID, itemID); 879 foreach (StartScript d in handlerStartScript.GetInvocationList())
657 } 880 {
881 try
882 {
883 d(localID, itemID);
884 }
885 catch (Exception e)
886 {
887 m_log.ErrorFormat(
888 "[EVENT MANAGER]: Delegate for TriggerStartScript failed - continuing. {0} {1}",
889 e.Message, e.StackTrace);
890 }
891 }
892 }
658 } 893 }
659 894
660 public void TriggerStopScript(uint localID, UUID itemID) 895 public void TriggerStopScript(uint localID, UUID itemID)
661 { 896 {
662 handlerStopScript = OnStopScript; 897 StopScript handlerStopScript = OnStopScript;
663 if (handlerStopScript != null) 898 if (handlerStopScript != null)
664 { 899 {
665 handlerStopScript(localID, itemID); 900 foreach (StopScript d in handlerStopScript.GetInvocationList())
666 } 901 {
902 try
903 {
904 d(localID, itemID);
905 }
906 catch (Exception e)
907 {
908 m_log.ErrorFormat(
909 "[EVENT MANAGER]: Delegate for TriggerStopScript failed - continuing. {0} {1}",
910 e.Message, e.StackTrace);
911 }
912 }
913 }
667 } 914 }
668 915
669 public void TriggerRemoveScript(uint localID, UUID itemID) 916 public void TriggerRemoveScript(uint localID, UUID itemID)
670 { 917 {
671 handlerRemoveScript = OnRemoveScript; 918 RemoveScript handlerRemoveScript = OnRemoveScript;
672 if (handlerRemoveScript != null) 919 if (handlerRemoveScript != null)
673 { 920 {
674 handlerRemoveScript(localID, itemID); 921 foreach (RemoveScript d in handlerRemoveScript.GetInvocationList())
675 } 922 {
923 try
924 {
925 d(localID, itemID);
926 }
927 catch (Exception e)
928 {
929 m_log.ErrorFormat(
930 "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}",
931 e.Message, e.StackTrace);
932 }
933 }
934 }
676 } 935 }
677 936
678 public bool TriggerGroupMove(UUID groupID, Vector3 delta) 937 public bool TriggerGroupMove(UUID groupID, Vector3 delta)
679 { 938 {
680 handlerSceneGroupMove = OnSceneGroupMove; 939 bool result = true;
681 940
941 SceneGroupMoved handlerSceneGroupMove = OnSceneGroupMove;
682 if (handlerSceneGroupMove != null) 942 if (handlerSceneGroupMove != null)
683 { 943 {
684 return handlerSceneGroupMove(groupID, delta); 944 foreach (SceneGroupMoved d in handlerSceneGroupMove.GetInvocationList())
945 {
946 try
947 {
948 if (d(groupID, delta) == false)
949 result = false;
950 }
951 catch (Exception e)
952 {
953 m_log.ErrorFormat(
954 "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
955 e.Message, e.StackTrace);
956 }
957 }
685 } 958 }
686 return true; 959
960 return result;
687 } 961 }
688 962
689 public bool TriggerGroupSpinStart(UUID groupID) 963 public bool TriggerGroupSpinStart(UUID groupID)
690 { 964 {
691 handlerSceneGroupSpinStarted = OnSceneGroupSpinStart; 965 bool result = true;
692 966
967 SceneGroupSpinStarted handlerSceneGroupSpinStarted = OnSceneGroupSpinStart;
693 if (handlerSceneGroupSpinStarted != null) 968 if (handlerSceneGroupSpinStarted != null)
694 { 969 {
695 return handlerSceneGroupSpinStarted(groupID); 970 foreach (SceneGroupSpinStarted d in handlerSceneGroupSpinStarted.GetInvocationList())
971 {
972 try
973 {
974 if (d(groupID) == false)
975 result = false;
976 }
977 catch (Exception e)
978 {
979 m_log.ErrorFormat(
980 "[EVENT MANAGER]: Delegate for TriggerGroupSpinStart failed - continuing. {0} {1}",
981 e.Message, e.StackTrace);
982 }
983 }
696 } 984 }
697 return true; 985
986 return result;
698 } 987 }
699 988
700 public bool TriggerGroupSpin(UUID groupID, Quaternion rotation) 989 public bool TriggerGroupSpin(UUID groupID, Quaternion rotation)
701 { 990 {
702 handlerSceneGroupSpin = OnSceneGroupSpin; 991 bool result = true;
703 992
993 SceneGroupSpun handlerSceneGroupSpin = OnSceneGroupSpin;
704 if (handlerSceneGroupSpin != null) 994 if (handlerSceneGroupSpin != null)
705 { 995 {
706 return handlerSceneGroupSpin(groupID, rotation); 996 foreach (SceneGroupSpun d in handlerSceneGroupSpin.GetInvocationList())
997 {
998 try
999 {
1000 if (d(groupID, rotation) == false)
1001 result = false;
1002 }
1003 catch (Exception e)
1004 {
1005 m_log.ErrorFormat(
1006 "[EVENT MANAGER]: Delegate for TriggerGroupSpin failed - continuing. {0} {1}",
1007 e.Message, e.StackTrace);
1008 }
1009 }
707 } 1010 }
708 return true; 1011
1012 return result;
709 } 1013 }
710 1014
711 public void TriggerGroupGrab(UUID groupID, Vector3 offset, UUID userID) 1015 public void TriggerGroupGrab(UUID groupID, Vector3 offset, UUID userID)
712 { 1016 {
713 handlerSceneGroupGrab = OnSceneGroupGrab; 1017 SceneGroupGrabed handlerSceneGroupGrab = OnSceneGroupGrab;
714 if (handlerSceneGroupGrab != null) 1018 if (handlerSceneGroupGrab != null)
715 { 1019 {
716 handlerSceneGroupGrab(groupID, offset, userID); 1020 foreach (SceneGroupGrabed d in handlerSceneGroupGrab.GetInvocationList())
717 } 1021 {
1022 try
1023 {
1024 d(groupID, offset, userID);
1025 }
1026 catch (Exception e)
1027 {
1028 m_log.ErrorFormat(
1029 "[EVENT MANAGER]: Delegate for TriggerGroupGrab failed - continuing. {0} {1}",
1030 e.Message, e.StackTrace);
1031 }
1032 }
1033 }
718 } 1034 }
719 1035
720 public void TriggerLandObjectAdded(ILandObject newParcel) 1036 public void TriggerLandObjectAdded(ILandObject newParcel)
721 { 1037 {
722 handlerLandObjectAdded = OnLandObjectAdded; 1038 LandObjectAdded handlerLandObjectAdded = OnLandObjectAdded;
723
724 if (handlerLandObjectAdded != null) 1039 if (handlerLandObjectAdded != null)
725 { 1040 {
726 handlerLandObjectAdded(newParcel); 1041 foreach (LandObjectAdded d in handlerLandObjectAdded.GetInvocationList())
727 } 1042 {
1043 try
1044 {
1045 d(newParcel);
1046 }
1047 catch (Exception e)
1048 {
1049 m_log.ErrorFormat(
1050 "[EVENT MANAGER]: Delegate for TriggerLandObjectAdded failed - continuing. {0} {1}",
1051 e.Message, e.StackTrace);
1052 }
1053 }
1054 }
728 } 1055 }
729 1056
730 public void TriggerLandObjectRemoved(UUID globalID) 1057 public void TriggerLandObjectRemoved(UUID globalID)
731 { 1058 {
732 handlerLandObjectRemoved = OnLandObjectRemoved; 1059 LandObjectRemoved handlerLandObjectRemoved = OnLandObjectRemoved;
733 if (handlerLandObjectRemoved != null) 1060 if (handlerLandObjectRemoved != null)
734 { 1061 {
735 handlerLandObjectRemoved(globalID); 1062 foreach (LandObjectRemoved d in handlerLandObjectRemoved.GetInvocationList())
736 } 1063 {
1064 try
1065 {
1066 d(globalID);
1067 }
1068 catch (Exception e)
1069 {
1070 m_log.ErrorFormat(
1071 "[EVENT MANAGER]: Delegate for TriggerLandObjectRemoved failed - continuing. {0} {1}",
1072 e.Message, e.StackTrace);
1073 }
1074 }
1075 }
737 } 1076 }
738 1077
739 public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel) 1078 public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel)
740 { 1079 {
741 //triggerLandObjectRemoved(localParcelID);
742
743 TriggerLandObjectAdded(newParcel); 1080 TriggerLandObjectAdded(newParcel);
744 } 1081 }
745 1082
746 public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID) 1083 public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID)
747 { 1084 {
748 handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel; 1085 AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel;
749
750 if (handlerAvatarEnteringNewParcel != null) 1086 if (handlerAvatarEnteringNewParcel != null)
751 { 1087 {
752 handlerAvatarEnteringNewParcel(avatar, localLandID, regionID); 1088 foreach (AvatarEnteringNewParcel d in handlerAvatarEnteringNewParcel.GetInvocationList())
753 } 1089 {
1090 try
1091 {
1092 d(avatar, localLandID, regionID);
1093 }
1094 catch (Exception e)
1095 {
1096 m_log.ErrorFormat(
1097 "[EVENT MANAGER]: Delegate for TriggerAvatarEnteringNewParcel failed - continuing. {0} {1}",
1098 e.Message, e.StackTrace);
1099 }
1100 }
1101 }
754 } 1102 }
755 1103
756 public void TriggerIncomingInstantMessage(GridInstantMessage message) 1104 public void TriggerIncomingInstantMessage(GridInstantMessage message)
757 { 1105 {
758 handlerIncomingInstantMessage = OnIncomingInstantMessage; 1106 IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage;
759 if (handlerIncomingInstantMessage != null) 1107 if (handlerIncomingInstantMessage != null)
760 { 1108 {
761 handlerIncomingInstantMessage(message); 1109 foreach (IncomingInstantMessage d in handlerIncomingInstantMessage.GetInvocationList())
762 } 1110 {
1111 try
1112 {
1113 d(message);
1114 }
1115 catch (Exception e)
1116 {
1117 m_log.ErrorFormat(
1118 "[EVENT MANAGER]: Delegate for TriggerIncomingInstantMessage failed - continuing. {0} {1}",
1119 e.Message, e.StackTrace);
1120 }
1121 }
1122 }
763 } 1123 }
764 1124
765 public void TriggerUnhandledInstantMessage(GridInstantMessage message) 1125 public void TriggerUnhandledInstantMessage(GridInstantMessage message)
766 { 1126 {
767 handlerUnhandledInstantMessage = OnUnhandledInstantMessage; 1127 IncomingInstantMessage handlerUnhandledInstantMessage = OnUnhandledInstantMessage;
768 if (handlerUnhandledInstantMessage != null) 1128 if (handlerUnhandledInstantMessage != null)
769 { 1129 {
770 handlerUnhandledInstantMessage(message); 1130 foreach (IncomingInstantMessage d in handlerUnhandledInstantMessage.GetInvocationList())
771 } 1131 {
1132 try
1133 {
1134 d(message);
1135 }
1136 catch (Exception e)
1137 {
1138 m_log.ErrorFormat(
1139 "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
1140 e.Message, e.StackTrace);
1141 }
1142 }
1143 }
772 } 1144 }
773 1145
774 public void TriggerClientClosed(UUID ClientID, Scene scene) 1146 public void TriggerClientClosed(UUID ClientID, Scene scene)
775 { 1147 {
776 handlerClientClosed = OnClientClosed; 1148 ClientClosed handlerClientClosed = OnClientClosed;
777 if (handlerClientClosed != null) 1149 if (handlerClientClosed != null)
778 { 1150 {
779 handlerClientClosed(ClientID, scene); 1151 foreach (ClientClosed d in handlerClientClosed.GetInvocationList())
780 } 1152 {
1153 try
1154 {
1155 d(ClientID, scene);
1156 }
1157 catch (Exception e)
1158 {
1159 m_log.ErrorFormat(
1160 "[EVENT MANAGER]: Delegate for TriggerClientClosed failed - continuing. {0} {1}",
1161 e.Message, e.StackTrace);
1162 }
1163 }
1164 }
781 } 1165 }
782 1166
783 public void TriggerOnMakeChildAgent(ScenePresence presence) 1167 public void TriggerOnMakeChildAgent(ScenePresence presence)
784 { 1168 {
785 handlerMakeChildAgent = OnMakeChildAgent; 1169 OnMakeChildAgentDelegate handlerMakeChildAgent = OnMakeChildAgent;
786 if (handlerMakeChildAgent != null) 1170 if (handlerMakeChildAgent != null)
787 { 1171 {
788 handlerMakeChildAgent(presence); 1172 foreach (OnMakeChildAgentDelegate d in handlerMakeChildAgent.GetInvocationList())
789 } 1173 {
1174 try
1175 {
1176 d(presence);
1177 }
1178 catch (Exception e)
1179 {
1180 m_log.ErrorFormat(
1181 "[EVENT MANAGER]: Delegate for TriggerOnMakeChildAgent failed - continuing. {0} {1}",
1182 e.Message, e.StackTrace);
1183 }
1184 }
1185 }
790 } 1186 }
791 1187
792 public void TriggerOnMakeRootAgent(ScenePresence presence) 1188 public void TriggerOnMakeRootAgent(ScenePresence presence)
793 { 1189 {
794 handlerMakeRootAgent = OnMakeRootAgent; 1190 OnMakeRootAgentDelegate handlerMakeRootAgent = OnMakeRootAgent;
795 if (handlerMakeRootAgent != null) 1191 if (handlerMakeRootAgent != null)
796 { 1192 {
797 handlerMakeRootAgent(presence); 1193 foreach (OnMakeRootAgentDelegate d in handlerMakeRootAgent.GetInvocationList())
798 } 1194 {
1195 try
1196 {
1197 d(presence);
1198 }
1199 catch (Exception e)
1200 {
1201 m_log.ErrorFormat(
1202 "[EVENT MANAGER]: Delegate for TriggerOnMakeRootAgent failed - continuing. {0} {1}",
1203 e.Message, e.StackTrace);
1204 }
1205 }
1206 }
799 } 1207 }
800 1208
801 public void TriggerOnRegisterCaps(UUID agentID, Caps caps) 1209 public void TriggerOnRegisterCaps(UUID agentID, Caps caps)
802 { 1210 {
803 handlerRegisterCaps = OnRegisterCaps; 1211 RegisterCapsEvent handlerRegisterCaps = OnRegisterCaps;
804 if (handlerRegisterCaps != null) 1212 if (handlerRegisterCaps != null)
805 { 1213 {
806 handlerRegisterCaps(agentID, caps); 1214 foreach (RegisterCapsEvent d in handlerRegisterCaps.GetInvocationList())
807 } 1215 {
1216 try
1217 {
1218 d(agentID, caps);
1219 }
1220 catch (Exception e)
1221 {
1222 m_log.ErrorFormat(
1223 "[EVENT MANAGER]: Delegate for TriggerOnRegisterCaps failed - continuing. {0} {1}",
1224 e.Message, e.StackTrace);
1225 }
1226 }
1227 }
808 } 1228 }
809 1229
810 public void TriggerOnDeregisterCaps(UUID agentID, Caps caps) 1230 public void TriggerOnDeregisterCaps(UUID agentID, Caps caps)
811 { 1231 {
812 handlerDeregisterCaps = OnDeregisterCaps; 1232 DeregisterCapsEvent handlerDeregisterCaps = OnDeregisterCaps;
813 if (handlerDeregisterCaps != null) 1233 if (handlerDeregisterCaps != null)
814 { 1234 {
815 handlerDeregisterCaps(agentID, caps); 1235 foreach (DeregisterCapsEvent d in handlerDeregisterCaps.GetInvocationList())
816 } 1236 {
1237 try
1238 {
1239 d(agentID, caps);
1240 }
1241 catch (Exception e)
1242 {
1243 m_log.ErrorFormat(
1244 "[EVENT MANAGER]: Delegate for TriggerOnDeregisterCaps failed - continuing. {0} {1}",
1245 e.Message, e.StackTrace);
1246 }
1247 }
1248 }
817 } 1249 }
818 1250
819 public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel) 1251 public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel)
820 { 1252 {
821 handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete; 1253 NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete;
822 if (handlerNewInventoryItemUpdateComplete != null) 1254 if (handlerNewInventoryItemUpdateComplete != null)
823 { 1255 {
824 handlerNewInventoryItemUpdateComplete(agentID, AssetID, AssetName, userlevel); 1256 foreach (NewInventoryItemUploadComplete d in handlerNewInventoryItemUpdateComplete.GetInvocationList())
825 } 1257 {
826 } 1258 try
827 1259 {
828 public void TriggerLandBuy(Object sender, LandBuyArgs e) 1260 d(agentID, AssetID, AssetName, userlevel);
829 { 1261 }
830 handlerLandBuy = OnLandBuy; 1262 catch (Exception e)
1263 {
1264 m_log.ErrorFormat(
1265 "[EVENT MANAGER]: Delegate for TriggerOnNewInventoryItemUploadComplete failed - continuing. {0} {1}",
1266 e.Message, e.StackTrace);
1267 }
1268 }
1269 }
1270 }
1271
1272 public void TriggerLandBuy(Object sender, LandBuyArgs args)
1273 {
1274 LandBuy handlerLandBuy = OnLandBuy;
831 if (handlerLandBuy != null) 1275 if (handlerLandBuy != null)
832 { 1276 {
833 handlerLandBuy(sender, e); 1277 foreach (LandBuy d in handlerLandBuy.GetInvocationList())
834 } 1278 {
835 } 1279 try
836 1280 {
837 public void TriggerValidateLandBuy(Object sender, LandBuyArgs e) 1281 d(sender, args);
838 { 1282 }
839 handlerValidateLandBuy = OnValidateLandBuy; 1283 catch (Exception e)
1284 {
1285 m_log.ErrorFormat(
1286 "[EVENT MANAGER]: Delegate for TriggerLandBuy failed - continuing. {0} {1}",
1287 e.Message, e.StackTrace);
1288 }
1289 }
1290 }
1291 }
1292
1293 public void TriggerValidateLandBuy(Object sender, LandBuyArgs args)
1294 {
1295 LandBuy handlerValidateLandBuy = OnValidateLandBuy;
840 if (handlerValidateLandBuy != null) 1296 if (handlerValidateLandBuy != null)
841 { 1297 {
842 handlerValidateLandBuy(sender, e); 1298 foreach (LandBuy d in handlerValidateLandBuy.GetInvocationList())
843 } 1299 {
1300 try
1301 {
1302 d(sender, args);
1303 }
1304 catch (Exception e)
1305 {
1306 m_log.ErrorFormat(
1307 "[EVENT MANAGER]: Delegate for TriggerValidateLandBuy failed - continuing. {0} {1}",
1308 e.Message, e.StackTrace);
1309 }
1310 }
1311 }
844 } 1312 }
845 1313
846 public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos) 1314 public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos)
847 { 1315 {
848 handlerScriptAtTargetEvent = OnScriptAtTargetEvent; 1316 ScriptAtTargetEvent handlerScriptAtTargetEvent = OnScriptAtTargetEvent;
849 if (handlerScriptAtTargetEvent != null) 1317 if (handlerScriptAtTargetEvent != null)
850 { 1318 {
851 handlerScriptAtTargetEvent(localID, handle, targetpos, currentpos); 1319 foreach (ScriptAtTargetEvent d in handlerScriptAtTargetEvent.GetInvocationList())
852 } 1320 {
1321 try
1322 {
1323 d(localID, handle, targetpos, currentpos);
1324 }
1325 catch (Exception e)
1326 {
1327 m_log.ErrorFormat(
1328 "[EVENT MANAGER]: Delegate for TriggerAtTargetEvent failed - continuing. {0} {1}",
1329 e.Message, e.StackTrace);
1330 }
1331 }
1332 }
853 } 1333 }
854 1334
855 public void TriggerNotAtTargetEvent(uint localID) 1335 public void TriggerNotAtTargetEvent(uint localID)
856 { 1336 {
857 handlerScriptNotAtTargetEvent = OnScriptNotAtTargetEvent; 1337 ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = OnScriptNotAtTargetEvent;
858 if (handlerScriptNotAtTargetEvent != null) 1338 if (handlerScriptNotAtTargetEvent != null)
859 { 1339 {
860 handlerScriptNotAtTargetEvent(localID); 1340 foreach (ScriptNotAtTargetEvent d in handlerScriptNotAtTargetEvent.GetInvocationList())
861 } 1341 {
1342 try
1343 {
1344 d(localID);
1345 }
1346 catch (Exception e)
1347 {
1348 m_log.ErrorFormat(
1349 "[EVENT MANAGER]: Delegate for TriggerNotAtTargetEvent failed - continuing. {0} {1}",
1350 e.Message, e.StackTrace);
1351 }
1352 }
1353 }
862 } 1354 }
863 1355
864 public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot) 1356 public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot)
865 { 1357 {
866 handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent; 1358 ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent;
867 if (handlerScriptAtRotTargetEvent != null) 1359 if (handlerScriptAtRotTargetEvent != null)
868 { 1360 {
869 handlerScriptAtRotTargetEvent(localID, handle, targetrot, currentrot); 1361 foreach (ScriptAtRotTargetEvent d in handlerScriptAtRotTargetEvent.GetInvocationList())
870 } 1362 {
1363 try
1364 {
1365 d(localID, handle, targetrot, currentrot);
1366 }
1367 catch (Exception e)
1368 {
1369 m_log.ErrorFormat(
1370 "[EVENT MANAGER]: Delegate for TriggerAtRotTargetEvent failed - continuing. {0} {1}",
1371 e.Message, e.StackTrace);
1372 }
1373 }
1374 }
871 } 1375 }
872 1376
873 public void TriggerNotAtRotTargetEvent(uint localID) 1377 public void TriggerNotAtRotTargetEvent(uint localID)
874 { 1378 {
875 handlerScriptNotAtRotTargetEvent = OnScriptNotAtRotTargetEvent; 1379 ScriptNotAtRotTargetEvent handlerScriptNotAtRotTargetEvent = OnScriptNotAtRotTargetEvent;
876 if (handlerScriptNotAtRotTargetEvent != null) 1380 if (handlerScriptNotAtRotTargetEvent != null)
877 { 1381 {
878 handlerScriptNotAtRotTargetEvent(localID); 1382 foreach (ScriptNotAtRotTargetEvent d in handlerScriptNotAtRotTargetEvent.GetInvocationList())
879 } 1383 {
1384 try
1385 {
1386 d(localID);
1387 }
1388 catch (Exception e)
1389 {
1390 m_log.ErrorFormat(
1391 "[EVENT MANAGER]: Delegate for TriggerNotAtRotTargetEvent failed - continuing. {0} {1}",
1392 e.Message, e.StackTrace);
1393 }
1394 }
1395 }
880 } 1396 }
881 1397
882 public void TriggerRequestChangeWaterHeight(float height) 1398 public void TriggerRequestChangeWaterHeight(float height)
883 { 1399 {
884 handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight; 1400 RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight;
885 if (handlerRequestChangeWaterHeight != null) 1401 if (handlerRequestChangeWaterHeight != null)
886 { 1402 {
887 handlerRequestChangeWaterHeight(height); 1403 foreach (RequestChangeWaterHeight d in handlerRequestChangeWaterHeight.GetInvocationList())
888 } 1404 {
1405 try
1406 {
1407 d(height);
1408 }
1409 catch (Exception e)
1410 {
1411 m_log.ErrorFormat(
1412 "[EVENT MANAGER]: Delegate for TriggerRequestChangeWaterHeight failed - continuing. {0} {1}",
1413 e.Message, e.StackTrace);
1414 }
1415 }
1416 }
889 } 1417 }
890 1418
891 public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) 1419 public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar)
892 { 1420 {
893 handlerAvatarKill = OnAvatarKilled; 1421 AvatarKillData handlerAvatarKill = OnAvatarKilled;
894 if (handlerAvatarKill != null) 1422 if (handlerAvatarKill != null)
895 { 1423 {
896 handlerAvatarKill(KillerObjectLocalID, DeadAvatar); 1424 foreach (AvatarKillData d in handlerAvatarKill.GetInvocationList())
897 } 1425 {
1426 try
1427 {
1428 d(KillerObjectLocalID, DeadAvatar);
1429 }
1430 catch (Exception e)
1431 {
1432 m_log.ErrorFormat(
1433 "[EVENT MANAGER]: Delegate for TriggerAvatarKill failed - continuing. {0} {1}",
1434 e.Message, e.StackTrace);
1435 }
1436 }
1437 }
898 } 1438 }
899 1439
900 public void TriggerSignificantClientMovement(IClientAPI client) 1440 public void TriggerSignificantClientMovement(IClientAPI client)
901 { 1441 {
902 handlerSignificantClientMovement = OnSignificantClientMovement; 1442 SignificantClientMovement handlerSignificantClientMovement = OnSignificantClientMovement;
903 if (handlerSignificantClientMovement != null) 1443 if (handlerSignificantClientMovement != null)
904 { 1444 {
905 handlerSignificantClientMovement(client); 1445 foreach (SignificantClientMovement d in handlerSignificantClientMovement.GetInvocationList())
906 } 1446 {
1447 try
1448 {
1449 d(client);
1450 }
1451 catch (Exception e)
1452 {
1453 m_log.ErrorFormat(
1454 "[EVENT MANAGER]: Delegate for TriggerSignificantClientMovement failed - continuing. {0} {1}",
1455 e.Message, e.StackTrace);
1456 }
1457 }
1458 }
907 } 1459 }
908 1460
909 public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat) 1461 public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat)
910 { 1462 {
911 handlerChatFromWorld = OnChatFromWorld; 1463 ChatFromWorldEvent handlerChatFromWorld = OnChatFromWorld;
912 if (handlerChatFromWorld != null) 1464 if (handlerChatFromWorld != null)
913 { 1465 {
914 handlerChatFromWorld(sender, chat); 1466 foreach (ChatFromWorldEvent d in handlerChatFromWorld.GetInvocationList())
915 } 1467 {
1468 try
1469 {
1470 d(sender, chat);
1471 }
1472 catch (Exception e)
1473 {
1474 m_log.ErrorFormat(
1475 "[EVENT MANAGER]: Delegate for TriggerOnChatFromWorld failed - continuing. {0} {1}",
1476 e.Message, e.StackTrace);
1477 }
1478 }
1479 }
916 } 1480 }
917 1481
918 public void TriggerOnChatFromClient(Object sender, OSChatMessage chat) 1482 public void TriggerOnChatFromClient(Object sender, OSChatMessage chat)
919 { 1483 {
920 handlerChatFromClient = OnChatFromClient; 1484 ChatFromClientEvent handlerChatFromClient = OnChatFromClient;
921 if (handlerChatFromClient != null) 1485 if (handlerChatFromClient != null)
922 { 1486 {
923 handlerChatFromClient(sender, chat); 1487 foreach (ChatFromClientEvent d in handlerChatFromClient.GetInvocationList())
924 } 1488 {
1489 try
1490 {
1491 d(sender, chat);
1492 }
1493 catch (Exception e)
1494 {
1495 m_log.ErrorFormat(
1496 "[EVENT MANAGER]: Delegate for TriggerOnChatFromClient failed - continuing. {0} {1}",
1497 e.Message, e.StackTrace);
1498 }
1499 }
1500 }
925 } 1501 }
926 1502
927 public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) 1503 public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
928 { 1504 {
929 handlerChatBroadcast = OnChatBroadcast; 1505 ChatBroadcastEvent handlerChatBroadcast = OnChatBroadcast;
930 if (handlerChatBroadcast != null) 1506 if (handlerChatBroadcast != null)
931 { 1507 {
932 handlerChatBroadcast(sender, chat); 1508 foreach (ChatBroadcastEvent d in handlerChatBroadcast.GetInvocationList())
933 } 1509 {
1510 try
1511 {
1512 d(sender, chat);
1513 }
1514 catch (Exception e)
1515 {
1516 m_log.ErrorFormat(
1517 "[EVENT MANAGER]: Delegate for TriggerOnChatBroadcast failed - continuing. {0} {1}",
1518 e.Message, e.StackTrace);
1519 }
1520 }
1521 }
934 } 1522 }
935 1523
936 internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed) 1524 internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed)
937 { 1525 {
938 handlerScriptControlEvent = OnScriptControlEvent; 1526 ScriptControlEvent handlerScriptControlEvent = OnScriptControlEvent;
939 if (handlerScriptControlEvent != null) 1527 if (handlerScriptControlEvent != null)
940 { 1528 {
941 handlerScriptControlEvent(p, scriptUUID, avatarID, held, _changed); 1529 foreach (ScriptControlEvent d in handlerScriptControlEvent.GetInvocationList())
942 } 1530 {
1531 try
1532 {
1533 d(p, scriptUUID, avatarID, held, _changed);
1534 }
1535 catch (Exception e)
1536 {
1537 m_log.ErrorFormat(
1538 "[EVENT MANAGER]: Delegate for TriggerControlEvent failed - continuing. {0} {1}",
1539 e.Message, e.StackTrace);
1540 }
1541 }
1542 }
943 } 1543 }
944 1544
945 public void TriggerNoticeNoLandDataFromStorage() 1545 public void TriggerNoticeNoLandDataFromStorage()
946 { 1546 {
947 handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage; 1547 NoticeNoLandDataFromStorage handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage;
948 if (handlerNoticeNoLandDataFromStorage != null) 1548 if (handlerNoticeNoLandDataFromStorage != null)
949 { 1549 {
950 handlerNoticeNoLandDataFromStorage(); 1550 foreach (NoticeNoLandDataFromStorage d in handlerNoticeNoLandDataFromStorage.GetInvocationList())
951 1551 {
952 } 1552 try
1553 {
1554 d();
1555 }
1556 catch (Exception e)
1557 {
1558 m_log.ErrorFormat(
1559 "[EVENT MANAGER]: Delegate for TriggerNoticeNoLandDataFromStorage failed - continuing. {0} {1}",
1560 e.Message, e.StackTrace);
1561 }
1562 }
1563 }
953 } 1564 }
954 1565
955 public void TriggerIncomingLandDataFromStorage(List<LandData> landData) 1566 public void TriggerIncomingLandDataFromStorage(List<LandData> landData)
956 { 1567 {
957 handlerIncomingLandDataFromStorage = OnIncomingLandDataFromStorage; 1568 IncomingLandDataFromStorage handlerIncomingLandDataFromStorage = OnIncomingLandDataFromStorage;
958 if (handlerIncomingLandDataFromStorage != null) 1569 if (handlerIncomingLandDataFromStorage != null)
959 { 1570 {
960 handlerIncomingLandDataFromStorage(landData); 1571 foreach (IncomingLandDataFromStorage d in handlerIncomingLandDataFromStorage.GetInvocationList())
961 1572 {
962 } 1573 try
1574 {
1575 d(landData);
1576 }
1577 catch (Exception e)
1578 {
1579 m_log.ErrorFormat(
1580 "[EVENT MANAGER]: Delegate for TriggerIncomingLandDataFromStorage failed - continuing. {0} {1}",
1581 e.Message, e.StackTrace);
1582 }
1583 }
1584 }
963 } 1585 }
964 1586
965 public void TriggerSetAllowForcefulBan(bool allow) 1587 public void TriggerSetAllowForcefulBan(bool allow)
966 { 1588 {
967 handlerSetAllowForcefulBan = OnSetAllowForcefulBan; 1589 SetAllowForcefulBan handlerSetAllowForcefulBan = OnSetAllowForcefulBan;
968 if (handlerSetAllowForcefulBan != null) 1590 if (handlerSetAllowForcefulBan != null)
969 { 1591 {
970 handlerSetAllowForcefulBan(allow); 1592 foreach (SetAllowForcefulBan d in handlerSetAllowForcefulBan.GetInvocationList())
971 1593 {
972 } 1594 try
1595 {
1596 d(allow);
1597 }
1598 catch (Exception e)
1599 {
1600 m_log.ErrorFormat(
1601 "[EVENT MANAGER]: Delegate for TriggerSetAllowForcefulBan failed - continuing. {0} {1}",
1602 e.Message, e.StackTrace);
1603 }
1604 }
1605 }
973 } 1606 }
974 1607
975 public void TriggerRequestParcelPrimCountUpdate() 1608 public void TriggerRequestParcelPrimCountUpdate()
976 { 1609 {
977 handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate; 1610 RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate;
978 if (handlerRequestParcelPrimCountUpdate != null) 1611 if (handlerRequestParcelPrimCountUpdate != null)
979 { 1612 {
980 handlerRequestParcelPrimCountUpdate(); 1613 foreach (RequestParcelPrimCountUpdate d in handlerRequestParcelPrimCountUpdate.GetInvocationList())
981 } 1614 {
1615 try
1616 {
1617 d();
1618 }
1619 catch (Exception e)
1620 {
1621 m_log.ErrorFormat(
1622 "[EVENT MANAGER]: Delegate for TriggerRequestParcelPrimCountUpdate failed - continuing. {0} {1}",
1623 e.Message, e.StackTrace);
1624 }
1625 }
1626 }
982 } 1627 }
983 1628
984 public void TriggerParcelPrimCountTainted() 1629 public void TriggerParcelPrimCountTainted()
985 { 1630 {
986 handlerParcelPrimCountTainted = OnParcelPrimCountTainted; 1631 ParcelPrimCountTainted handlerParcelPrimCountTainted = OnParcelPrimCountTainted;
987 if (handlerParcelPrimCountTainted != null) 1632 if (handlerParcelPrimCountTainted != null)
988 { 1633 {
989 handlerParcelPrimCountTainted(); 1634 foreach (ParcelPrimCountTainted d in handlerParcelPrimCountTainted.GetInvocationList())
990 } 1635 {
1636 try
1637 {
1638 d();
1639 }
1640 catch (Exception e)
1641 {
1642 m_log.ErrorFormat(
1643 "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountTainted failed - continuing. {0} {1}",
1644 e.Message, e.StackTrace);
1645 }
1646 }
1647 }
991 } 1648 }
992 1649
993 // this lets us keep track of nasty script events like timer, etc. 1650 // this lets us keep track of nasty script events like timer, etc.
@@ -1010,99 +1667,277 @@ namespace OpenSim.Region.Framework.Scenes
1010 /// <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> 1667 /// <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>
1011 public void TriggerEstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float FixedSunHour) 1668 public void TriggerEstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float FixedSunHour)
1012 { 1669 {
1013 handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate; 1670 EstateToolsSunUpdate handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate;
1014 if (handlerEstateToolsSunUpdate != null) 1671 if (handlerEstateToolsSunUpdate != null)
1015 { 1672 {
1016 handlerEstateToolsSunUpdate(regionHandle, FixedTime, useEstateTime, FixedSunHour); 1673 foreach (EstateToolsSunUpdate d in handlerEstateToolsSunUpdate.GetInvocationList())
1017 } 1674 {
1675 try
1676 {
1677 d(regionHandle, FixedTime, useEstateTime, FixedSunHour);
1678 }
1679 catch (Exception e)
1680 {
1681 m_log.ErrorFormat(
1682 "[EVENT MANAGER]: Delegate for TriggerEstateToolsSunUpdate failed - continuing. {0} {1}",
1683 e.Message, e.StackTrace);
1684 }
1685 }
1686 }
1018 } 1687 }
1019 1688
1020 public float GetCurrentTimeAsSunLindenHour() 1689 public float GetCurrentTimeAsSunLindenHour()
1021 { 1690 {
1022 handlerCurrentTimeAsLindenSunHour = OnGetCurrentTimeAsLindenSunHour; 1691 SunLindenHour handlerCurrentTimeAsLindenSunHour = OnGetCurrentTimeAsLindenSunHour;
1023 if (handlerCurrentTimeAsLindenSunHour != null) 1692 if (handlerCurrentTimeAsLindenSunHour != null)
1024 { 1693 {
1025 return handlerCurrentTimeAsLindenSunHour(); 1694 foreach (SunLindenHour d in handlerCurrentTimeAsLindenSunHour.GetInvocationList())
1695 {
1696 try
1697 {
1698 return d();
1699 }
1700 catch (Exception e)
1701 {
1702 m_log.ErrorFormat(
1703 "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
1704 e.Message, e.StackTrace);
1705 }
1706 }
1026 } 1707 }
1708
1027 return 6; 1709 return 6;
1028 } 1710 }
1029 1711
1030 public void TriggerOarFileLoaded(Guid requestId, string message) 1712 public void TriggerOarFileLoaded(Guid requestId, string message)
1031 { 1713 {
1032 handlerOarFileLoaded = OnOarFileLoaded; 1714 OarFileLoaded handlerOarFileLoaded = OnOarFileLoaded;
1033 if (handlerOarFileLoaded != null) 1715 if (handlerOarFileLoaded != null)
1034 handlerOarFileLoaded(requestId, message); 1716 {
1717 foreach (OarFileLoaded d in handlerOarFileLoaded.GetInvocationList())
1718 {
1719 try
1720 {
1721 d(requestId, message);
1722 }
1723 catch (Exception e)
1724 {
1725 m_log.ErrorFormat(
1726 "[EVENT MANAGER]: Delegate for TriggerOarFileLoaded failed - continuing. {0} {1}",
1727 e.Message, e.StackTrace);
1728 }
1729 }
1730 }
1035 } 1731 }
1036 1732
1037 public void TriggerOarFileSaved(Guid requestId, string message) 1733 public void TriggerOarFileSaved(Guid requestId, string message)
1038 { 1734 {
1039 handlerOarFileSaved = OnOarFileSaved; 1735 OarFileSaved handlerOarFileSaved = OnOarFileSaved;
1040 if (handlerOarFileSaved != null) 1736 if (handlerOarFileSaved != null)
1041 handlerOarFileSaved(requestId, message); 1737 {
1738 foreach (OarFileSaved d in handlerOarFileSaved.GetInvocationList())
1739 {
1740 try
1741 {
1742 d(requestId, message);
1743 }
1744 catch (Exception e)
1745 {
1746 m_log.ErrorFormat(
1747 "[EVENT MANAGER]: Delegate for TriggerOarFileSaved failed - continuing. {0} {1}",
1748 e.Message, e.StackTrace);
1749 }
1750 }
1751 }
1042 } 1752 }
1043 1753
1044 public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message) 1754 public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message)
1045 { 1755 {
1046 handlerEmptyScriptCompileQueue = OnEmptyScriptCompileQueue; 1756 EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = OnEmptyScriptCompileQueue;
1047 if (handlerEmptyScriptCompileQueue != null) 1757 if (handlerEmptyScriptCompileQueue != null)
1048 handlerEmptyScriptCompileQueue(numScriptsFailed, message); 1758 {
1759 foreach (EmptyScriptCompileQueue d in handlerEmptyScriptCompileQueue.GetInvocationList())
1760 {
1761 try
1762 {
1763 d(numScriptsFailed, message);
1764 }
1765 catch (Exception e)
1766 {
1767 m_log.ErrorFormat(
1768 "[EVENT MANAGER]: Delegate for TriggerEmptyScriptCompileQueue failed - continuing. {0} {1}",
1769 e.Message, e.StackTrace);
1770 }
1771 }
1772 }
1049 } 1773 }
1050 1774
1051 public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders) 1775 public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders)
1052 { 1776 {
1053 handlerCollidingStart = OnScriptColliderStart; 1777 ScriptColliding handlerCollidingStart = OnScriptColliderStart;
1054 if (handlerCollidingStart != null) 1778 if (handlerCollidingStart != null)
1055 handlerCollidingStart(localId, colliders); 1779 {
1780 foreach (ScriptColliding d in handlerCollidingStart.GetInvocationList())
1781 {
1782 try
1783 {
1784 d(localId, colliders);
1785 }
1786 catch (Exception e)
1787 {
1788 m_log.ErrorFormat(
1789 "[EVENT MANAGER]: Delegate for TriggerScriptCollidingStart failed - continuing. {0} {1}",
1790 e.Message, e.StackTrace);
1791 }
1792 }
1793 }
1056 } 1794 }
1057 1795
1058 public void TriggerScriptColliding(uint localId, ColliderArgs colliders) 1796 public void TriggerScriptColliding(uint localId, ColliderArgs colliders)
1059 { 1797 {
1060 handlerColliding = OnScriptColliding; 1798 ScriptColliding handlerColliding = OnScriptColliding;
1061 if (handlerColliding != null) 1799 if (handlerColliding != null)
1062 handlerColliding(localId, colliders); 1800 {
1801 foreach (ScriptColliding d in handlerColliding.GetInvocationList())
1802 {
1803 try
1804 {
1805 d(localId, colliders);
1806 }
1807 catch (Exception e)
1808 {
1809 m_log.ErrorFormat(
1810 "[EVENT MANAGER]: Delegate for TriggerScriptColliding failed - continuing. {0} {1}",
1811 e.Message, e.StackTrace);
1812 }
1813 }
1814 }
1063 } 1815 }
1064 1816
1065 public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) 1817 public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders)
1066 { 1818 {
1067 handlerCollidingEnd = OnScriptCollidingEnd; 1819 ScriptColliding handlerCollidingEnd = OnScriptCollidingEnd;
1068 if (handlerCollidingEnd != null) 1820 if (handlerCollidingEnd != null)
1069 handlerCollidingEnd(localId, colliders); 1821 {
1822 foreach (ScriptColliding d in handlerCollidingEnd.GetInvocationList())
1823 {
1824 try
1825 {
1826 d(localId, colliders);
1827 }
1828 catch (Exception e)
1829 {
1830 m_log.ErrorFormat(
1831 "[EVENT MANAGER]: Delegate for TriggerScriptCollidingEnd failed - continuing. {0} {1}",
1832 e.Message, e.StackTrace);
1833 }
1834 }
1835 }
1070 } 1836 }
1071 1837
1072 public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders) 1838 public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders)
1073 { 1839 {
1074 handlerLandCollidingStart = OnScriptLandColliderStart; 1840 ScriptColliding handlerLandCollidingStart = OnScriptLandColliderStart;
1075 if (handlerLandCollidingStart != null) 1841 if (handlerLandCollidingStart != null)
1076 handlerLandCollidingStart(localId, colliders); 1842 {
1843 foreach (ScriptColliding d in handlerLandCollidingStart.GetInvocationList())
1844 {
1845 try
1846 {
1847 d(localId, colliders);
1848 }
1849 catch (Exception e)
1850 {
1851 m_log.ErrorFormat(
1852 "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingStart failed - continuing. {0} {1}",
1853 e.Message, e.StackTrace);
1854 }
1855 }
1856 }
1077 } 1857 }
1078 1858
1079 public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders) 1859 public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders)
1080 { 1860 {
1081 handlerLandColliding = OnScriptLandColliding; 1861 ScriptColliding handlerLandColliding = OnScriptLandColliding;
1082 if (handlerLandColliding != null) 1862 if (handlerLandColliding != null)
1083 handlerLandColliding(localId, colliders); 1863 {
1864 foreach (ScriptColliding d in handlerLandColliding.GetInvocationList())
1865 {
1866 try
1867 {
1868 d(localId, colliders);
1869 }
1870 catch (Exception e)
1871 {
1872 m_log.ErrorFormat(
1873 "[EVENT MANAGER]: Delegate for TriggerScriptLandColliding failed - continuing. {0} {1}",
1874 e.Message, e.StackTrace);
1875 }
1876 }
1877 }
1084 } 1878 }
1085 1879
1086 public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders) 1880 public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders)
1087 { 1881 {
1088 handlerLandCollidingEnd = OnScriptLandColliderEnd; 1882 ScriptColliding handlerLandCollidingEnd = OnScriptLandColliderEnd;
1089 if (handlerLandCollidingEnd != null) 1883 if (handlerLandCollidingEnd != null)
1090 handlerLandCollidingEnd(localId, colliders); 1884 {
1885 foreach (ScriptColliding d in handlerLandCollidingEnd.GetInvocationList())
1886 {
1887 try
1888 {
1889 d(localId, colliders);
1890 }
1891 catch (Exception e)
1892 {
1893 m_log.ErrorFormat(
1894 "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingEnd failed - continuing. {0} {1}",
1895 e.Message, e.StackTrace);
1896 }
1897 }
1898 }
1091 } 1899 }
1092 1900
1093 public void TriggerSetRootAgentScene(UUID agentID, Scene scene) 1901 public void TriggerSetRootAgentScene(UUID agentID, Scene scene)
1094 { 1902 {
1095 handlerSetRootAgentScene = OnSetRootAgentScene; 1903 OnSetRootAgentSceneDelegate handlerSetRootAgentScene = OnSetRootAgentScene;
1096 if (handlerSetRootAgentScene != null) 1904 if (handlerSetRootAgentScene != null)
1097 handlerSetRootAgentScene(agentID, scene); 1905 {
1906 foreach (OnSetRootAgentSceneDelegate d in handlerSetRootAgentScene.GetInvocationList())
1907 {
1908 try
1909 {
1910 d(agentID, scene);
1911 }
1912 catch (Exception e)
1913 {
1914 m_log.ErrorFormat(
1915 "[EVENT MANAGER]: Delegate for TriggerSetRootAgentScene failed - continuing. {0} {1}",
1916 e.Message, e.StackTrace);
1917 }
1918 }
1919 }
1098 } 1920 }
1099 1921
1100 public void TriggerOnRegionUp(GridRegion otherRegion) 1922 public void TriggerOnRegionUp(GridRegion otherRegion)
1101 { 1923 {
1102 handlerOnRegionUp = OnRegionUp; 1924 RegionUp handlerOnRegionUp = OnRegionUp;
1103 if (handlerOnRegionUp != null) 1925 if (handlerOnRegionUp != null)
1104 handlerOnRegionUp(otherRegion); 1926 {
1927 foreach (RegionUp d in handlerOnRegionUp.GetInvocationList())
1928 {
1929 try
1930 {
1931 d(otherRegion);
1932 }
1933 catch (Exception e)
1934 {
1935 m_log.ErrorFormat(
1936 "[EVENT MANAGER]: Delegate for TriggerOnRegionUp failed - continuing. {0} {1}",
1937 e.Message, e.StackTrace);
1938 }
1939 }
1940 }
1105 } 1941 }
1106
1107 } 1942 }
1108} 1943} \ No newline at end of file