aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/ILandObject.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs17
3 files changed, 31 insertions, 0 deletions
diff --git a/OpenSim/Framework/ILandObject.cs b/OpenSim/Framework/ILandObject.cs
index 4f98d7b..7a24d1e 100644
--- a/OpenSim/Framework/ILandObject.cs
+++ b/OpenSim/Framework/ILandObject.cs
@@ -70,6 +70,7 @@ namespace OpenSim.Framework
70 void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client); 70 void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client);
71 bool IsEitherBannedOrRestricted(UUID avatar); 71 bool IsEitherBannedOrRestricted(UUID avatar);
72 bool IsBannedFromLand(UUID avatar); 72 bool IsBannedFromLand(UUID avatar);
73 bool CanBeOnThisLand(UUID avatar, float posHeight);
73 bool IsRestrictedFromLand(UUID avatar); 74 bool IsRestrictedFromLand(UUID avatar);
74 bool IsInLandAccessList(UUID avatar); 75 bool IsInLandAccessList(UUID avatar);
75 void SendLandUpdateToClient(IClientAPI remote_client); 76 void SendLandUpdateToClient(IClientAPI remote_client);
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index d5b2adb..fdac418 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -442,6 +442,19 @@ namespace OpenSim.Region.CoreModules.World.Land
442 return false; 442 return false;
443 } 443 }
444 444
445 public bool CanBeOnThisLand(UUID avatar, float posHeight)
446 {
447 if (posHeight < LandChannel.BAN_LINE_SAFETY_HIEGHT && IsBannedFromLand(avatar))
448 {
449 return false;
450 }
451 else if (IsRestrictedFromLand(avatar))
452 {
453 return false;
454 }
455 return true;
456 }
457
445 public bool HasGroupAccess(UUID avatar) 458 public bool HasGroupAccess(UUID avatar)
446 { 459 {
447 if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) 460 if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index c16c544..5087882 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2247,6 +2247,17 @@ namespace OpenSim.Region.Framework.Scenes
2247 return false; 2247 return false;
2248 } 2248 }
2249 2249
2250
2251 private bool CanEnterLandPosition(Vector3 testPos)
2252 {
2253 ILandObject land = m_scene.LandChannel.GetLandObject(testPos.X, testPos.Y);
2254
2255 if (land == null || land.LandData.Name == "NO_LAND")
2256 return true;
2257
2258 return land.CanBeOnThisLand(UUID,testPos.Z);
2259 }
2260
2250 // status 2261 // status
2251 // < 0 ignore 2262 // < 0 ignore
2252 // 0 bad sit spot 2263 // 0 bad sit spot
@@ -2265,6 +2276,12 @@ namespace OpenSim.Region.Framework.Scenes
2265 if (part == null) 2276 if (part == null)
2266 return; 2277 return;
2267 2278
2279 Vector3 targetPos = part.GetWorldPosition() + offset * part.GetWorldRotation();
2280 if(!CanEnterLandPosition(targetPos))
2281 {
2282 ControllingClient.SendAlertMessage(" Sit position on restricted land, try another spot");
2283 return;
2284 }
2268// m_log.InfoFormat("physsit {0} {1}", offset.ToString(),Orientation.ToString()); 2285// m_log.InfoFormat("physsit {0} {1}", offset.ToString(),Orientation.ToString());
2269 2286
2270 RemoveFromPhysicalScene(); 2287 RemoveFromPhysicalScene();