diff --git a/OpenSim/Framework/ILandChannel.cs b/OpenSim/Framework/ILandChannel.cs index 12a822869b..866783751c 100644 --- a/OpenSim/Framework/ILandChannel.cs +++ b/OpenSim/Framework/ILandChannel.cs @@ -88,6 +88,7 @@ namespace OpenSim.Region.Framework.Interfaces bool IsForcefulBansAllowed(); void UpdateLandObject(int localID, LandData data); + void SendParcelsOverlay(IClientAPI client); void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient); void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel); void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel); diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index b59e2af809..5ff063bc31 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs @@ -176,6 +176,14 @@ namespace OpenSim.Region.CoreModules.World.Land } } + public void SendParcelsOverlay(IClientAPI client) + { + if (m_landManagementModule != null) + { + m_landManagementModule.SendParcelOverlay(client); + } + } + public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) { if (m_landManagementModule != null) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index f274cd3526..79367fbae3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1617,6 +1617,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api bool changed = false; bool changedSeeAvs = false; + bool changedoverlay = false; + bool changedneedupdate = false; // Process the rules, not sure what the impact would be of changing owner or group for (int idx = 0; idx < rules.Length;) @@ -1719,6 +1721,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { changed = true; changedSeeAvs = true; + changedoverlay = true; + changedneedupdate = true; newLand.SeeAVs = newavs; } break; @@ -1744,19 +1748,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } if(changed) { - World.LandChannel.UpdateLandObject(newLand.LocalID,newLand); + World.LandChannel.UpdateLandObject(newLand.LocalID, newLand); - if(changedSeeAvs) + if(changedneedupdate) { UUID parcelID= newLand.GlobalID; - World.ForEachScenePresence(delegate (ScenePresence avatar) + World.ForEachRootScenePresence(delegate (ScenePresence avatar) { - if (avatar != null && !avatar.IsDeleted && avatar.currentParcelUUID == parcelID ) + if (avatar == null || avatar.IsDeleted || avatar.IsInTransit) + return; + + if(changedSeeAvs && avatar.currentParcelUUID == parcelID ) avatar.currentParcelUUID = parcelID; // force parcel flags review + + if(avatar.ControllingClient == null) + return; + + // this will be needed for some things like damage etc +// if(avatar.currentParcelUUID == parcelID) +// startLandObject.SendLandUpdateToClient(avatar.ControllingClient); + + if(changedoverlay && !avatar.IsNPC) + World.LandChannel.SendParcelsOverlay(avatar.ControllingClient); }); } } - } public double osList2Double(LSL_Types.list src, int index) diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 48dc84045e..05db03fefe 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -109,6 +109,7 @@ namespace OpenSim.Tests.Common public bool IsLandPrimCountTainted() { return false; } public bool IsForcefulBansAllowed() { return false; } public void UpdateLandObject(int localID, LandData data) {} + public void SendParcelsOverlay(IClientAPI client) {} public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) {} public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) {} public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) {}