diff options
author | Melanie | 2012-01-26 10:21:45 +0000 |
---|---|---|
committer | Melanie | 2012-01-26 10:21:45 +0000 |
commit | da720ce9be7d050ad2ff26c97490ebd4e17be2cc (patch) | |
tree | b82d31919abb8d7f1582dff95a25b79f75409d06 /OpenSim/Region/Framework | |
parent | Change references from sop to sog and add protection from null ref (diff) | |
download | opensim-SC_OLD-da720ce9be7d050ad2ff26c97490ebd4e17be2cc.zip opensim-SC_OLD-da720ce9be7d050ad2ff26c97490ebd4e17be2cc.tar.gz opensim-SC_OLD-da720ce9be7d050ad2ff26c97490ebd4e17be2cc.tar.bz2 opensim-SC_OLD-da720ce9be7d050ad2ff26c97490ebd4e17be2cc.tar.xz |
Support rejecting a teleport if a user is banned in all parcels that have
spawn points
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f03c345..984058c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -5067,6 +5067,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
5067 | } | 5067 | } |
5068 | } | 5068 | } |
5069 | 5069 | ||
5070 | if (position == Vector3.Zero) // Teleport | ||
5071 | { | ||
5072 | if (!RegionInfo.EstateSettings.AllowDirectTeleport) | ||
5073 | { | ||
5074 | SceneObjectGroup telehub; | ||
5075 | if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero && (telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject)) != null) | ||
5076 | { | ||
5077 | List<SpawnPoint> spawnPoints = RegionInfo.RegionSettings.SpawnPoints(); | ||
5078 | bool banned = true; | ||
5079 | foreach (SpawnPoint sp in spawnPoints) | ||
5080 | { | ||
5081 | Vector3 spawnPoint = sp.GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); | ||
5082 | ILandObject land = LandChannel.GetLandObject(spawnPoint.X, spawnPoint.Y); | ||
5083 | if (land == null) | ||
5084 | continue; | ||
5085 | if (land.IsEitherBannedOrRestricted(agentID)) | ||
5086 | continue; | ||
5087 | banned = false; | ||
5088 | break; | ||
5089 | } | ||
5090 | |||
5091 | if (banned) | ||
5092 | { | ||
5093 | reason = "No suitable landing point found"; | ||
5094 | return false; | ||
5095 | } | ||
5096 | } | ||
5097 | } | ||
5098 | } | ||
5099 | |||
5070 | reason = String.Empty; | 5100 | reason = String.Empty; |
5071 | return true; | 5101 | return true; |
5072 | } | 5102 | } |