aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 2d73594..427a49d 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -60,6 +60,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
60 set { m_MaxTransferDistance = value; } 60 set { m_MaxTransferDistance = value; }
61 } 61 }
62 62
63 private int m_levelHGTeleport = 0;
64
63 protected bool m_Enabled = false; 65 protected bool m_Enabled = false;
64 protected Scene m_aScene; 66 protected Scene m_aScene;
65 protected List<Scene> m_Scenes = new List<Scene>(); 67 protected List<Scene> m_Scenes = new List<Scene>();
@@ -101,7 +103,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
101 { 103 {
102 IConfig transferConfig = source.Configs["EntityTransfer"]; 104 IConfig transferConfig = source.Configs["EntityTransfer"];
103 if (transferConfig != null) 105 if (transferConfig != null)
106 {
104 MaxTransferDistance = transferConfig.GetInt("max_distance", 4095); 107 MaxTransferDistance = transferConfig.GetInt("max_distance", 4095);
108 m_levelHGTeleport = transferConfig.GetInt("LevelHGTeleport", 0);
109 }
105 110
106 m_agentsInTransit = new List<UUID>(); 111 m_agentsInTransit = new List<UUID>();
107 m_Enabled = true; 112 m_Enabled = true;
@@ -227,6 +232,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
227 return; 232 return;
228 } 233 }
229 234
235 // check if HyperGrid teleport is allowed, based on user level
236 int flags = m_aScene.GridService.GetRegionFlags(sp.Scene.RegionInfo.ScopeID, reg.RegionID);
237
238 if (((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) && (sp.UserLevel < m_levelHGTeleport))
239 {
240 m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Final destination link is non permitted hypergrid region. Unable to teleport agent.");
241 sp.ControllingClient.SendTeleportFailed("HyperGrid teleport not permitted");
242 return;
243 }
244
230 uint curX = 0, curY = 0; 245 uint curX = 0, curY = 0;
231 Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY); 246 Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY);
232 int curCellX = (int)(curX / Constants.RegionSize); 247 int curCellX = (int)(curX / Constants.RegionSize);