diff options
author | Diva Canto | 2010-08-06 17:43:09 -0700 |
---|---|---|
committer | Diva Canto | 2010-08-06 18:08:05 -0700 |
commit | d44b7d9637be7e95c7ad993edf1dfd4e4deb7e76 (patch) | |
tree | 03b2f19406aaa1027645765437d716e2cf03a328 /OpenSim | |
parent | Marck's patch on 4096 checks with conflicts resolved. (diff) | |
download | opensim-SC_OLD-d44b7d9637be7e95c7ad993edf1dfd4e4deb7e76.zip opensim-SC_OLD-d44b7d9637be7e95c7ad993edf1dfd4e4deb7e76.tar.gz opensim-SC_OLD-d44b7d9637be7e95c7ad993edf1dfd4e4deb7e76.tar.bz2 opensim-SC_OLD-d44b7d9637be7e95c7ad993edf1dfd4e4deb7e76.tar.xz |
Added Check4096 config var under [GridService], at the request of many. Changed the iteration that Marck had on the Hyperlinker.
ATTENTION! CONFIGURATION CHANGE AFFECTING Robust.HG.ini.example and StandaloneCommon.ini.example.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Services/GridService/HypergridLinker.cs | 23 |
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 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Linq; | ||
31 | using System.Net; | 30 | using System.Net; |
32 | using System.Reflection; | 31 | using System.Reflection; |
33 | using System.Xml; | 32 | using 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; |