diff options
author | UbitUmarov | 2018-07-21 18:31:58 +0100 |
---|---|---|
committer | UbitUmarov | 2018-07-21 18:31:58 +0100 |
commit | e15fca60d1efcfe32e795e3494e35bdae26111e2 (patch) | |
tree | 0f564ff57e615fec156bc262ac704c776844cd8c /OpenSim | |
parent | mantis8341: fix MOD and LS apis configuration read from ossl file (diff) | |
download | opensim-SC-e15fca60d1efcfe32e795e3494e35bdae26111e2.zip opensim-SC-e15fca60d1efcfe32e795e3494e35bdae26111e2.tar.gz opensim-SC-e15fca60d1efcfe32e795e3494e35bdae26111e2.tar.bz2 opensim-SC-e15fca60d1efcfe32e795e3494e35bdae26111e2.tar.xz |
mantis8342: make max ban height above ground configurable per regions instance with ini file option BanLineSafeHeight
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/ILandChannel.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandChannel.cs | 20 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 16 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 2 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestLandChannel.cs | 2 |
5 files changed, 38 insertions, 5 deletions
diff --git a/OpenSim/Framework/ILandChannel.cs b/OpenSim/Framework/ILandChannel.cs index 8667837..e5ea596 100644 --- a/OpenSim/Framework/ILandChannel.cs +++ b/OpenSim/Framework/ILandChannel.cs | |||
@@ -33,6 +33,8 @@ namespace OpenSim.Region.Framework.Interfaces | |||
33 | { | 33 | { |
34 | public interface ILandChannel | 34 | public interface ILandChannel |
35 | { | 35 | { |
36 | |||
37 | float BanLineSafeHeight {get;} | ||
36 | /// <summary> | 38 | /// <summary> |
37 | /// Get all parcels | 39 | /// Get all parcels |
38 | /// </summary> | 40 | /// </summary> |
@@ -97,6 +99,5 @@ namespace OpenSim.Region.Framework.Interfaces | |||
97 | void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id); | 99 | void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id); |
98 | void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id); | 100 | void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id); |
99 | void sendClientInitialLandInfo(IClientAPI remoteClient); | 101 | void sendClientInitialLandInfo(IClientAPI remoteClient); |
100 | |||
101 | } | 102 | } |
102 | } | 103 | } |
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 | |||
37 | { | 37 | { |
38 | #region Constants | 38 | #region Constants |
39 | 39 | ||
40 | public const float BAN_LINE_SAFETY_HEIGHT = 100; | ||
41 | //Land types set with flags in ParcelOverlay. | 40 | //Land types set with flags in ParcelOverlay. |
42 | //Only one of these can be used. | 41 | //Only one of these can be used. |
43 | 42 | ||
44 | |||
45 | //RequestResults (I think these are right, they seem to work): | 43 | //RequestResults (I think these are right, they seem to work): |
46 | public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land | 44 | public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land |
47 | public const int LAND_RESULT_SINGLE = 0; // The request they made contained only a single piece of land | 45 | 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 | |||
77 | private readonly Scene m_scene; | 75 | private readonly Scene m_scene; |
78 | private readonly LandManagementModule m_landManagementModule; | 76 | private readonly LandManagementModule m_landManagementModule; |
79 | 77 | ||
78 | private float m_BanLineSafeHeight = 100.0f; | ||
79 | public float BanLineSafeHeight | ||
80 | { | ||
81 | get | ||
82 | { | ||
83 | return m_BanLineSafeHeight; | ||
84 | } | ||
85 | private set | ||
86 | { | ||
87 | if (value >= 20f && value <= 5000f) | ||
88 | m_BanLineSafeHeight = value; | ||
89 | else | ||
90 | m_BanLineSafeHeight = 100.0f; | ||
91 | } | ||
92 | } | ||
93 | |||
80 | public LandChannel(Scene scene, LandManagementModule landManagementMod) | 94 | public LandChannel(Scene scene, LandManagementModule landManagementMod) |
81 | { | 95 | { |
82 | m_scene = scene; | 96 | m_scene = scene; |
83 | m_landManagementModule = landManagementMod; | 97 | m_landManagementModule = landManagementMod; |
98 | if(landManagementMod != null) | ||
99 | m_BanLineSafeHeight = landManagementMod.BanLineSafeHeight; | ||
84 | } | 100 | } |
85 | 101 | ||
86 | #region ILandChannel Members | 102 | #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 | |||
116 | // "View distance" for sending parcel layer info if asked for from a view point in the region | 116 | // "View distance" for sending parcel layer info if asked for from a view point in the region |
117 | private int parcelLayerViewDistance { get; set; } | 117 | private int parcelLayerViewDistance { get; set; } |
118 | 118 | ||
119 | private float m_BanLineSafeHeight = 100.0f; | ||
120 | public float BanLineSafeHeight | ||
121 | { | ||
122 | get { return m_BanLineSafeHeight; } | ||
123 | private set | ||
124 | { | ||
125 | if (value > 20f && value <= 5000f) | ||
126 | m_BanLineSafeHeight = value; | ||
127 | else | ||
128 | m_BanLineSafeHeight = 100.0f; | ||
129 | } | ||
130 | } | ||
131 | |||
119 | #region INonSharedRegionModule Members | 132 | #region INonSharedRegionModule Members |
120 | 133 | ||
121 | public Type ReplaceableInterface | 134 | public Type ReplaceableInterface |
@@ -137,6 +150,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
137 | bool disablebans = landManagementConfig.GetBoolean("DisableParcelBans", !m_allowedForcefulBans); | 150 | bool disablebans = landManagementConfig.GetBoolean("DisableParcelBans", !m_allowedForcefulBans); |
138 | m_allowedForcefulBans = !disablebans; | 151 | m_allowedForcefulBans = !disablebans; |
139 | m_showBansLines = landManagementConfig.GetBoolean("ShowParcelBansLines", m_showBansLines); | 152 | m_showBansLines = landManagementConfig.GetBoolean("ShowParcelBansLines", m_showBansLines); |
153 | m_BanLineSafeHeight = landManagementConfig.GetFloat("BanLineSafeHeight", m_BanLineSafeHeight); | ||
140 | } | 154 | } |
141 | } | 155 | } |
142 | 156 | ||
@@ -341,7 +355,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
341 | public bool EnforceBans(ILandObject land, ScenePresence avatar) | 355 | public bool EnforceBans(ILandObject land, ScenePresence avatar) |
342 | { | 356 | { |
343 | Vector3 agentpos = avatar.AbsolutePosition; | 357 | Vector3 agentpos = avatar.AbsolutePosition; |
344 | float h = m_scene.GetGroundHeight(agentpos.X, agentpos.Y) + LandChannel.BAN_LINE_SAFETY_HEIGHT; | 358 | float h = m_scene.GetGroundHeight(agentpos.X, agentpos.Y) + m_scene.LandChannel.BanLineSafeHeight; |
345 | float zdif = avatar.AbsolutePosition.Z - h; | 359 | float zdif = avatar.AbsolutePosition.Z - h; |
346 | if (zdif > 0 ) | 360 | if (zdif > 0 ) |
347 | { | 361 | { |
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 | |||
633 | 633 | ||
634 | public bool CanBeOnThisLand(UUID avatar, float posHeight) | 634 | public bool CanBeOnThisLand(UUID avatar, float posHeight) |
635 | { | 635 | { |
636 | if (posHeight < LandChannel.BAN_LINE_SAFETY_HEIGHT && IsBannedFromLand(avatar)) | 636 | if (posHeight < m_scene.LandChannel.BanLineSafeHeight && IsBannedFromLand(avatar)) |
637 | { | 637 | { |
638 | return false; | 638 | return false; |
639 | } | 639 | } |
diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 05db03fe..cb16f55 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs | |||
@@ -42,6 +42,8 @@ namespace OpenSim.Tests.Common | |||
42 | private Scene m_scene; | 42 | private Scene m_scene; |
43 | private List<ILandObject> m_parcels; | 43 | private List<ILandObject> m_parcels; |
44 | 44 | ||
45 | public float BanLineSafeHeight { get { return 100f; } } | ||
46 | |||
45 | public TestLandChannel(Scene scene) | 47 | public TestLandChannel(Scene scene) |
46 | { | 48 | { |
47 | m_scene = scene; | 49 | m_scene = scene; |