diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 8bc81ae24b..aae6603d57 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -401,30 +401,51 @@ namespace OpenSim.Region.CoreModules.World.Land public void SendLandUpdate(ScenePresence avatar, bool force) { + + /* stop sendind same data twice + ILandObject over = GetLandObject((int)Math.Min(((int)Constants.RegionSize - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), + (int)Math.Min(((int)Constants.RegionSize - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); + + if (over != null) + { + + if (force) + { + if (!avatar.IsChildAgent) + { + over.SendLandUpdateToClient(avatar.ControllingClient); + m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID, + m_scene.RegionInfo.RegionID); + } + } + + if (avatar.currentParcelUUID != over.LandData.GlobalID) + { + if (!avatar.IsChildAgent) + { + over.SendLandUpdateToClient(avatar.ControllingClient); + avatar.currentParcelUUID = over.LandData.GlobalID; + m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID, + m_scene.RegionInfo.RegionID); + } + } + */ + if (avatar.IsChildAgent) + return; + ILandObject over = GetLandObject((int)Math.Min(((int)Constants.RegionSize - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), - (int)Math.Min(((int)Constants.RegionSize - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); + (int)Math.Min(((int)Constants.RegionSize - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); if (over != null) { - if (force) + bool NotsameID = (avatar.currentParcelUUID != over.LandData.GlobalID); + if (force || NotsameID) { - if (!avatar.IsChildAgent) - { - over.SendLandUpdateToClient(avatar.ControllingClient); - m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID, - m_scene.RegionInfo.RegionID); - } - } - - if (avatar.currentParcelUUID != over.LandData.GlobalID) - { - if (!avatar.IsChildAgent) - { - over.SendLandUpdateToClient(avatar.ControllingClient); + over.SendLandUpdateToClient(avatar.ControllingClient); + if (NotsameID) avatar.currentParcelUUID = over.LandData.GlobalID; - m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID, - m_scene.RegionInfo.RegionID); - } + m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID, + m_scene.RegionInfo.RegionID); } } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0237021251..0dae946495 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2890,9 +2890,11 @@ namespace OpenSim.Region.Framework.Scenes { EventManager.TriggerOnClientLogin(client); // Send initial parcel data +/* this is done on TriggerOnNewClient by landmanegement respective event handler Vector3 pos = sp.AbsolutePosition; ILandObject land = LandChannel.GetLandObject(pos.X, pos.Y); land.SendLandUpdateToClient(client); +*/ } return sp; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 433efc7644..a8aa551012 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1315,13 +1315,15 @@ namespace OpenSim.Region.Framework.Scenes // Create child agents in neighbouring regions if (openChildAgents && !IsChildAgent) { + IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface(); if (m_agentTransfer != null) - Util.FireAndForget(delegate { m_agentTransfer.EnableChildAgents(this); }); + m_agentTransfer.EnableChildAgents(this); IFriendsModule friendsModule = m_scene.RequestModuleInterface(); if (friendsModule != null) friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); + } // m_log.DebugFormat( diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 091e41ac9d..9e04601a6f 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -129,7 +129,7 @@ namespace OpenSim.Services.Connectors string ret = serverUri.Uri.AbsoluteUri; if (ret.EndsWith("/")) ret = ret.Substring(0, ret.Length - 1); - return serverUri.Uri.AbsoluteUri; + return ret; } protected void retryCheck(object source, ElapsedEventArgs e)