diff options
author | UbitUmarov | 2016-12-15 23:48:25 +0000 |
---|---|---|
committer | UbitUmarov | 2016-12-15 23:48:25 +0000 |
commit | c0a23d36dfa28a3204b31883e1e7bc76b249c8fb (patch) | |
tree | 092a5900e8135e97dbc37ef0cfd0aed0e70f01d6 /OpenSim/Services/GridService | |
parent | set pbs shape acording to mesh number of (material) faces (diff) | |
download | opensim-SC_OLD-c0a23d36dfa28a3204b31883e1e7bc76b249c8fb.zip opensim-SC_OLD-c0a23d36dfa28a3204b31883e1e7bc76b249c8fb.tar.gz opensim-SC_OLD-c0a23d36dfa28a3204b31883e1e7bc76b249c8fb.tar.bz2 opensim-SC_OLD-c0a23d36dfa28a3204b31883e1e7bc76b249c8fb.tar.xz |
GetRegionsByName and GetHypergridRegionByName: detect that provided url is for local grid, and make it a local by region name local search
Diffstat (limited to 'OpenSim/Services/GridService')
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 29 | ||||
-rw-r--r-- | OpenSim/Services/GridService/HypergridLinker.cs | 10 |
2 files changed, 27 insertions, 12 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 31a186a..82b910a 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -508,6 +508,7 @@ namespace OpenSim.Services.GridService | |||
508 | if(!m_HypergridLinker.buildHGRegionURI(name, out regionURI, out regionName)) | 508 | if(!m_HypergridLinker.buildHGRegionURI(name, out regionURI, out regionName)) |
509 | return null; | 509 | return null; |
510 | 510 | ||
511 | bool localGrid = string.IsNullOrWhiteSpace(regionURI); | ||
511 | string mapname = regionURI + regionName; | 512 | string mapname = regionURI + regionName; |
512 | bool haveMatch = false; | 513 | bool haveMatch = false; |
513 | 514 | ||
@@ -531,7 +532,7 @@ namespace OpenSim.Services.GridService | |||
531 | if(haveMatch) | 532 | if(haveMatch) |
532 | return rinfos; | 533 | return rinfos; |
533 | } | 534 | } |
534 | 535 | ||
535 | rdatas = m_Database.Get(Util.EscapeForLike(mapname)+ "%", scopeID); | 536 | rdatas = m_Database.Get(Util.EscapeForLike(mapname)+ "%", scopeID); |
536 | if (rdatas != null && (rdatas.Count > 0)) | 537 | if (rdatas != null && (rdatas.Count > 0)) |
537 | { | 538 | { |
@@ -554,14 +555,16 @@ namespace OpenSim.Services.GridService | |||
554 | if(haveMatch) | 555 | if(haveMatch) |
555 | return rinfos; | 556 | return rinfos; |
556 | } | 557 | } |
557 | 558 | if(!localGrid) | |
558 | string HGname = regionURI +" "+ regionName; | ||
559 | GridRegion r = m_HypergridLinker.LinkRegion(scopeID, HGname); | ||
560 | if (r != null) | ||
561 | { | 559 | { |
562 | if( count == maxNumber) | 560 | string HGname = regionURI +" "+ regionName; // include space for compatibility |
563 | rinfos.RemoveAt(count - 1); | 561 | GridRegion r = m_HypergridLinker.LinkRegion(scopeID, HGname); |
564 | rinfos.Add(r); | 562 | if (r != null) |
563 | { | ||
564 | if( count == maxNumber) | ||
565 | rinfos.RemoveAt(count - 1); | ||
566 | rinfos.Add(r); | ||
567 | } | ||
565 | } | 568 | } |
566 | } | 569 | } |
567 | else if (rdatas != null && (rdatas.Count > 0)) | 570 | else if (rdatas != null && (rdatas.Count > 0)) |
@@ -597,11 +600,13 @@ namespace OpenSim.Services.GridService | |||
597 | if ((rdatas != null) && (rdatas.Count > 0)) | 600 | if ((rdatas != null) && (rdatas.Count > 0)) |
598 | return RegionData2RegionInfo(rdatas[0]); // get the first | 601 | return RegionData2RegionInfo(rdatas[0]); // get the first |
599 | 602 | ||
600 | string HGname = regionURI +" "+ regionName; | 603 | if(!string.IsNullOrWhiteSpace(regionURI)) |
601 | return m_HypergridLinker.LinkRegion(scopeID, HGname); | 604 | { |
605 | string HGname = regionURI +" "+ regionName; | ||
606 | return m_HypergridLinker.LinkRegion(scopeID, HGname); | ||
607 | } | ||
602 | } | 608 | } |
603 | else | 609 | return null; |
604 | return null; | ||
605 | } | 610 | } |
606 | 611 | ||
607 | public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) | 612 | public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) |
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index ceb2c6e..185f2ff 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs | |||
@@ -137,6 +137,12 @@ namespace OpenSim.Services.GridService | |||
137 | m_log.WarnFormat("[HYPERGRID LINKER]: Malformed URL in [GridService], variable Gatekeeper = {0}", m_ThisGatekeeper); | 137 | m_log.WarnFormat("[HYPERGRID LINKER]: Malformed URL in [GridService], variable Gatekeeper = {0}", m_ThisGatekeeper); |
138 | } | 138 | } |
139 | 139 | ||
140 | m_ThisGatekeeper = m_ThisGatekeeperURI.AbsoluteUri; | ||
141 | if(m_ThisGatekeeperURI.Port == 80) | ||
142 | m_ThisGatekeeper = m_ThisGatekeeper.Trim(new char[] { '/', ' ' }) +":80/"; | ||
143 | else if(m_ThisGatekeeperURI.Port == 443) | ||
144 | m_ThisGatekeeper = m_ThisGatekeeper.Trim(new char[] { '/', ' ' }) +":443/"; | ||
145 | |||
140 | m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); | 146 | m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); |
141 | 147 | ||
142 | m_log.Debug("[HYPERGRID LINKER]: Loaded all services..."); | 148 | m_log.Debug("[HYPERGRID LINKER]: Loaded all services..."); |
@@ -302,6 +308,10 @@ namespace OpenSim.Services.GridService | |||
302 | serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":80/"; | 308 | serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":80/"; |
303 | else if(uri.Port == 443) | 309 | else if(uri.Port == 443) |
304 | serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":443/"; | 310 | serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":443/"; |
311 | |||
312 | if(serverURI == m_ThisGatekeeper) | ||
313 | serverURI = ""; // local grid, look for region name only | ||
314 | |||
305 | return true; | 315 | return true; |
306 | } | 316 | } |
307 | 317 | ||