aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/GridService/HypergridLinker.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/GridService/HypergridLinker.cs')
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs23
1 files changed, 16 insertions, 7 deletions
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 017df41..b190f93 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -27,7 +27,6 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Linq;
31using System.Net; 30using System.Net;
32using System.Reflection; 31using System.Reflection;
33using System.Xml; 32using System.Xml;
@@ -63,6 +62,7 @@ namespace OpenSim.Services.GridService
63 protected GatekeeperServiceConnector m_GatekeeperConnector; 62 protected GatekeeperServiceConnector m_GatekeeperConnector;
64 63
65 protected UUID m_ScopeID = UUID.Zero; 64 protected UUID m_ScopeID = UUID.Zero;
65 protected bool m_Check4096 = true;
66 66
67 // Hyperlink regions are hyperlinks on the map 67 // Hyperlink regions are hyperlinks on the map
68 public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>(); 68 public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
@@ -117,6 +117,8 @@ namespace OpenSim.Services.GridService
117 if (scope != string.Empty) 117 if (scope != string.Empty)
118 UUID.TryParse(scope, out m_ScopeID); 118 UUID.TryParse(scope, out m_ScopeID);
119 119
120 m_Check4096 = gridConfig.GetBoolean("Check4096", true);
121
120 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); 122 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
121 123
122 m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services..."); 124 m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services...");
@@ -278,7 +280,7 @@ namespace OpenSim.Services.GridService
278 } 280 }
279 281
280 uint x, y; 282 uint x, y;
281 if (!Check4096(handle, out x, out y)) 283 if (m_Check4096 && !Check4096(handle, out x, out y))
282 { 284 {
283 RemoveHyperlinkRegion(regInfo.RegionID); 285 RemoveHyperlinkRegion(regInfo.RegionID);
284 reason = "Region is too far (" + x + ", " + y + ")"; 286 reason = "Region is too far (" + x + ", " + y + ")";
@@ -363,11 +365,18 @@ namespace OpenSim.Services.GridService
363 { 365 {
364 // Check for regions which are not linked regions 366 // Check for regions which are not linked regions
365 List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID); 367 List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID);
366 IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks); 368 // would like to use .Except, but doesn't seem to exist
367 if (availableRegions.Count() == 0) 369 //IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
368 { 370 List<GridRegion> availableRegions = regions.FindAll(delegate(GridRegion region)
369 return false; 371 {
370 } 372 // Ewww! n^2
373 if (hyperlinks.Find(delegate(GridRegion r) { return r.RegionID == region.RegionID; }) == null) // not hyperlink. good.
374 return true;
375
376 return false;
377 });
378 if (availableRegions.Count == 0)
379 return false;
371 } 380 }
372 381
373 return true; 382 return true;