From 80b5a95bb8f640efaf61eee810341f5951dfda6a Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 9 Mar 2010 22:29:02 +0000 Subject: Revert "Adds Land Banning." This reverts commit a87d7a12967b50fe83ebbaa7b57e531eb93158a2. --- .../CoreModules/World/Land/LandManagementModule.cs | 130 ++++++++------------- .../Region/CoreModules/World/Land/LandObject.cs | 48 ++------ 2 files changed, 58 insertions(+), 120 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 33d16d5..8c3d17d 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -269,57 +269,20 @@ namespace OpenSim.Region.CoreModules.World.Land return parcelsNear; } - public void KickUserOffOfParcel(ScenePresence avatar) + public void SendYouAreBannedNotice(ScenePresence avatar) { - if (avatar.GodLevel == 0) + if (AllowedForcefulBans) { - List parcelsNear = ParcelsNearPoint(avatar.AbsolutePosition); - foreach (ILandObject check in parcelsNear) - { - if (check.IsEitherBannedOrRestricted(avatar.UUID) != true) - { - Vector3 target = check.LandData.UserLocation; - avatar.TeleportWithMomentum(target); - return; - } - } + avatar.ControllingClient.SendAlertMessage( + "You are not allowed on this parcel because you are banned. Please go away."); + + avatar.PhysicsActor.Position = avatar.lastKnownAllowedPosition; + avatar.PhysicsActor.Velocity = Vector3.Zero; } - } - public void MoveUserOutOfParcel(ScenePresence avatar) - { - if (avatar.GodLevel == 0) + else { - ILandObject land = m_scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); - List parcelsNear = new List(); - - for (int x = -2; x <= 2; x += 2) - { - ILandObject check = GetLandObject(avatar.AbsolutePosition.X + x, avatar.AbsolutePosition.Y); - if (check != null) - { - if (check.IsEitherBannedOrRestricted(avatar.UUID) != true) - { - Vector3 target = new Vector3(avatar.AbsolutePosition.X + x, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); - avatar.TeleportWithMomentum(target); - avatar.Velocity = new Vector3(-avatar.Velocity.X - 5, avatar.Velocity.Y, avatar.Velocity.Z); - return; - } - } - } - for (int y = -2; y <= 2; y += 2) - { - ILandObject check = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y + y); - if (check != null) - { - if (check.IsEitherBannedOrRestricted(avatar.UUID) != true) - { - Vector3 target = new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y + y, avatar.AbsolutePosition.Z); - avatar.TeleportWithMomentum(target); - avatar.Velocity = new Vector3(avatar.Velocity.X, -avatar.Velocity.Y - 5, avatar.Velocity.Z); - return; - } - } - } + avatar.ControllingClient.SendAlertMessage( + "You are not allowed on this parcel because you are banned; however, the grid administrator has disabled ban lines globally. Please obey the land owner's requests or you can be banned from the entire sim!"); } } @@ -339,7 +302,16 @@ namespace OpenSim.Region.CoreModules.World.Land { if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID)) { - MoveUserOutOfParcel(avatar); + SendYouAreBannedNotice(avatar); + } + else if (parcelAvatarIsEntering.IsRestrictedFromLand(avatar.UUID)) + { + avatar.ControllingClient.SendAlertMessage( + "You are not allowed on this parcel because the land owner has restricted access. For now, you can enter, but please respect the land owner's decisions (or he can ban you!)."); + } + else + { + avatar.sentMessageAboutRestrictedParcelFlyingDown = true; } } else @@ -350,47 +322,28 @@ namespace OpenSim.Region.CoreModules.World.Land } } - public void SendOutNearestBanLine(ScenePresence avatar) + public void SendOutNearestBanLine(IClientAPI avatar) { - ILandObject checkBan = null; - for (int x = -2; x <= 2; x += 2) - { - checkBan = GetLandObject(avatar.AbsolutePosition.X + x, avatar.AbsolutePosition.Y); - if (checkBan != null) - { - if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT) - { - if (checkBan.IsRestrictedFromLand(avatar.ControllingClient.AgentId)) - { - checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar.ControllingClient); - return; - } - if (checkBan.IsBannedFromLand(avatar.ControllingClient.AgentId)) - { - checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar.ControllingClient); - return; - } - } - } - } - for (int y = -2; y <= 2; y += 2) + List avatars = m_scene.GetAvatars(); + foreach (ScenePresence presence in avatars) { - checkBan = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y + y); - if (checkBan != null) + if (presence.UUID == avatar.AgentId) { - if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT) + List checkLandParcels = ParcelsNearPoint(presence.AbsolutePosition); + foreach (ILandObject checkBan in checkLandParcels) { - if (checkBan.IsRestrictedFromLand(avatar.ControllingClient.AgentId)) + if (checkBan.IsBannedFromLand(avatar.AgentId)) { - checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar.ControllingClient); - return; + checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar); + return; //Only send one } - if (checkBan.IsBannedFromLand(avatar.ControllingClient.AgentId)) + if (checkBan.IsRestrictedFromLand(avatar.AgentId)) { - checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar.ControllingClient); - return; + checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar); + return; //Only send one } } + return; } } } @@ -437,14 +390,25 @@ namespace OpenSim.Region.CoreModules.World.Land if (clientAvatar != null) { SendLandUpdate(clientAvatar); - SendOutNearestBanLine(clientAvatar); + SendOutNearestBanLine(remote_client); ILandObject parcel = GetLandObject(clientAvatar.AbsolutePosition.X, clientAvatar.AbsolutePosition.Y); if (parcel != null) { if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && + clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) + { + EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.LandData.LocalID, + m_scene.RegionInfo.RegionID); + //They are going under the safety line! + if (!parcel.IsBannedFromLand(clientAvatar.UUID)) + { + clientAvatar.sentMessageAboutRestrictedParcelFlyingDown = false; + } + } + else if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && parcel.IsBannedFromLand(clientAvatar.UUID)) { - MoveUserOutOfParcel(clientAvatar); + SendYouAreBannedNotice(clientAvatar); } } } @@ -492,7 +456,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (land != null) { - if (m_scene.Permissions.CanEditParcel(agentID, land)) + if (agentID == land.LandData.OwnerID) { land.UpdateAccessList(flags, entries, remote_client); } diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 1c65965..1fa8630 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -267,7 +267,11 @@ namespace OpenSim.Region.CoreModules.World.Land public bool IsEitherBannedOrRestricted(UUID avatar) { - if (IsRestrictedFromLand(avatar) || IsBannedFromLand(avatar)) + if (IsBannedFromLand(avatar)) + { + return true; + } + else if (IsRestrictedFromLand(avatar)) { return true; } @@ -276,8 +280,7 @@ namespace OpenSim.Region.CoreModules.World.Land public bool IsBannedFromLand(UUID avatar) { - ScenePresence SP = m_scene.GetScenePresence(avatar); - if ((LandData.Flags & (uint)ParcelFlags.UseBanList) > 0) + if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); entry.AgentID = avatar; @@ -285,22 +288,8 @@ namespace OpenSim.Region.CoreModules.World.Land entry.Time = new DateTime(); if (LandData.ParcelAccessList.Contains(entry)) { - if ((LandData.Flags & (uint)ParcelFlags.UseAccessGroup) > 0) - { - if (LandData.GroupID == SP.ControllingClient.ActiveGroupId) - { - return false; - } - else - { - //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel - return true; - } - } - else - { - return true; - } + //They are banned, so lets send them a notice about this parcel + return true; } } return false; @@ -308,8 +297,7 @@ namespace OpenSim.Region.CoreModules.World.Land public bool IsRestrictedFromLand(UUID avatar) { - ScenePresence SP = m_scene.GetScenePresence(avatar); - if ((LandData.Flags & (uint)ParcelFlags.UseAccessList) > 0) + if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); entry.AgentID = avatar; @@ -317,22 +305,8 @@ namespace OpenSim.Region.CoreModules.World.Land entry.Time = new DateTime(); if (!LandData.ParcelAccessList.Contains(entry)) { - if ((LandData.Flags & (uint)ParcelFlags.UseAccessGroup) > 0) - { - if (LandData.GroupID == SP.ControllingClient.ActiveGroupId) - { - return false; - } - else - { - //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel - return true; - } - } - else - { - return true; - } + //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel + return true; } } return false; -- cgit v1.1