diff options
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 47 | ||||
-rw-r--r-- | OpenSim/Services/GridService/HypergridLinker.cs | 62 |
2 files changed, 0 insertions, 109 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 2334e0b..9ce6201 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -54,15 +54,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
55 | private static readonly string LogHeader = "[ENTITY TRANSFER MODULE]"; | 55 | private static readonly string LogHeader = "[ENTITY TRANSFER MODULE]"; |
56 | 56 | ||
57 | public const int DefaultMaxTransferDistance = 4095; | ||
58 | public const bool WaitForAgentArrivedAtDestinationDefault = true; | 57 | public const bool WaitForAgentArrivedAtDestinationDefault = true; |
59 | 58 | ||
60 | /// <summary> | 59 | /// <summary> |
61 | /// The maximum distance, in standard region units (256m) that an agent is allowed to transfer. | ||
62 | /// </summary> | ||
63 | public int MaxTransferDistance { get; set; } | ||
64 | |||
65 | /// <summary> | ||
66 | /// If true then on a teleport, the source region waits for a callback from the destination region. If | 60 | /// If true then on a teleport, the source region waits for a callback from the destination region. If |
67 | /// a callback fails to arrive within a set time then the user is pulled back into the source region. | 61 | /// a callback fails to arrive within a set time then the user is pulled back into the source region. |
68 | /// </summary> | 62 | /// </summary> |
@@ -226,12 +220,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
226 | 220 | ||
227 | WaitForAgentArrivedAtDestination | 221 | WaitForAgentArrivedAtDestination |
228 | = transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault); | 222 | = transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault); |
229 | |||
230 | MaxTransferDistance = transferConfig.GetInt("max_distance", DefaultMaxTransferDistance); | ||
231 | } | ||
232 | else | ||
233 | { | ||
234 | MaxTransferDistance = DefaultMaxTransferDistance; | ||
235 | } | 223 | } |
236 | 224 | ||
237 | m_entityTransferStateMachine = new EntityTransferStateMachine(this); | 225 | m_entityTransferStateMachine = new EntityTransferStateMachine(this); |
@@ -639,29 +627,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
639 | } | 627 | } |
640 | 628 | ||
641 | /// <summary> | 629 | /// <summary> |
642 | /// Determines whether this instance is within the max transfer distance. | ||
643 | /// </summary> | ||
644 | /// <param name="sourceRegion"></param> | ||
645 | /// <param name="destRegion"></param> | ||
646 | /// <returns> | ||
647 | /// <c>true</c> if this instance is within max transfer distance; otherwise, <c>false</c>. | ||
648 | /// </returns> | ||
649 | private bool IsWithinMaxTeleportDistance(RegionInfo sourceRegion, GridRegion destRegion) | ||
650 | { | ||
651 | if(MaxTransferDistance == 0) | ||
652 | return true; | ||
653 | |||
654 | // m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Source co-ords are x={0} y={1}", curRegionX, curRegionY); | ||
655 | // | ||
656 | // m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final dest is x={0} y={1} {2}@{3}", | ||
657 | // destRegionX, destRegionY, finalDestination.RegionID, finalDestination.ServerURI); | ||
658 | |||
659 | // Insanely, RegionLoc on RegionInfo is the 256m map co-ord whilst GridRegion.RegionLoc is the raw meters position. | ||
660 | return Math.Abs(sourceRegion.RegionLocX - destRegion.RegionCoordX) <= MaxTransferDistance | ||
661 | && Math.Abs(sourceRegion.RegionLocY - destRegion.RegionCoordY) <= MaxTransferDistance; | ||
662 | } | ||
663 | |||
664 | /// <summary> | ||
665 | /// Wraps DoTeleportInternal() and manages the transfer state. | 630 | /// Wraps DoTeleportInternal() and manages the transfer state. |
666 | /// </summary> | 631 | /// </summary> |
667 | public void DoTeleport( | 632 | public void DoTeleport( |
@@ -721,18 +686,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
721 | 686 | ||
722 | RegionInfo sourceRegion = sp.Scene.RegionInfo; | 687 | RegionInfo sourceRegion = sp.Scene.RegionInfo; |
723 | 688 | ||
724 | if (!IsWithinMaxTeleportDistance(sourceRegion, finalDestination)) | ||
725 | { | ||
726 | sp.ControllingClient.SendTeleportFailed( | ||
727 | string.Format( | ||
728 | "Can't teleport to {0} ({1},{2}) from {3} ({4},{5}), destination is more than {6} regions way", | ||
729 | finalDestination.RegionName, finalDestination.RegionCoordX, finalDestination.RegionCoordY, | ||
730 | sourceRegion.RegionName, sourceRegion.RegionLocX, sourceRegion.RegionLocY, | ||
731 | MaxTransferDistance)); | ||
732 | |||
733 | return; | ||
734 | } | ||
735 | |||
736 | ulong destinationHandle = finalDestination.RegionHandle; | 689 | ulong destinationHandle = finalDestination.RegionHandle; |
737 | 690 | ||
738 | // Let's do DNS resolution only once in this process, please! | 691 | // Let's do DNS resolution only once in this process, please! |
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 67114ef..bd68056 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs | |||
@@ -63,7 +63,6 @@ namespace OpenSim.Services.GridService | |||
63 | protected GatekeeperServiceConnector m_GatekeeperConnector; | 63 | protected GatekeeperServiceConnector m_GatekeeperConnector; |
64 | 64 | ||
65 | protected UUID m_ScopeID = UUID.Zero; | 65 | protected UUID m_ScopeID = UUID.Zero; |
66 | // protected bool m_Check4096 = true; | ||
67 | protected string m_MapTileDirectory = string.Empty; | 66 | protected string m_MapTileDirectory = string.Empty; |
68 | protected string m_ThisGatekeeper = string.Empty; | 67 | protected string m_ThisGatekeeper = string.Empty; |
69 | protected Uri m_ThisGatekeeperURI = null; | 68 | protected Uri m_ThisGatekeeperURI = null; |
@@ -120,8 +119,6 @@ namespace OpenSim.Services.GridService | |||
120 | if (scope != string.Empty) | 119 | if (scope != string.Empty) |
121 | UUID.TryParse(scope, out m_ScopeID); | 120 | UUID.TryParse(scope, out m_ScopeID); |
122 | 121 | ||
123 | // m_Check4096 = gridConfig.GetBoolean("Check4096", true); | ||
124 | |||
125 | //// TODO OpenSim is crazy, this is called from Robust and OpenSim, Robust needs the ../caches bit, OpenSim somehow adds a path already. I can't tell why. So strip the path. | 122 | //// TODO OpenSim is crazy, this is called from Robust and OpenSim, Robust needs the ../caches bit, OpenSim somehow adds a path already. I can't tell why. So strip the path. |
126 | m_MapTileDirectory = Path.Combine(Util.cacheDir(), Path.GetFileName(gridConfig.GetString("MapTileDirectory", "maptiles"))); | 123 | m_MapTileDirectory = Path.Combine(Util.cacheDir(), Path.GetFileName(gridConfig.GetString("MapTileDirectory", "maptiles"))); |
127 | 124 | ||
@@ -337,19 +334,6 @@ namespace OpenSim.Services.GridService | |||
337 | return true; | 334 | return true; |
338 | } | 335 | } |
339 | 336 | ||
340 | // We are now performing this check for each individual teleport in the EntityTransferModule instead. This | ||
341 | // allows us to give better feedback when teleports fail because of the distance reason (which can't be | ||
342 | // done here) and it also hypergrid teleports that are within range (possibly because the source grid | ||
343 | // itself has regions that are very far apart). | ||
344 | // uint x, y; | ||
345 | // if (m_Check4096 && !Check4096(handle, out x, out y)) | ||
346 | // { | ||
347 | // //RemoveHyperlinkRegion(regInfo.RegionID); | ||
348 | // reason = "Region is too far (" + x + ", " + y + ")"; | ||
349 | // m_log.Info("[HYPERGRID LINKER]: Unable to link, region is too far (" + x + ", " + y + ")"); | ||
350 | // //return false; | ||
351 | // } | ||
352 | |||
353 | regInfo.RegionID = regionID; | 337 | regInfo.RegionID = regionID; |
354 | regInfo.RegionSizeX = sizeX; | 338 | regInfo.RegionSizeX = sizeX; |
355 | regInfo.RegionSizeY = sizeY; | 339 | regInfo.RegionSizeY = sizeY; |
@@ -402,52 +386,6 @@ namespace OpenSim.Services.GridService | |||
402 | } | 386 | } |
403 | } | 387 | } |
404 | 388 | ||
405 | // Not currently used | ||
406 | // /// <summary> | ||
407 | // /// Cope with this viewer limitation. | ||
408 | // /// </summary> | ||
409 | // /// <param name="regInfo"></param> | ||
410 | // /// <returns></returns> | ||
411 | // public bool Check4096(ulong realHandle, out uint x, out uint y) | ||
412 | // { | ||
413 | // uint ux = 0, uy = 0; | ||
414 | // Utils.LongToUInts(realHandle, out ux, out uy); | ||
415 | // x = Util.WorldToRegionLoc(ux); | ||
416 | // y = Util.WorldToRegionLoc(uy); | ||
417 | // | ||
418 | // const uint limit = Util.RegionToWorldLoc(4096 - 1); | ||
419 | // uint xmin = ux - limit; | ||
420 | // uint xmax = ux + limit; | ||
421 | // uint ymin = uy - limit; | ||
422 | // uint ymax = uy + limit; | ||
423 | // // World map boundary checks | ||
424 | // if (xmin < 0 || xmin > ux) | ||
425 | // xmin = 0; | ||
426 | // if (xmax > int.MaxValue || xmax < ux) | ||
427 | // xmax = int.MaxValue; | ||
428 | // if (ymin < 0 || ymin > uy) | ||
429 | // ymin = 0; | ||
430 | // if (ymax > int.MaxValue || ymax < uy) | ||
431 | // ymax = int.MaxValue; | ||
432 | // | ||
433 | // // Check for any regions that are within the possible teleport range to the linked region | ||
434 | // List<GridRegion> regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax); | ||
435 | // if (regions.Count == 0) | ||
436 | // { | ||
437 | // return false; | ||
438 | // } | ||
439 | // else | ||
440 | // { | ||
441 | // // Check for regions which are not linked regions | ||
442 | // List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID); | ||
443 | // IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks); | ||
444 | // if (availableRegions.Count() == 0) | ||
445 | // return false; | ||
446 | // } | ||
447 | // | ||
448 | // return true; | ||
449 | // } | ||
450 | |||
451 | private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle) | 389 | private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle) |
452 | { | 390 | { |
453 | RegionData rdata = m_GridService.RegionInfo2RegionData(regionInfo); | 391 | RegionData rdata = m_GridService.RegionInfo2RegionData(regionInfo); |