diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 3cb1901..c43edd2 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -52,15 +52,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
52 | { | 52 | { |
53 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 53 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
54 | 54 | ||
55 | public const int DefaultMaxTransferDistance = 4095; | ||
56 | public const bool WaitForAgentArrivedAtDestinationDefault = true; | 55 | public const bool WaitForAgentArrivedAtDestinationDefault = true; |
57 | 56 | ||
58 | /// <summary> | 57 | /// <summary> |
59 | /// The maximum distance, in standard region units (256m) that an agent is allowed to transfer. | ||
60 | /// </summary> | ||
61 | public int MaxTransferDistance { get; set; } | ||
62 | |||
63 | /// <summary> | ||
64 | /// If true then on a teleport, the source region waits for a callback from the destination region. If | 58 | /// If true then on a teleport, the source region waits for a callback from the destination region. If |
65 | /// a callback fails to arrive within a set time then the user is pulled back into the source region. | 59 | /// a callback fails to arrive within a set time then the user is pulled back into the source region. |
66 | /// </summary> | 60 | /// </summary> |
@@ -118,12 +112,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
118 | { | 112 | { |
119 | WaitForAgentArrivedAtDestination | 113 | WaitForAgentArrivedAtDestination |
120 | = transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault); | 114 | = transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault); |
121 | |||
122 | MaxTransferDistance = transferConfig.GetInt("max_distance", DefaultMaxTransferDistance); | ||
123 | } | ||
124 | else | ||
125 | { | ||
126 | MaxTransferDistance = DefaultMaxTransferDistance; | ||
127 | } | 115 | } |
128 | 116 | ||
129 | m_entityTransferStateMachine = new EntityTransferStateMachine(this); | 117 | m_entityTransferStateMachine = new EntityTransferStateMachine(this); |
@@ -371,26 +359,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
371 | return true; | 359 | return true; |
372 | } | 360 | } |
373 | 361 | ||
374 | /// <summary> | ||
375 | /// Determines whether this instance is within the max transfer distance. | ||
376 | /// </summary> | ||
377 | /// <param name="sourceRegion"></param> | ||
378 | /// <param name="destRegion"></param> | ||
379 | /// <returns> | ||
380 | /// <c>true</c> if this instance is within max transfer distance; otherwise, <c>false</c>. | ||
381 | /// </returns> | ||
382 | private bool IsWithinMaxTeleportDistance(RegionInfo sourceRegion, GridRegion destRegion) | ||
383 | { | ||
384 | // m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Source co-ords are x={0} y={1}", curRegionX, curRegionY); | ||
385 | // | ||
386 | // m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final dest is x={0} y={1} {2}@{3}", | ||
387 | // destRegionX, destRegionY, finalDestination.RegionID, finalDestination.ServerURI); | ||
388 | |||
389 | // Insanely, RegionLoc on RegionInfo is the 256m map co-ord whilst GridRegion.RegionLoc is the raw meters position. | ||
390 | return Math.Abs(sourceRegion.RegionLocX - destRegion.RegionCoordX) <= MaxTransferDistance | ||
391 | && Math.Abs(sourceRegion.RegionLocY - destRegion.RegionCoordY) <= MaxTransferDistance; | ||
392 | } | ||
393 | |||
394 | public void DoTeleport( | 362 | public void DoTeleport( |
395 | ScenePresence sp, GridRegion reg, GridRegion finalDestination, | 363 | ScenePresence sp, GridRegion reg, GridRegion finalDestination, |
396 | Vector3 position, Vector3 lookAt, uint teleportFlags) | 364 | Vector3 position, Vector3 lookAt, uint teleportFlags) |
@@ -421,20 +389,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
421 | 389 | ||
422 | RegionInfo sourceRegion = sp.Scene.RegionInfo; | 390 | RegionInfo sourceRegion = sp.Scene.RegionInfo; |
423 | 391 | ||
424 | if (!IsWithinMaxTeleportDistance(sourceRegion, finalDestination)) | ||
425 | { | ||
426 | sp.ControllingClient.SendTeleportFailed( | ||
427 | string.Format( | ||
428 | "Can't teleport to {0} ({1},{2}) from {3} ({4},{5}), destination is more than {6} regions way", | ||
429 | finalDestination.RegionName, finalDestination.RegionCoordX, finalDestination.RegionCoordY, | ||
430 | sourceRegion.RegionName, sourceRegion.RegionLocX, sourceRegion.RegionLocY, | ||
431 | MaxTransferDistance)); | ||
432 | |||
433 | m_entityTransferStateMachine.ResetFromTransit(sp.UUID); | ||
434 | |||
435 | return; | ||
436 | } | ||
437 | |||
438 | uint newRegionX = (uint)(reg.RegionHandle >> 40); | 392 | uint newRegionX = (uint)(reg.RegionHandle >> 40); |
439 | uint newRegionY = (((uint)(reg.RegionHandle)) >> 8); | 393 | uint newRegionY = (((uint)(reg.RegionHandle)) >> 8); |
440 | uint oldRegionX = (uint)(sp.Scene.RegionInfo.RegionHandle >> 40); | 394 | uint oldRegionX = (uint)(sp.Scene.RegionInfo.RegionHandle >> 40); |