diff options
Diffstat (limited to 'OpenSim/Services')
-rw-r--r-- | OpenSim/Services/GridService/HypergridLinker.cs | 115 |
1 files changed, 59 insertions, 56 deletions
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 5262598..83ec122 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 | ||
@@ -347,14 +347,18 @@ namespace OpenSim.Services.GridService | |||
347 | return true; | 347 | return true; |
348 | } | 348 | } |
349 | 349 | ||
350 | uint x, y; | 350 | // We are now performing this check for each individual teleport in the EntityTransferModule instead. This |
351 | if (m_Check4096 && !Check4096(handle, out x, out y)) | 351 | // allows us to give better feedback when teleports fail because of the distance reason (which can't be |
352 | { | 352 | // done here) and it also hypergrid teleports that are within range (possibly because the source grid |
353 | RemoveHyperlinkRegion(regInfo.RegionID); | 353 | // itself has regions that are very far apart). |
354 | reason = "Region is too far (" + x + ", " + y + ")"; | 354 | // uint x, y; |
355 | m_log.Info("[HYPERGRID LINKER]: Unable to link, region is too far (" + x + ", " + y + ")"); | 355 | // if (m_Check4096 && !Check4096(handle, out x, out y)) |
356 | return false; | 356 | // { |
357 | } | 357 | // //RemoveHyperlinkRegion(regInfo.RegionID); |
358 | // reason = "Region is too far (" + x + ", " + y + ")"; | ||
359 | // m_log.Info("[HYPERGRID LINKER]: Unable to link, region is too far (" + x + ", " + y + ")"); | ||
360 | // //return false; | ||
361 | // } | ||
358 | 362 | ||
359 | regInfo.RegionID = regionID; | 363 | regInfo.RegionID = regionID; |
360 | 364 | ||
@@ -405,60 +409,59 @@ namespace OpenSim.Services.GridService | |||
405 | } | 409 | } |
406 | } | 410 | } |
407 | 411 | ||
408 | /// <summary> | 412 | // Not currently used |
409 | /// Cope with this viewer limitation. | 413 | // /// <summary> |
410 | /// </summary> | 414 | // /// Cope with this viewer limitation. |
411 | /// <param name="regInfo"></param> | 415 | // /// </summary> |
412 | /// <returns></returns> | 416 | // /// <param name="regInfo"></param> |
413 | public bool Check4096(ulong realHandle, out uint x, out uint y) | 417 | // /// <returns></returns> |
414 | { | 418 | // public bool Check4096(ulong realHandle, out uint x, out uint y) |
415 | uint ux = 0, uy = 0; | 419 | // { |
416 | Utils.LongToUInts(realHandle, out ux, out uy); | 420 | // uint ux = 0, uy = 0; |
417 | x = ux / Constants.RegionSize; | 421 | // Utils.LongToUInts(realHandle, out ux, out uy); |
418 | y = uy / Constants.RegionSize; | 422 | // x = ux / Constants.RegionSize; |
419 | 423 | // y = uy / Constants.RegionSize; | |
420 | const uint limit = (4096 - 1) * Constants.RegionSize; | 424 | // |
421 | uint xmin = ux - limit; | 425 | // const uint limit = (4096 - 1) * Constants.RegionSize; |
422 | uint xmax = ux + limit; | 426 | // uint xmin = ux - limit; |
423 | uint ymin = uy - limit; | 427 | // uint xmax = ux + limit; |
424 | uint ymax = uy + limit; | 428 | // uint ymin = uy - limit; |
425 | // World map boundary checks | 429 | // uint ymax = uy + limit; |
426 | if (xmin < 0 || xmin > ux) | 430 | // // World map boundary checks |
427 | xmin = 0; | 431 | // if (xmin < 0 || xmin > ux) |
428 | if (xmax > int.MaxValue || xmax < ux) | 432 | // xmin = 0; |
429 | xmax = int.MaxValue; | 433 | // if (xmax > int.MaxValue || xmax < ux) |
430 | if (ymin < 0 || ymin > uy) | 434 | // xmax = int.MaxValue; |
431 | ymin = 0; | 435 | // if (ymin < 0 || ymin > uy) |
432 | if (ymax > int.MaxValue || ymax < uy) | 436 | // ymin = 0; |
433 | ymax = int.MaxValue; | 437 | // if (ymax > int.MaxValue || ymax < uy) |
434 | 438 | // ymax = int.MaxValue; | |
435 | // Check for any regions that are within the possible teleport range to the linked region | 439 | // |
436 | List<GridRegion> regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax); | 440 | // // Check for any regions that are within the possible teleport range to the linked region |
437 | if (regions.Count == 0) | 441 | // List<GridRegion> regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax); |
438 | { | 442 | // if (regions.Count == 0) |
439 | return false; | 443 | // { |
440 | } | 444 | // return false; |
441 | else | 445 | // } |
442 | { | 446 | // else |
443 | // Check for regions which are not linked regions | 447 | // { |
444 | List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID); | 448 | // // Check for regions which are not linked regions |
445 | IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks); | 449 | // List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID); |
446 | if (availableRegions.Count() == 0) | 450 | // IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks); |
447 | return false; | 451 | // if (availableRegions.Count() == 0) |
448 | } | 452 | // return false; |
449 | 453 | // } | |
450 | return true; | 454 | // |
451 | } | 455 | // return true; |
456 | // } | ||
452 | 457 | ||
453 | private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle) | 458 | private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle) |
454 | { | 459 | { |
455 | |||
456 | RegionData rdata = m_GridService.RegionInfo2RegionData(regionInfo); | 460 | RegionData rdata = m_GridService.RegionInfo2RegionData(regionInfo); |
457 | int flags = (int)OpenSim.Data.RegionFlags.Hyperlink + (int)OpenSim.Data.RegionFlags.NoDirectLogin + (int)OpenSim.Data.RegionFlags.RegionOnline; | 461 | int flags = (int)OpenSim.Data.RegionFlags.Hyperlink + (int)OpenSim.Data.RegionFlags.NoDirectLogin + (int)OpenSim.Data.RegionFlags.RegionOnline; |
458 | rdata.Data["flags"] = flags.ToString(); | 462 | rdata.Data["flags"] = flags.ToString(); |
459 | 463 | ||
460 | m_Database.Store(rdata); | 464 | m_Database.Store(rdata); |
461 | |||
462 | } | 465 | } |
463 | 466 | ||
464 | private void RemoveHyperlinkRegion(UUID regionID) | 467 | private void RemoveHyperlinkRegion(UUID regionID) |