aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2016-11-03 22:15:40 +1000
committerDavid Walter Seikel2016-11-03 22:15:40 +1000
commitb56e2c65b88953ecb29c99d8fec8145a940f0c92 (patch)
tree808a36b4f70da400845ebc18a59e8139b866136f
parentMyISAM is still much better performing for OpenSim. (diff)
downloadopensim-SC-b56e2c65b88953ecb29c99d8fec8145a940f0c92.zip
opensim-SC-b56e2c65b88953ecb29c99d8fec8145a940f0c92.tar.gz
opensim-SC-b56e2c65b88953ecb29c99d8fec8145a940f0c92.tar.bz2
opensim-SC-b56e2c65b88953ecb29c99d8fec8145a940f0c92.tar.xz
No, we don't need to enshrine viewer bugs in the server, we need to fix the viewer, which is half done.
Less to delete this time.
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs45
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs61
2 files changed, 0 insertions, 106 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index a2417c4..1b4b5e6 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>
@@ -220,12 +214,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
220 214
221 WaitForAgentArrivedAtDestination 215 WaitForAgentArrivedAtDestination
222 = transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault); 216 = transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault);
223
224 MaxTransferDistance = transferConfig.GetInt("max_distance", DefaultMaxTransferDistance);
225 }
226 else
227 {
228 MaxTransferDistance = DefaultMaxTransferDistance;
229 } 217 }
230 218
231 m_entityTransferStateMachine = new EntityTransferStateMachine(this); 219 m_entityTransferStateMachine = new EntityTransferStateMachine(this);
@@ -601,28 +589,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
601 return true; 589 return true;
602 } 590 }
603 591
604 /// <summary>
605 /// Determines whether this instance is within the max transfer distance.
606 /// </summary>
607 /// <param name="sourceRegion"></param>
608 /// <param name="destRegion"></param>
609 /// <returns>
610 /// <c>true</c> if this instance is within max transfer distance; otherwise, <c>false</c>.
611 /// </returns>
612 private bool IsWithinMaxTeleportDistance(RegionInfo sourceRegion, GridRegion destRegion)
613 {
614 if(MaxTransferDistance == 0)
615 return true;
616
617// m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Source co-ords are x={0} y={1}", curRegionX, curRegionY);
618//
619// m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final dest is x={0} y={1} {2}@{3}",
620// destRegionX, destRegionY, finalDestination.RegionID, finalDestination.ServerURI);
621
622 // Insanely, RegionLoc on RegionInfo is the 256m map co-ord whilst GridRegion.RegionLoc is the raw meters position.
623 return Math.Abs(sourceRegion.RegionLocX - destRegion.RegionCoordX) <= MaxTransferDistance
624 && Math.Abs(sourceRegion.RegionLocY - destRegion.RegionCoordY) <= MaxTransferDistance;
625 }
626 592
627 /// <summary> 593 /// <summary>
628 /// Wraps DoTeleportInternal() and manages the transfer state. 594 /// Wraps DoTeleportInternal() and manages the transfer state.
@@ -684,17 +650,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
684 650
685 RegionInfo sourceRegion = sp.Scene.RegionInfo; 651 RegionInfo sourceRegion = sp.Scene.RegionInfo;
686 652
687 if (!IsWithinMaxTeleportDistance(sourceRegion, finalDestination))
688 {
689 sp.ControllingClient.SendTeleportFailed(
690 string.Format(
691 "Can't teleport to {0} ({1},{2}) from {3} ({4},{5}), destination is more than {6} regions way",
692 finalDestination.RegionName, finalDestination.RegionCoordX, finalDestination.RegionCoordY,
693 sourceRegion.RegionName, sourceRegion.RegionLocX, sourceRegion.RegionLocY,
694 MaxTransferDistance));
695
696 return;
697 }
698 653
699 uint newRegionX, newRegionY, oldRegionX, oldRegionY; 654 uint newRegionX, newRegionY, oldRegionX, oldRegionY;
700 Util.RegionHandleToRegionLoc(reg.RegionHandle, out newRegionX, out newRegionY); 655 Util.RegionHandleToRegionLoc(reg.RegionHandle, out newRegionX, out newRegionY);
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 9d016fc..5aaba13 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,7 +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 122
125 m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles"); 123 m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles");
126 124
@@ -385,19 +383,6 @@ namespace OpenSim.Services.GridService
385 return true; 383 return true;
386 } 384 }
387 385
388 // We are now performing this check for each individual teleport in the EntityTransferModule instead. This
389 // allows us to give better feedback when teleports fail because of the distance reason (which can't be
390 // done here) and it also hypergrid teleports that are within range (possibly because the source grid
391 // itself has regions that are very far apart).
392// uint x, y;
393// if (m_Check4096 && !Check4096(handle, out x, out y))
394// {
395// //RemoveHyperlinkRegion(regInfo.RegionID);
396// reason = "Region is too far (" + x + ", " + y + ")";
397// m_log.Info("[HYPERGRID LINKER]: Unable to link, region is too far (" + x + ", " + y + ")");
398// //return false;
399// }
400
401 regInfo.RegionID = regionID; 386 regInfo.RegionID = regionID;
402 387
403 if (externalName == string.Empty) 388 if (externalName == string.Empty)
@@ -448,52 +433,6 @@ namespace OpenSim.Services.GridService
448 } 433 }
449 } 434 }
450 435
451// Not currently used
452// /// <summary>
453// /// Cope with this viewer limitation.
454// /// </summary>
455// /// <param name="regInfo"></param>
456// /// <returns></returns>
457// public bool Check4096(ulong realHandle, out uint x, out uint y)
458// {
459// uint ux = 0, uy = 0;
460// Utils.LongToUInts(realHandle, out ux, out uy);
461// x = Util.WorldToRegionLoc(ux);
462// y = Util.WorldToRegionLoc(uy);
463//
464// const uint limit = Util.RegionToWorldLoc(4096 - 1);
465// uint xmin = ux - limit;
466// uint xmax = ux + limit;
467// uint ymin = uy - limit;
468// uint ymax = uy + limit;
469// // World map boundary checks
470// if (xmin < 0 || xmin > ux)
471// xmin = 0;
472// if (xmax > int.MaxValue || xmax < ux)
473// xmax = int.MaxValue;
474// if (ymin < 0 || ymin > uy)
475// ymin = 0;
476// if (ymax > int.MaxValue || ymax < uy)
477// ymax = int.MaxValue;
478//
479// // Check for any regions that are within the possible teleport range to the linked region
480// List<GridRegion> regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax);
481// if (regions.Count == 0)
482// {
483// return false;
484// }
485// else
486// {
487// // Check for regions which are not linked regions
488// List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID);
489// IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
490// if (availableRegions.Count() == 0)
491// return false;
492// }
493//
494// return true;
495// }
496
497 private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle) 436 private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle)
498 { 437 {
499 RegionData rdata = m_GridService.RegionInfo2RegionData(regionInfo); 438 RegionData rdata = m_GridService.RegionInfo2RegionData(regionInfo);