diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 7005c0a..eff24f8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3751,6 +3751,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3751 | RegionInfo.RegionSettings.TelehubObject, acd.Name, Name); | 3751 | RegionInfo.RegionSettings.TelehubObject, acd.Name, Name); |
3752 | } | 3752 | } |
3753 | 3753 | ||
3754 | // Final permissions check; this time we don't allow changing the position | ||
3755 | if (!IsPositionAllowed(acd.AgentID, acd.startpos, ref reason)) | ||
3756 | { | ||
3757 | m_authenticateHandler.RemoveCircuit(acd.circuitcode); | ||
3758 | return false; | ||
3759 | } | ||
3760 | |||
3754 | return true; | 3761 | return true; |
3755 | } | 3762 | } |
3756 | 3763 | ||
@@ -3760,6 +3767,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3760 | if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero) | 3767 | if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero) |
3761 | { | 3768 | { |
3762 | acd.startpos = land.LandData.UserLocation; | 3769 | acd.startpos = land.LandData.UserLocation; |
3770 | |||
3771 | // Final permissions check; this time we don't allow changing the position | ||
3772 | if (!IsPositionAllowed(acd.AgentID, acd.startpos, ref reason)) | ||
3773 | { | ||
3774 | m_authenticateHandler.RemoveCircuit(acd.circuitcode); | ||
3775 | return false; | ||
3776 | } | ||
3763 | } | 3777 | } |
3764 | } | 3778 | } |
3765 | } | 3779 | } |
@@ -3767,6 +3781,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
3767 | return true; | 3781 | return true; |
3768 | } | 3782 | } |
3769 | 3783 | ||
3784 | private bool IsPositionAllowed(UUID agentID, Vector3 pos, ref string reason) | ||
3785 | { | ||
3786 | ILandObject land = LandChannel.GetLandObject(pos); | ||
3787 | if (land == null) | ||
3788 | return true; | ||
3789 | |||
3790 | if (land.IsBannedFromLand(agentID) || land.IsRestrictedFromLand(agentID)) | ||
3791 | { | ||
3792 | reason = "You are banned from the region."; | ||
3793 | return false; | ||
3794 | } | ||
3795 | |||
3796 | return true; | ||
3797 | } | ||
3798 | |||
3770 | public bool TestLandRestrictions(UUID agentID, out string reason, ref float posX, ref float posY) | 3799 | public bool TestLandRestrictions(UUID agentID, out string reason, ref float posX, ref float posY) |
3771 | { | 3800 | { |
3772 | if (posX < 0) | 3801 | if (posX < 0) |
@@ -5153,7 +5182,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5153 | Vector3? nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel); | 5182 | Vector3? nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel); |
5154 | if (nearestPoint != null) | 5183 | if (nearestPoint != null) |
5155 | { | 5184 | { |
5156 | Debug.WriteLine("Found a sane previous position based on velocity, sending them to: " + nearestPoint.ToString()); | 5185 | m_log.Debug("Found a sane previous position based on velocity, sending them to: " + nearestPoint.ToString()); |
5157 | return nearestPoint.Value; | 5186 | return nearestPoint.Value; |
5158 | } | 5187 | } |
5159 | 5188 | ||
@@ -5163,7 +5192,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5163 | nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel); | 5192 | nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel); |
5164 | if (nearestPoint != null) | 5193 | if (nearestPoint != null) |
5165 | { | 5194 | { |
5166 | Debug.WriteLine("They had a zero velocity, sending them to: " + nearestPoint.ToString()); | 5195 | m_log.Debug("They had a zero velocity, sending them to: " + nearestPoint.ToString()); |
5167 | return nearestPoint.Value; | 5196 | return nearestPoint.Value; |
5168 | } | 5197 | } |
5169 | 5198 | ||
@@ -5172,7 +5201,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5172 | { | 5201 | { |
5173 | // Ultimate backup if we have no idea where they are and | 5202 | // Ultimate backup if we have no idea where they are and |
5174 | // the last allowed position was in another parcel | 5203 | // the last allowed position was in another parcel |
5175 | Debug.WriteLine("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString()); | 5204 | m_log.Debug("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString()); |
5176 | return avatar.lastKnownAllowedPosition; | 5205 | return avatar.lastKnownAllowedPosition; |
5177 | } | 5206 | } |
5178 | 5207 | ||
@@ -5182,7 +5211,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5182 | //Go to the edge, this happens in teleporting to a region with no available parcels | 5211 | //Go to the edge, this happens in teleporting to a region with no available parcels |
5183 | Vector3 nearestRegionEdgePoint = GetNearestRegionEdgePosition(avatar); | 5212 | Vector3 nearestRegionEdgePoint = GetNearestRegionEdgePosition(avatar); |
5184 | 5213 | ||
5185 | //Debug.WriteLine("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString()); | 5214 | //m_log.Debug("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString()); |
5186 | 5215 | ||
5187 | return nearestRegionEdgePoint; | 5216 | return nearestRegionEdgePoint; |
5188 | } | 5217 | } |