diff options
author | mingchen | 2007-12-20 16:50:16 +0000 |
---|---|---|
committer | mingchen | 2007-12-20 16:50:16 +0000 |
commit | 0e6915ae48e175d3548fbdbb8a42366db1645cc6 (patch) | |
tree | 317162019114aeb18fb7d30c63d9c333407dffac /OpenSim/Region/Environment/LandManagement/LandManager.cs | |
parent | * Cleaned up some code from an earlier commit (diff) | |
download | opensim-SC_OLD-0e6915ae48e175d3548fbdbb8a42366db1645cc6.zip opensim-SC_OLD-0e6915ae48e175d3548fbdbb8a42366db1645cc6.tar.gz opensim-SC_OLD-0e6915ae48e175d3548fbdbb8a42366db1645cc6.tar.bz2 opensim-SC_OLD-0e6915ae48e175d3548fbdbb8a42366db1645cc6.tar.xz |
*Ban lines now work if they are enabled grid wide.
*Restricted lines just give you a friendly warning for now
Diffstat (limited to 'OpenSim/Region/Environment/LandManagement/LandManager.cs')
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/LandManager.cs | 64 |
1 files changed, 57 insertions, 7 deletions
diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs index 310d29b..f984d58 100644 --- a/OpenSim/Region/Environment/LandManagement/LandManager.cs +++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs | |||
@@ -74,6 +74,8 @@ namespace OpenSim.Region.Environment.LandManagement | |||
74 | //These are other constants. Yay! | 74 | //These are other constants. Yay! |
75 | public const int START_LAND_LOCAL_ID = 1; | 75 | public const int START_LAND_LOCAL_ID = 1; |
76 | 76 | ||
77 | public const float BAN_LINE_SAFETY_HIEGHT = 100; | ||
78 | |||
77 | #endregion | 79 | #endregion |
78 | 80 | ||
79 | #region Member Variables | 81 | #region Member Variables |
@@ -90,6 +92,8 @@ namespace OpenSim.Region.Environment.LandManagement | |||
90 | private readonly Scene m_scene; | 92 | private readonly Scene m_scene; |
91 | private readonly RegionInfo m_regInfo; | 93 | private readonly RegionInfo m_regInfo; |
92 | 94 | ||
95 | public bool allowedForcefulBans = true; | ||
96 | |||
93 | #endregion | 97 | #endregion |
94 | 98 | ||
95 | #region Constructors | 99 | #region Constructors |
@@ -590,6 +594,21 @@ namespace OpenSim.Region.Environment.LandManagement | |||
590 | 594 | ||
591 | } | 595 | } |
592 | 596 | ||
597 | public void sendYouAreBannedNotice(ScenePresence avatar) | ||
598 | { | ||
599 | if (allowedForcefulBans) | ||
600 | { | ||
601 | avatar.ControllingClient.SendAlertMessage("You are not allowed on this parcel because you are banned. Please go away. <3 OpenSim Developers"); | ||
602 | |||
603 | avatar.PhysicsActor.Position = new OpenSim.Region.Physics.Manager.PhysicsVector(avatar.lastKnownAllowedPosition.x, avatar.lastKnownAllowedPosition.y, avatar.lastKnownAllowedPosition.z); | ||
604 | avatar.PhysicsActor.Velocity = new OpenSim.Region.Physics.Manager.PhysicsVector(0, 0, 0); | ||
605 | } | ||
606 | else | ||
607 | { | ||
608 | 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! <3 OpenSim Developers"); | ||
609 | } | ||
610 | } | ||
611 | |||
593 | public void handleAvatarChangingParcel(ScenePresence avatar, int localLandID, LLUUID regionID) | 612 | public void handleAvatarChangingParcel(ScenePresence avatar, int localLandID, LLUUID regionID) |
594 | { | 613 | { |
595 | if (m_scene.RegionInfo.RegionID == regionID) | 614 | if (m_scene.RegionInfo.RegionID == regionID) |
@@ -597,20 +616,30 @@ namespace OpenSim.Region.Environment.LandManagement | |||
597 | if (landList[localLandID] != null) | 616 | if (landList[localLandID] != null) |
598 | { | 617 | { |
599 | Land parcelAvatarIsEntering = landList[localLandID]; | 618 | Land parcelAvatarIsEntering = landList[localLandID]; |
600 | if (parcelAvatarIsEntering.isBannedFromLand(avatar.UUID)) | 619 | if (avatar.AbsolutePosition.Z < BAN_LINE_SAFETY_HIEGHT) |
601 | { | 620 | { |
602 | avatar.ControllingClient.SendAlertMessage("You are not allowed on this parcel because you are banned. Please go away. <3 OpenSim Developers"); | 621 | if (parcelAvatarIsEntering.isBannedFromLand(avatar.UUID)) |
603 | 622 | { | |
623 | sendYouAreBannedNotice(avatar); | ||
624 | } | ||
625 | else if (parcelAvatarIsEntering.isRestrictedFromLand(avatar.UUID)) | ||
626 | { | ||
627 | 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!). <3 OpenSim Developers"); | ||
628 | } | ||
629 | else | ||
630 | { | ||
631 | avatar.sentMessageAboutRestrictedParcelFlyingDown = true; | ||
632 | } | ||
604 | } | 633 | } |
605 | else if (parcelAvatarIsEntering.isRestrictedFromLand(avatar.UUID)) | 634 | else |
606 | { | 635 | { |
607 | avatar.ControllingClient.SendAlertMessage("You are not allowed on this parcel because the land owner has restricted access. Please go away. <3 OpenSim Developers"); | 636 | avatar.sentMessageAboutRestrictedParcelFlyingDown = true; |
608 | } | 637 | } |
609 | } | 638 | } |
610 | } | 639 | } |
611 | } | 640 | } |
612 | 641 | ||
613 | public void sendOutBannedNotices(IClientAPI avatar) | 642 | public void sendOutNearestBanLine(IClientAPI avatar) |
614 | { | 643 | { |
615 | 644 | ||
616 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 645 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
@@ -631,6 +660,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
631 | checkBan.sendLandProperties(-40000, false, (int)ParcelManager.ParcelResult.Single, avatar); | 660 | checkBan.sendLandProperties(-40000, false, (int)ParcelManager.ParcelResult.Single, avatar); |
632 | return; //Only send one | 661 | return; //Only send one |
633 | } | 662 | } |
663 | |||
634 | } | 664 | } |
635 | return; | 665 | return; |
636 | } | 666 | } |
@@ -661,13 +691,33 @@ namespace OpenSim.Region.Environment.LandManagement | |||
661 | if (clientAvatar != null) | 691 | if (clientAvatar != null) |
662 | { | 692 | { |
663 | sendLandUpdate(clientAvatar); | 693 | sendLandUpdate(clientAvatar); |
664 | sendOutBannedNotices(remote_client); | 694 | sendOutNearestBanLine(remote_client); |
695 | Land parcel = getLandObject(clientAvatar.AbsolutePosition.X, clientAvatar.AbsolutePosition.Y); | ||
696 | if (clientAvatar.AbsolutePosition.Z < BAN_LINE_SAFETY_HIEGHT && clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) | ||
697 | { | ||
698 | |||
699 | handleAvatarChangingParcel(clientAvatar, parcel.landData.localID, m_scene.RegionInfo.RegionID); //They are going below the safety line! | ||
700 | if (!parcel.isBannedFromLand(clientAvatar.UUID)) | ||
701 | { | ||
702 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown = false; | ||
703 | } | ||
704 | } | ||
705 | else if (clientAvatar.AbsolutePosition.Z < BAN_LINE_SAFETY_HIEGHT && parcel.isBannedFromLand(clientAvatar.UUID)) | ||
706 | { | ||
707 | sendYouAreBannedNotice(clientAvatar); | ||
708 | } | ||
665 | } | 709 | } |
666 | } | 710 | } |
667 | 711 | ||
668 | public void handleAnyClientMovement(ScenePresence avatar) //Like handleSignificantClientMovement, but called with an AgentUpdate regardless of distance. | 712 | public void handleAnyClientMovement(ScenePresence avatar) //Like handleSignificantClientMovement, but called with an AgentUpdate regardless of distance. |
669 | { | 713 | { |
714 | Land over = getLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | ||
715 | if (!over.isBannedFromLand(avatar.UUID) || avatar.AbsolutePosition.Z >= BAN_LINE_SAFETY_HIEGHT) | ||
716 | { | ||
717 | avatar.lastKnownAllowedPosition = new Axiom.Math.Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); | ||
718 | |||
670 | 719 | ||
720 | } | ||
671 | } | 721 | } |
672 | 722 | ||
673 | 723 | ||