aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs15
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs13
2 files changed, 14 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index f094346..a36d0fe 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -61,8 +61,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
61 set { m_MaxTransferDistance = value; } 61 set { m_MaxTransferDistance = value; }
62 } 62 }
63 63
64 private int m_levelHGTeleport = 0;
65
66 protected bool m_Enabled = false; 64 protected bool m_Enabled = false;
67 protected Scene m_aScene; 65 protected Scene m_aScene;
68 protected List<Scene> m_Scenes = new List<Scene>(); 66 protected List<Scene> m_Scenes = new List<Scene>();
@@ -106,7 +104,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
106 if (transferConfig != null) 104 if (transferConfig != null)
107 { 105 {
108 MaxTransferDistance = transferConfig.GetInt("max_distance", 4095); 106 MaxTransferDistance = transferConfig.GetInt("max_distance", 4095);
109 m_levelHGTeleport = transferConfig.GetInt("LevelHGTeleport", 0);
110 } 107 }
111 108
112 m_agentsInTransit = new List<UUID>(); 109 m_agentsInTransit = new List<UUID>();
@@ -241,16 +238,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
241 238
242 destinationRegionName = finalDestination.RegionName; 239 destinationRegionName = finalDestination.RegionName;
243 240
244 // check if HyperGrid teleport is allowed, based on user level
245 int flags = m_aScene.GridService.GetRegionFlags(sp.Scene.RegionInfo.ScopeID, reg.RegionID);
246
247 if (((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) && (sp.UserLevel < m_levelHGTeleport))
248 {
249 m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Final destination link is non permitted hypergrid region. Unable to teleport agent.");
250 sp.ControllingClient.SendTeleportFailed("HyperGrid teleport not permitted");
251 return;
252 }
253
254 uint curX = 0, curY = 0; 241 uint curX = 0, curY = 0;
255 Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY); 242 Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY);
256 int curCellX = (int)(curX / Constants.RegionSize); 243 int curCellX = (int)(curX / Constants.RegionSize);
@@ -414,7 +401,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
414 bool logout = false; 401 bool logout = false;
415 if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) 402 if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout))
416 { 403 {
417 sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}", 404 sp.ControllingClient.SendTeleportFailed(String.Format("Teleport refused: {0}",
418 reason)); 405 reason));
419 return; 406 return;
420 } 407 }
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 7f9175d..6a92e61 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -50,6 +50,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
51 51
52 private bool m_Initialized = false; 52 private bool m_Initialized = false;
53 private int m_levelHGTeleport = 0;
53 54
54 private GatekeeperServiceConnector m_GatekeeperConnector; 55 private GatekeeperServiceConnector m_GatekeeperConnector;
55 56
@@ -68,6 +69,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
68 string name = moduleConfig.GetString("EntityTransferModule", ""); 69 string name = moduleConfig.GetString("EntityTransferModule", "");
69 if (name == Name) 70 if (name == Name)
70 { 71 {
72 IConfig transferConfig = source.Configs["EntityTransfer"];
73 if (transferConfig != null)
74 m_levelHGTeleport = transferConfig.GetInt("LevelHGTeleport", 0);
75
71 InitialiseCommon(source); 76 InitialiseCommon(source);
72 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name); 77 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name);
73 } 78 }
@@ -164,6 +169,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
164 if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) 169 if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
165 { 170 {
166 // this user is going to another grid 171 // this user is going to another grid
172 // check if HyperGrid teleport is allowed, based on user level
173 if (sp.UserLevel < m_levelHGTeleport)
174 {
175 m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Final destination link is non permitted hypergrid region. Unable to teleport agent.");
176 reason = "HyperGrid teleport not permitted";
177 return false;
178 }
179
167 if (agentCircuit.ServiceURLs.ContainsKey("HomeURI")) 180 if (agentCircuit.ServiceURLs.ContainsKey("HomeURI"))
168 { 181 {
169 string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString(); 182 string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString();