From a5e9429f2bb2276486cc2f1ed2249e14fba90d6a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 31 Jul 2014 03:10:50 +0100 Subject: MESS: changes in MakeRootAgent and CompleteMovement reordering things. Added sending of land overlay and parcel information. This in order to only send avatar related information after having its position well defined and on the right parcel. THIS MAY STILL BE BAD :) --- .../Region/CoreModules/World/Land/LandChannel.cs | 8 ++++++- .../CoreModules/World/Land/LandManagementModule.cs | 26 ++++++++++++++++++---- 2 files changed, 29 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index beb0a24..378826d 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs @@ -213,7 +213,13 @@ namespace OpenSim.Region.CoreModules.World.Land m_landManagementModule.setParcelOtherCleanTime(remoteClient, localID, otherCleanTime); } } - + public void sendClientInitialLandInfo(IClientAPI remoteClient) + { + if (m_landManagementModule != null) + { + m_landManagementModule.sendClientInitialLandInfo(remoteClient); + } + } #endregion } } diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index c444c29..0a2882a 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -146,7 +146,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; - + lock (m_scene) { m_scene.LandChannel = (ILandChannel)landChannel; @@ -194,13 +194,14 @@ namespace OpenSim.Region.CoreModules.World.Land client.OnParcelEjectUser += ClientOnParcelEjectUser; client.OnParcelFreezeUser += ClientOnParcelFreezeUser; client.OnSetStartLocationRequest += ClientOnSetHome; - +/* avatar is still a child here position is unknow EntityBase presenceEntity; if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence) { SendParcelOverlay(client); SendLandUpdate((ScenePresence)presenceEntity, true); } +*/ } public void EventMakeChildAgent(ScenePresence avatar) @@ -385,12 +386,29 @@ namespace OpenSim.Region.CoreModules.World.Land return; } + public void sendClientInitialLandInfo(IClientAPI remoteClient) + { + SendParcelOverlay(remoteClient); + ScenePresence avatar; + if (!m_scene.TryGetScenePresence(remoteClient.AgentId, out avatar)) + return; + if (avatar.IsChildAgent) + return; + + ILandObject over = GetLandObject(avatar.AbsolutePosition.X,avatar.AbsolutePosition.Y); + if (over == null) + return; + + avatar.currentParcelUUID = over.LandData.GlobalID; + over.SendLandUpdateToClient(avatar.ControllingClient); + } + public void SendLandUpdate(ScenePresence avatar, bool force) { if (avatar.IsChildAgent) return; - - ILandObject over = GetLandObjectClipedXY(avatar.AbsolutePosition.X,avatar.AbsolutePosition.Y); + + ILandObject over = GetLandObjectClipedXY(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); if (over != null) { -- cgit v1.1