aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/GridService
diff options
context:
space:
mode:
authorroot2011-06-30 00:26:03 +0100
committerroot2011-06-30 00:26:03 +0100
commit5f927dc104aac48707c0ea2ff77a3410c3857ecc (patch)
tree123324ae910db49349e7b07749f49cd172a3d037 /OpenSim/Services/GridService
parentRemove friends debug spam (diff)
parentDon't follow inventory links of links. (diff)
downloadopensim-SC-5f927dc104aac48707c0ea2ff77a3410c3857ecc.zip
opensim-SC-5f927dc104aac48707c0ea2ff77a3410c3857ecc.tar.gz
opensim-SC-5f927dc104aac48707c0ea2ff77a3410c3857ecc.tar.bz2
opensim-SC-5f927dc104aac48707c0ea2ff77a3410c3857ecc.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Services/GridService')
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs115
1 files changed, 59 insertions, 56 deletions
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 6d63748..186ca71 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -63,7 +63,7 @@ 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; 66// protected bool m_Check4096 = true;
67 protected string m_MapTileDirectory = string.Empty; 67 protected string m_MapTileDirectory = string.Empty;
68 protected string m_ThisGatekeeper = string.Empty; 68 protected string m_ThisGatekeeper = string.Empty;
69 protected Uri m_ThisGatekeeperURI = null; 69 protected Uri m_ThisGatekeeperURI = null;
@@ -121,7 +121,7 @@ namespace OpenSim.Services.GridService
121 if (scope != string.Empty) 121 if (scope != string.Empty)
122 UUID.TryParse(scope, out m_ScopeID); 122 UUID.TryParse(scope, out m_ScopeID);
123 123
124 m_Check4096 = gridConfig.GetBoolean("Check4096", true); 124// m_Check4096 = gridConfig.GetBoolean("Check4096", true);
125 125
126 m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles"); 126 m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles");
127 127
@@ -311,14 +311,18 @@ namespace OpenSim.Services.GridService
311 return true; 311 return true;
312 } 312 }
313 313
314 uint x, y; 314 // We are now performing this check for each individual teleport in the EntityTransferModule instead. This
315 if (m_Check4096 && !Check4096(handle, out x, out y)) 315 // allows us to give better feedback when teleports fail because of the distance reason (which can't be
316 { 316 // done here) and it also hypergrid teleports that are within range (possibly because the source grid
317 RemoveHyperlinkRegion(regInfo.RegionID); 317 // itself has regions that are very far apart).
318 reason = "Region is too far (" + x + ", " + y + ")"; 318// uint x, y;
319 m_log.Info("[HYPERGRID LINKER]: Unable to link, region is too far (" + x + ", " + y + ")"); 319// if (m_Check4096 && !Check4096(handle, out x, out y))
320 return false; 320// {
321 } 321// //RemoveHyperlinkRegion(regInfo.RegionID);
322// reason = "Region is too far (" + x + ", " + y + ")";
323// m_log.Info("[HYPERGRID LINKER]: Unable to link, region is too far (" + x + ", " + y + ")");
324// //return false;
325// }
322 326
323 regInfo.RegionID = regionID; 327 regInfo.RegionID = regionID;
324 328
@@ -369,60 +373,59 @@ namespace OpenSim.Services.GridService
369 } 373 }
370 } 374 }
371 375
372 /// <summary> 376// Not currently used
373 /// Cope with this viewer limitation. 377// /// <summary>
374 /// </summary> 378// /// Cope with this viewer limitation.
375 /// <param name="regInfo"></param> 379// /// </summary>
376 /// <returns></returns> 380// /// <param name="regInfo"></param>
377 public bool Check4096(ulong realHandle, out uint x, out uint y) 381// /// <returns></returns>
378 { 382// public bool Check4096(ulong realHandle, out uint x, out uint y)
379 uint ux = 0, uy = 0; 383// {
380 Utils.LongToUInts(realHandle, out ux, out uy); 384// uint ux = 0, uy = 0;
381 x = ux / Constants.RegionSize; 385// Utils.LongToUInts(realHandle, out ux, out uy);
382 y = uy / Constants.RegionSize; 386// x = ux / Constants.RegionSize;
383 387// y = uy / Constants.RegionSize;
384 const uint limit = (4096 - 1) * Constants.RegionSize; 388//
385 uint xmin = ux - limit; 389// const uint limit = (4096 - 1) * Constants.RegionSize;
386 uint xmax = ux + limit; 390// uint xmin = ux - limit;
387 uint ymin = uy - limit; 391// uint xmax = ux + limit;
388 uint ymax = uy + limit; 392// uint ymin = uy - limit;
389 // World map boundary checks 393// uint ymax = uy + limit;
390 if (xmin < 0 || xmin > ux) 394// // World map boundary checks
391 xmin = 0; 395// if (xmin < 0 || xmin > ux)
392 if (xmax > int.MaxValue || xmax < ux) 396// xmin = 0;
393 xmax = int.MaxValue; 397// if (xmax > int.MaxValue || xmax < ux)
394 if (ymin < 0 || ymin > uy) 398// xmax = int.MaxValue;
395 ymin = 0; 399// if (ymin < 0 || ymin > uy)
396 if (ymax > int.MaxValue || ymax < uy) 400// ymin = 0;
397 ymax = int.MaxValue; 401// if (ymax > int.MaxValue || ymax < uy)
398 402// ymax = int.MaxValue;
399 // Check for any regions that are within the possible teleport range to the linked region 403//
400 List<GridRegion> regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax); 404// // Check for any regions that are within the possible teleport range to the linked region
401 if (regions.Count == 0) 405// List<GridRegion> regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax);
402 { 406// if (regions.Count == 0)
403 return false; 407// {
404 } 408// return false;
405 else 409// }
406 { 410// else
407 // Check for regions which are not linked regions 411// {
408 List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID); 412// // Check for regions which are not linked regions
409 IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks); 413// List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID);
410 if (availableRegions.Count() == 0) 414// IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
411 return false; 415// if (availableRegions.Count() == 0)
412 } 416// return false;
413 417// }
414 return true; 418//
415 } 419// return true;
420// }
416 421
417 private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle) 422 private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle)
418 { 423 {
419
420 RegionData rdata = m_GridService.RegionInfo2RegionData(regionInfo); 424 RegionData rdata = m_GridService.RegionInfo2RegionData(regionInfo);
421 int flags = (int)OpenSim.Data.RegionFlags.Hyperlink + (int)OpenSim.Data.RegionFlags.NoDirectLogin + (int)OpenSim.Data.RegionFlags.RegionOnline; 425 int flags = (int)OpenSim.Data.RegionFlags.Hyperlink + (int)OpenSim.Data.RegionFlags.NoDirectLogin + (int)OpenSim.Data.RegionFlags.RegionOnline;
422 rdata.Data["flags"] = flags.ToString(); 426 rdata.Data["flags"] = flags.ToString();
423 427
424 m_Database.Store(rdata); 428 m_Database.Store(rdata);
425
426 } 429 }
427 430
428 private void RemoveHyperlinkRegion(UUID regionID) 431 private void RemoveHyperlinkRegion(UUID regionID)