From aff9c345dddfa290222ceaf42b6c452a590a2276 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 12 Jul 2017 07:27:21 +0100 Subject: osSetParcelDetails: add more land update code --- .../Region/CoreModules/World/Land/LandChannel.cs | 8 +++++++ .../Shared/Api/Implementation/OSSL_Api.cs | 26 +++++++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index b59e2af..5ff063b 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 f274cd3..79367fb 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) -- cgit v1.1