aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs16
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs5
3 files changed, 15 insertions, 19 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index e640733..903009e 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>();
@@ -216,6 +213,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
216 213
217 sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags); 214 sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags);
218 sp.TeleportFlags = (Constants.TeleportFlags)teleportFlags; 215 sp.TeleportFlags = (Constants.TeleportFlags)teleportFlags;
216 sp.Velocity = Vector3.Zero;
219 sp.Teleport(position); 217 sp.Teleport(position);
220 218
221 foreach (SceneObjectGroup grp in sp.GetAttachments()) 219 foreach (SceneObjectGroup grp in sp.GetAttachments())
@@ -241,16 +239,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
241 239
242 destinationRegionName = finalDestination.RegionName; 240 destinationRegionName = finalDestination.RegionName;
243 241
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; 242 uint curX = 0, curY = 0;
255 Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY); 243 Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY);
256 int curCellX = (int)(curX / Constants.RegionSize); 244 int curCellX = (int)(curX / Constants.RegionSize);
@@ -414,7 +402,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
414 bool logout = false; 402 bool logout = false;
415 if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) 403 if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout))
416 { 404 {
417 sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}", 405 sp.ControllingClient.SendTeleportFailed(String.Format("Teleport refused: {0}",
418 reason)); 406 reason));
419 return; 407 return;
420 } 408 }
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 8b5ad23..93c5773 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("[HG ENTITY TRANSFER MODULE]: Unable to HG teleport agent due to insufficient UserLevel.");
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();
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9e60c88..ebfc1bd 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1068,11 +1068,6 @@ namespace OpenSim.Region.Framework.Scenes
1068 TeleportWithMomentum(pos, Vector3.Zero); 1068 TeleportWithMomentum(pos, Vector3.Zero);
1069 } 1069 }
1070 1070
1071 public void TeleportWithMomentum(Vector3 pos)
1072 {
1073 TeleportWithMomentum(pos, null);
1074 }
1075
1076 public void TeleportWithMomentum(Vector3 pos, Vector3? v) 1071 public void TeleportWithMomentum(Vector3 pos, Vector3? v)
1077 { 1072 {
1078 bool isFlying = Flying; 1073 bool isFlying = Flying;