diff options
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 46 | ||||
-rw-r--r-- | OpenSim/Services/GridService/HypergridLinker.cs | 62 | ||||
-rw-r--r-- | bin/OpenSimDefaults.ini | 4 | ||||
-rw-r--r-- | bin/Robust.HG.ini.example | 3 |
4 files changed, 0 insertions, 115 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); |
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 743d089..7abed20 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; |
@@ -124,8 +123,6 @@ namespace OpenSim.Services.GridService | |||
124 | if (scope != string.Empty) | 123 | if (scope != string.Empty) |
125 | UUID.TryParse(scope, out m_ScopeID); | 124 | UUID.TryParse(scope, out m_ScopeID); |
126 | 125 | ||
127 | // m_Check4096 = gridConfig.GetBoolean("Check4096", true); | ||
128 | |||
129 | m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles"); | 126 | m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles"); |
130 | 127 | ||
131 | m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty); | 128 | m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty); |
@@ -349,19 +346,6 @@ namespace OpenSim.Services.GridService | |||
349 | return true; | 346 | return true; |
350 | } | 347 | } |
351 | 348 | ||
352 | // We are now performing this check for each individual teleport in the EntityTransferModule instead. This | ||
353 | // allows us to give better feedback when teleports fail because of the distance reason (which can't be | ||
354 | // done here) and it also hypergrid teleports that are within range (possibly because the source grid | ||
355 | // itself has regions that are very far apart). | ||
356 | // uint x, y; | ||
357 | // if (m_Check4096 && !Check4096(handle, out x, out y)) | ||
358 | // { | ||
359 | // //RemoveHyperlinkRegion(regInfo.RegionID); | ||
360 | // reason = "Region is too far (" + x + ", " + y + ")"; | ||
361 | // m_log.Info("[HYPERGRID LINKER]: Unable to link, region is too far (" + x + ", " + y + ")"); | ||
362 | // //return false; | ||
363 | // } | ||
364 | |||
365 | regInfo.RegionID = regionID; | 349 | regInfo.RegionID = regionID; |
366 | 350 | ||
367 | if (externalName == string.Empty) | 351 | if (externalName == string.Empty) |
@@ -411,52 +395,6 @@ namespace OpenSim.Services.GridService | |||
411 | } | 395 | } |
412 | } | 396 | } |
413 | 397 | ||
414 | // Not currently used | ||
415 | // /// <summary> | ||
416 | // /// Cope with this viewer limitation. | ||
417 | // /// </summary> | ||
418 | // /// <param name="regInfo"></param> | ||
419 | // /// <returns></returns> | ||
420 | // public bool Check4096(ulong realHandle, out uint x, out uint y) | ||
421 | // { | ||
422 | // uint ux = 0, uy = 0; | ||
423 | // Utils.LongToUInts(realHandle, out ux, out uy); | ||
424 | // x = ux / Constants.RegionSize; | ||
425 | // y = uy / Constants.RegionSize; | ||
426 | // | ||
427 | // const uint limit = (4096 - 1) * Constants.RegionSize; | ||
428 | // uint xmin = ux - limit; | ||
429 | // uint xmax = ux + limit; | ||
430 | // uint ymin = uy - limit; | ||
431 | // uint ymax = uy + limit; | ||
432 | // // World map boundary checks | ||
433 | // if (xmin < 0 || xmin > ux) | ||
434 | // xmin = 0; | ||
435 | // if (xmax > int.MaxValue || xmax < ux) | ||
436 | // xmax = int.MaxValue; | ||
437 | // if (ymin < 0 || ymin > uy) | ||
438 | // ymin = 0; | ||
439 | // if (ymax > int.MaxValue || ymax < uy) | ||
440 | // ymax = int.MaxValue; | ||
441 | // | ||
442 | // // Check for any regions that are within the possible teleport range to the linked region | ||
443 | // List<GridRegion> regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax); | ||
444 | // if (regions.Count == 0) | ||
445 | // { | ||
446 | // return false; | ||
447 | // } | ||
448 | // else | ||
449 | // { | ||
450 | // // Check for regions which are not linked regions | ||
451 | // List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID); | ||
452 | // IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks); | ||
453 | // if (availableRegions.Count() == 0) | ||
454 | // return false; | ||
455 | // } | ||
456 | // | ||
457 | // return true; | ||
458 | // } | ||
459 | |||
460 | private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle) | 398 | private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle) |
461 | { | 399 | { |
462 | RegionData rdata = m_GridService.RegionInfo2RegionData(regionInfo); | 400 | RegionData rdata = m_GridService.RegionInfo2RegionData(regionInfo); |
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 74bae01..fbb0dd4 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini | |||
@@ -623,10 +623,6 @@ | |||
623 | 623 | ||
624 | 624 | ||
625 | [EntityTransfer] | 625 | [EntityTransfer] |
626 | ; The maximum distance in regions that an agent is allowed to teleport along the x or y axis | ||
627 | ; This is set to 4095 because current viewers can't handle teleports that are greater than this distance | ||
628 | max_distance = 4095 | ||
629 | |||
630 | ; Minimum user level required for HyperGrid teleports | 626 | ; Minimum user level required for HyperGrid teleports |
631 | LevelHGTeleport = 0 | 627 | LevelHGTeleport = 0 |
632 | 628 | ||
diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index c7d4b7f..0d6d075 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example | |||
@@ -129,9 +129,6 @@ HGAssetServiceConnector = "HGAssetService@8002/OpenSim.Server.Handlers.dll:Asset | |||
129 | ; Realm = "regions" | 129 | ; Realm = "regions" |
130 | ; AllowDuplicateNames = "True" | 130 | ; AllowDuplicateNames = "True" |
131 | 131 | ||
132 | ;; Perform distance check for the creation of a linked region | ||
133 | ; Check4096 = "True" | ||
134 | |||
135 | ;; Needed to display non-default map tile images for linked regions | 132 | ;; Needed to display non-default map tile images for linked regions |
136 | AssetService = "OpenSim.Services.AssetService.dll:AssetService" | 133 | AssetService = "OpenSim.Services.AssetService.dll:AssetService" |
137 | 134 | ||