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