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 --- .../Region/Environment/Modules/World/Land/LandChannel.cs | 10 ---------- .../Modules/World/Land/LandManagementModule.cs | 1 + OpenSim/Region/Environment/Scenes/SceneEvents.cs | 16 ++++++++++++++++ OpenSim/Region/Environment/Scenes/ScenePresence.cs | 13 ++----------- 4 files changed, 19 insertions(+), 21 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs index 341412a..2a28283 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs @@ -79,16 +79,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land { m_scene = scene; landIDList.Initialize(); - - m_scene.EventManager.OnNewPresence += handleNewPresence; - } - - private void handleNewPresence(ScenePresence avatar) - { - if (avatar.IsChildAgent) - { - avatar.OnSignificantClientMovement += handleSignificantClientMovement; - } } #region Land Object From Storage Functions diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 5e65608..a339ebf 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs @@ -51,6 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land m_scene.EventManager.OnValidateLandBuy += landChannel.handleLandValidationRequest; m_scene.EventManager.OnLandBuy += landChannel.handleLandBuyRequest; m_scene.EventManager.OnNewClient += new EventManager.OnNewClientDelegate(EventManager_OnNewClient); + m_scene.EventManager.OnSignificantClientMovement += landChannel.handleSignificantClientMovement; lock (m_scene) { 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