From c0c153d09340c117aea2f06ecbdd288ee017bd8e Mon Sep 17 00:00:00 2001
From: David Walter Seikel
Date: Sat, 23 Feb 2013 07:23:24 +1000
Subject: No, we don't need to enshrine viewer bugs in the server, we need to
fix the viewer, which is half done.
---
.../EntityTransfer/EntityTransferModule.cs | 46 ----------------
OpenSim/Services/GridService/HypergridLinker.cs | 62 ----------------------
bin/OpenSimDefaults.ini | 4 --
bin/Robust.HG.ini.example | 3 --
4 files changed, 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
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- public const int DefaultMaxTransferDistance = 4095;
public const bool WaitForAgentArrivedAtDestinationDefault = true;
///
- /// The maximum distance, in standard region units (256m) that an agent is allowed to transfer.
- ///
- public int MaxTransferDistance { get; set; }
-
- ///
/// If true then on a teleport, the source region waits for a callback from the destination region. If
/// a callback fails to arrive within a set time then the user is pulled back into the source region.
///
@@ -118,12 +112,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{
WaitForAgentArrivedAtDestination
= transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault);
-
- MaxTransferDistance = transferConfig.GetInt("max_distance", DefaultMaxTransferDistance);
- }
- else
- {
- MaxTransferDistance = DefaultMaxTransferDistance;
}
m_entityTransferStateMachine = new EntityTransferStateMachine(this);
@@ -371,26 +359,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return true;
}
- ///
- /// Determines whether this instance is within the max transfer distance.
- ///
- ///
- ///
- ///
- /// true if this instance is within max transfer distance; otherwise, false.
- ///
- private bool IsWithinMaxTeleportDistance(RegionInfo sourceRegion, GridRegion destRegion)
- {
-// m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Source co-ords are x={0} y={1}", curRegionX, curRegionY);
-//
-// m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final dest is x={0} y={1} {2}@{3}",
-// destRegionX, destRegionY, finalDestination.RegionID, finalDestination.ServerURI);
-
- // Insanely, RegionLoc on RegionInfo is the 256m map co-ord whilst GridRegion.RegionLoc is the raw meters position.
- return Math.Abs(sourceRegion.RegionLocX - destRegion.RegionCoordX) <= MaxTransferDistance
- && Math.Abs(sourceRegion.RegionLocY - destRegion.RegionCoordY) <= MaxTransferDistance;
- }
-
public void DoTeleport(
ScenePresence sp, GridRegion reg, GridRegion finalDestination,
Vector3 position, Vector3 lookAt, uint teleportFlags)
@@ -421,20 +389,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
RegionInfo sourceRegion = sp.Scene.RegionInfo;
- if (!IsWithinMaxTeleportDistance(sourceRegion, finalDestination))
- {
- sp.ControllingClient.SendTeleportFailed(
- string.Format(
- "Can't teleport to {0} ({1},{2}) from {3} ({4},{5}), destination is more than {6} regions way",
- finalDestination.RegionName, finalDestination.RegionCoordX, finalDestination.RegionCoordY,
- sourceRegion.RegionName, sourceRegion.RegionLocX, sourceRegion.RegionLocY,
- MaxTransferDistance));
-
- m_entityTransferStateMachine.ResetFromTransit(sp.UUID);
-
- return;
- }
-
uint newRegionX = (uint)(reg.RegionHandle >> 40);
uint newRegionY = (((uint)(reg.RegionHandle)) >> 8);
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
protected GatekeeperServiceConnector m_GatekeeperConnector;
protected UUID m_ScopeID = UUID.Zero;
-// protected bool m_Check4096 = true;
protected string m_MapTileDirectory = string.Empty;
protected string m_ThisGatekeeper = string.Empty;
protected Uri m_ThisGatekeeperURI = null;
@@ -124,8 +123,6 @@ namespace OpenSim.Services.GridService
if (scope != string.Empty)
UUID.TryParse(scope, out m_ScopeID);
-// m_Check4096 = gridConfig.GetBoolean("Check4096", true);
-
m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles");
m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty);
@@ -349,19 +346,6 @@ namespace OpenSim.Services.GridService
return true;
}
- // We are now performing this check for each individual teleport in the EntityTransferModule instead. This
- // allows us to give better feedback when teleports fail because of the distance reason (which can't be
- // done here) and it also hypergrid teleports that are within range (possibly because the source grid
- // itself has regions that are very far apart).
-// uint x, y;
-// if (m_Check4096 && !Check4096(handle, out x, out y))
-// {
-// //RemoveHyperlinkRegion(regInfo.RegionID);
-// reason = "Region is too far (" + x + ", " + y + ")";
-// m_log.Info("[HYPERGRID LINKER]: Unable to link, region is too far (" + x + ", " + y + ")");
-// //return false;
-// }
-
regInfo.RegionID = regionID;
if (externalName == string.Empty)
@@ -411,52 +395,6 @@ namespace OpenSim.Services.GridService
}
}
-// Not currently used
-// ///
-// /// Cope with this viewer limitation.
-// ///
-// ///
-// ///
-// public bool Check4096(ulong realHandle, out uint x, out uint y)
-// {
-// uint ux = 0, uy = 0;
-// Utils.LongToUInts(realHandle, out ux, out uy);
-// x = ux / Constants.RegionSize;
-// y = uy / Constants.RegionSize;
-//
-// const uint limit = (4096 - 1) * Constants.RegionSize;
-// uint xmin = ux - limit;
-// uint xmax = ux + limit;
-// uint ymin = uy - limit;
-// uint ymax = uy + limit;
-// // World map boundary checks
-// if (xmin < 0 || xmin > ux)
-// xmin = 0;
-// if (xmax > int.MaxValue || xmax < ux)
-// xmax = int.MaxValue;
-// if (ymin < 0 || ymin > uy)
-// ymin = 0;
-// if (ymax > int.MaxValue || ymax < uy)
-// ymax = int.MaxValue;
-//
-// // Check for any regions that are within the possible teleport range to the linked region
-// List regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax);
-// if (regions.Count == 0)
-// {
-// return false;
-// }
-// else
-// {
-// // Check for regions which are not linked regions
-// List hyperlinks = m_GridService.GetHyperlinks(m_ScopeID);
-// IEnumerable availableRegions = regions.Except(hyperlinks);
-// if (availableRegions.Count() == 0)
-// return false;
-// }
-//
-// return true;
-// }
-
private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle)
{
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 @@
[EntityTransfer]
- ; The maximum distance in regions that an agent is allowed to teleport along the x or y axis
- ; This is set to 4095 because current viewers can't handle teleports that are greater than this distance
- max_distance = 4095
-
; Minimum user level required for HyperGrid teleports
LevelHGTeleport = 0
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
; Realm = "regions"
; AllowDuplicateNames = "True"
- ;; Perform distance check for the creation of a linked region
- ; Check4096 = "True"
-
;; Needed to display non-default map tile images for linked regions
AssetService = "OpenSim.Services.AssetService.dll:AssetService"
--
cgit v1.1