From e15fca60d1efcfe32e795e3494e35bdae26111e2 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 21 Jul 2018 18:31:58 +0100 Subject: mantis8342: make max ban height above ground configurable per regions instance with ini file option BanLineSafeHeight --- OpenSim/Region/CoreModules/World/Land/LandChannel.cs | 20 ++++++++++++++++++-- .../CoreModules/World/Land/LandManagementModule.cs | 16 +++++++++++++++- OpenSim/Region/CoreModules/World/Land/LandObject.cs | 2 +- 3 files changed, 34 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index 5ff063b..993b782 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs @@ -37,11 +37,9 @@ namespace OpenSim.Region.CoreModules.World.Land { #region Constants - public const float BAN_LINE_SAFETY_HEIGHT = 100; //Land types set with flags in ParcelOverlay. //Only one of these can be used. - //RequestResults (I think these are right, they seem to work): public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land public const int LAND_RESULT_SINGLE = 0; // The request they made contained only a single piece of land @@ -77,10 +75,28 @@ namespace OpenSim.Region.CoreModules.World.Land private readonly Scene m_scene; private readonly LandManagementModule m_landManagementModule; + private float m_BanLineSafeHeight = 100.0f; + public float BanLineSafeHeight + { + get + { + return m_BanLineSafeHeight; + } + private set + { + if (value >= 20f && value <= 5000f) + m_BanLineSafeHeight = value; + else + m_BanLineSafeHeight = 100.0f; + } + } + public LandChannel(Scene scene, LandManagementModule landManagementMod) { m_scene = scene; m_landManagementModule = landManagementMod; + if(landManagementMod != null) + m_BanLineSafeHeight = landManagementMod.BanLineSafeHeight; } #region ILandChannel Members diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 09ece7d..19b714e 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -116,6 +116,19 @@ namespace OpenSim.Region.CoreModules.World.Land // "View distance" for sending parcel layer info if asked for from a view point in the region private int parcelLayerViewDistance { get; set; } + private float m_BanLineSafeHeight = 100.0f; + public float BanLineSafeHeight + { + get { return m_BanLineSafeHeight; } + private set + { + if (value > 20f && value <= 5000f) + m_BanLineSafeHeight = value; + else + m_BanLineSafeHeight = 100.0f; + } + } + #region INonSharedRegionModule Members public Type ReplaceableInterface @@ -137,6 +150,7 @@ namespace OpenSim.Region.CoreModules.World.Land bool disablebans = landManagementConfig.GetBoolean("DisableParcelBans", !m_allowedForcefulBans); m_allowedForcefulBans = !disablebans; m_showBansLines = landManagementConfig.GetBoolean("ShowParcelBansLines", m_showBansLines); + m_BanLineSafeHeight = landManagementConfig.GetFloat("BanLineSafeHeight", m_BanLineSafeHeight); } } @@ -341,7 +355,7 @@ namespace OpenSim.Region.CoreModules.World.Land public bool EnforceBans(ILandObject land, ScenePresence avatar) { Vector3 agentpos = avatar.AbsolutePosition; - float h = m_scene.GetGroundHeight(agentpos.X, agentpos.Y) + LandChannel.BAN_LINE_SAFETY_HEIGHT; + float h = m_scene.GetGroundHeight(agentpos.X, agentpos.Y) + m_scene.LandChannel.BanLineSafeHeight; float zdif = avatar.AbsolutePosition.Z - h; if (zdif > 0 ) { diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index cbe8a2e..229587b 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -633,7 +633,7 @@ namespace OpenSim.Region.CoreModules.World.Land public bool CanBeOnThisLand(UUID avatar, float posHeight) { - if (posHeight < LandChannel.BAN_LINE_SAFETY_HEIGHT && IsBannedFromLand(avatar)) + if (posHeight < m_scene.LandChannel.BanLineSafeHeight && IsBannedFromLand(avatar)) { return false; } -- cgit v1.1