From 582964800cc30e5ad08cf3be9a6a49fa96dd8b68 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 22 Feb 2008 19:44:46 +0000 Subject: * Moved all events except gridcomms and regioncomms over to Event Delegate instances to prevent event race conditions --- OpenSim/Region/Environment/Scenes/InnerScene.cs | 6 ++++-- OpenSim/Region/Environment/Scenes/SceneBase.cs | 4 +++- OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 6 ++++-- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 7 +++++-- OpenSim/Region/Environment/Scenes/SimStatsReporter.cs | 7 +++++-- 5 files changed, 21 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 38bcb03..fea6b2b 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -47,6 +47,7 @@ namespace OpenSim.Region.Environment.Scenes #region Events public event PhysicsCrash UnRecoverableError; + private PhysicsCrash handler001 = null; #endregion @@ -715,9 +716,10 @@ namespace OpenSim.Region.Environment.Scenes public void physicsBasedCrash() { - if (UnRecoverableError != null) + handler001 = UnRecoverableError; + if (handler001 != null) { - UnRecoverableError(); + handler001(); } } diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index 4e05682..3371912 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs @@ -160,7 +160,9 @@ namespace OpenSim.Region.Environment.Scenes public virtual void Restart(int seconds) { m_log.Error("[REGION]: passing Restart Message up the namespace"); - OnRestart(RegionInfo); + restart handler001 = OnRestart; + if (handler001 != null) + handler001(RegionInfo); } public virtual bool PresenceChildStatus(LLUUID avatarID) diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 2e4135c..8fd9edb 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -54,6 +54,7 @@ namespace OpenSim.Region.Environment.Scenes protected ulong m_regionHandle; public event PrimCountTaintedDelegate OnPrimCountTainted; + private PrimCountTaintedDelegate handler001 = null; /// /// Signal whether the non-inventory attributes of any prims in the group have changed @@ -1525,9 +1526,10 @@ namespace OpenSim.Region.Environment.Scenes /// public void TriggerTainted() { - if (OnPrimCountTainted != null) + handler001 = OnPrimCountTainted; + if (handler001 != null) { - OnPrimCountTainted(); + handler001(); } } diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 2d01282..9b80444 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -116,6 +116,8 @@ namespace OpenSim.Region.Environment.Scenes private readonly List m_knownChildRegions = new List(); //neighbouring regions we have enabled a child agent in + private SignificantClientMovement handler001 = null; //OnSignificantClientMovement; + /// /// Implemented Control Flags @@ -1482,9 +1484,10 @@ namespace OpenSim.Region.Environment.Scenes if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > 0.5) { posLastSignificantMove = AbsolutePosition; - if (OnSignificantClientMovement != null) + + if (handler001 != null) { - OnSignificantClientMovement(m_controllingClient); + handler001(m_controllingClient); m_scene.NotifyMyCoarseLocationChange(); } } diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index 90e09b0..d4868f3 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs @@ -39,6 +39,8 @@ namespace OpenSim.Region.Environment.Scenes public event SendStatResult OnSendStatsResult; + private SendStatResult handler001 = null; + private enum Stats : uint { TimeDilation = 0, @@ -245,9 +247,10 @@ namespace OpenSim.Region.Environment.Scenes statpack.Stat = sb; - if (OnSendStatsResult != null) + handler001 = OnSendStatsResult; + if (handler001 != null) { - OnSendStatsResult(statpack); + handler001(statpack); } resetvalues(); m_report.Enabled = true; -- cgit v1.1