From 3900a165bcbaf39f8bb4155eba72a8a2aadd13da Mon Sep 17 00:00:00 2001 From: mingchen Date: Fri, 9 May 2008 17:40:39 +0000 Subject: *Land/Parcel upates are now correct with a significant movement by the Client *Moved OnSignificantClientMovement to where it is supposed to be - SceneEvents and not ScenePresence --- OpenSim/Region/Environment/Scenes/SceneEvents.cs | 16 ++++++++++++++++ OpenSim/Region/Environment/Scenes/ScenePresence.cs | 13 ++----------- 2 files changed, 18 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs index 65dca95..88537e9 100644 --- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs +++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs @@ -121,6 +121,12 @@ namespace OpenSim.Region.Environment.Scenes public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; + public delegate void SignificantClientMovement(IClientAPI remote_client); + + public event SignificantClientMovement OnSignificantClientMovement; + + + public delegate void NewGridInstantMessage(GridInstantMessage message); public event NewGridInstantMessage OnGridInstantMessageToIMModule; @@ -279,6 +285,7 @@ namespace OpenSim.Region.Environment.Scenes private NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = null; private RequestChangeWaterHeight handlerRequestChangeWaterHeight = null; //OnRequestChangeWaterHeight private ScriptControlEvent handlerScriptControlEvent = null; + private SignificantClientMovement handlerSignificantClientMovement = null; private LandBuy handlerLandBuy = null; private LandBuy handlerValidateLandBuy = null; @@ -608,6 +615,15 @@ namespace OpenSim.Region.Environment.Scenes } } + public void TriggerSignificantClientMovement(IClientAPI client) + { + handlerSignificantClientMovement = OnSignificantClientMovement; + if (handlerSignificantClientMovement != null) + { + handlerSignificantClientMovement(client); + + } + } internal void TriggerControlEvent(uint p, LLUUID scriptUUID, LLUUID avatarID, uint held, uint _changed) { handlerScriptControlEvent = OnScriptControlEvent; diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 3554289..043d337 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -153,7 +153,6 @@ namespace OpenSim.Region.Environment.Scenes //neighbouring regions we have enabled a child agent in private readonly List m_knownChildRegions = new List(); - private SignificantClientMovement handlerSignificantClientMovement = null; //OnSignificantClientMovement; /// /// Implemented Control Flags @@ -174,10 +173,6 @@ namespace OpenSim.Region.Environment.Scenes /// private LLVector3 posLastSignificantMove = new LLVector3(); - public delegate void SignificantClientMovement(IClientAPI remote_client); - - public event SignificantClientMovement OnSignificantClientMovement; - private UpdateQueue m_partsUpdateQueue = new UpdateQueue(); private Dictionary m_updateTimes = new Dictionary(); @@ -1617,12 +1612,8 @@ namespace OpenSim.Region.Environment.Scenes if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > 0.5) { posLastSignificantMove = AbsolutePosition; - handlerSignificantClientMovement = OnSignificantClientMovement; - if (handlerSignificantClientMovement != null) - { - handlerSignificantClientMovement(m_controllingClient); - m_scene.NotifyMyCoarseLocationChange(); - } + m_scene.EventManager.TriggerSignificantClientMovement(m_controllingClient); + m_scene.NotifyMyCoarseLocationChange(); } // Minimum Draw distance is 64 meters, the Radius of the draw distance sphere is 32m -- cgit v1.1