diff options
author | UbitUmarov | 2016-11-28 04:29:57 +0000 |
---|---|---|
committer | UbitUmarov | 2016-11-28 04:29:57 +0000 |
commit | 1aa4dbdb3fd5c3c8382dad53d6b7c105fb7cec85 (patch) | |
tree | 46738fbb9799ffeb47a7b6f3eb574c4c5c463302 /OpenSim/Services/GridService/GridService.cs | |
parent | HG on links request build the URI in http format with a / at end, this should... (diff) | |
download | opensim-SC-1aa4dbdb3fd5c3c8382dad53d6b7c105fb7cec85.zip opensim-SC-1aa4dbdb3fd5c3c8382dad53d6b7c105fb7cec85.tar.gz opensim-SC-1aa4dbdb3fd5c3c8382dad53d6b7c105fb7cec85.tar.bz2 opensim-SC-1aa4dbdb3fd5c3c8382dad53d6b7c105fb7cec85.tar.xz |
increase HG mapsearch spargetti; add more flexibility on input uri formats. To find regions in memory for a grid the http format needs to be used, because aditional compares made by viewers
Diffstat (limited to 'OpenSim/Services/GridService/GridService.cs')
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 87 |
1 files changed, 78 insertions, 9 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index a11cae1..66c918f 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -579,7 +579,70 @@ namespace OpenSim.Services.GridService | |||
579 | int count = 0; | 579 | int count = 0; |
580 | List<GridRegion> rinfos = new List<GridRegion>(); | 580 | List<GridRegion> rinfos = new List<GridRegion>(); |
581 | 581 | ||
582 | if (rdatas != null) | 582 | if (count < maxNumber && m_AllowHypergridMapSearch && name.Contains(".")) |
583 | { | ||
584 | string regionURI = ""; | ||
585 | string regionName = ""; | ||
586 | if(!m_HypergridLinker.buildHGRegionURI(name, out regionURI, out regionName)) | ||
587 | return null; | ||
588 | |||
589 | string mapname = regionURI + regionName; | ||
590 | bool haveMatch = false; | ||
591 | |||
592 | if (rdatas != null && (rdatas.Count > 0)) | ||
593 | { | ||
594 | // m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count); | ||
595 | foreach (RegionData rdata in rdatas) | ||
596 | { | ||
597 | if (count++ < maxNumber) | ||
598 | rinfos.Add(RegionData2RegionInfo(rdata)); | ||
599 | if(rdata.RegionName == mapname) | ||
600 | { | ||
601 | haveMatch = true; | ||
602 | if(count == maxNumber) | ||
603 | { | ||
604 | rinfos.RemoveAt(count - 1); | ||
605 | rinfos.Add(RegionData2RegionInfo(rdata)); | ||
606 | } | ||
607 | } | ||
608 | } | ||
609 | if(haveMatch) | ||
610 | return rinfos; | ||
611 | } | ||
612 | |||
613 | rdatas = m_Database.Get(Util.EscapeForLike(mapname)+ "%", scopeID); | ||
614 | if (rdatas != null && (rdatas.Count > 0)) | ||
615 | { | ||
616 | // m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count); | ||
617 | foreach (RegionData rdata in rdatas) | ||
618 | { | ||
619 | if (count++ < maxNumber) | ||
620 | rinfos.Add(RegionData2RegionInfo(rdata)); | ||
621 | if(rdata.RegionName == mapname) | ||
622 | { | ||
623 | haveMatch = true; | ||
624 | if(count == maxNumber) | ||
625 | { | ||
626 | rinfos.RemoveAt(count - 1); | ||
627 | rinfos.Add(RegionData2RegionInfo(rdata)); | ||
628 | break; | ||
629 | } | ||
630 | } | ||
631 | } | ||
632 | if(haveMatch) | ||
633 | return rinfos; | ||
634 | } | ||
635 | |||
636 | string HGname = regionURI +" "+ regionName; | ||
637 | GridRegion r = m_HypergridLinker.LinkRegion(scopeID, HGname); | ||
638 | if (r != null) | ||
639 | { | ||
640 | if( count == maxNumber) | ||
641 | rinfos.RemoveAt(count - 1); | ||
642 | rinfos.Add(r); | ||
643 | } | ||
644 | } | ||
645 | else if (rdatas != null && (rdatas.Count > 0)) | ||
583 | { | 646 | { |
584 | // m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count); | 647 | // m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count); |
585 | foreach (RegionData rdata in rdatas) | 648 | foreach (RegionData rdata in rdatas) |
@@ -589,13 +652,6 @@ namespace OpenSim.Services.GridService | |||
589 | } | 652 | } |
590 | } | 653 | } |
591 | 654 | ||
592 | if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0))) | ||
593 | { | ||
594 | GridRegion r = GetHypergridRegionByName(scopeID, name); | ||
595 | if (r != null) | ||
596 | rinfos.Add(r); | ||
597 | } | ||
598 | |||
599 | return rinfos; | 655 | return rinfos; |
600 | } | 656 | } |
601 | 657 | ||
@@ -608,7 +664,20 @@ namespace OpenSim.Services.GridService | |||
608 | protected GridRegion GetHypergridRegionByName(UUID scopeID, string name) | 664 | protected GridRegion GetHypergridRegionByName(UUID scopeID, string name) |
609 | { | 665 | { |
610 | if (name.Contains(".")) | 666 | if (name.Contains(".")) |
611 | return m_HypergridLinker.LinkRegion(scopeID, name); | 667 | { |
668 | string regionURI = ""; | ||
669 | string regionName = ""; | ||
670 | if(!m_HypergridLinker.buildHGRegionURI(name, out regionURI, out regionName)) | ||
671 | return null; | ||
672 | |||
673 | string mapname = regionURI + regionName; | ||
674 | List<RegionData> rdatas = m_Database.Get(Util.EscapeForLike(mapname), scopeID); | ||
675 | if ((rdatas != null) && (rdatas.Count > 0)) | ||
676 | return RegionData2RegionInfo(rdatas[0]); // get the first | ||
677 | |||
678 | string HGname = regionURI +" "+ regionName; | ||
679 | return m_HypergridLinker.LinkRegion(scopeID, HGname); | ||
680 | } | ||
612 | else | 681 | else |
613 | return null; | 682 | return null; |
614 | } | 683 | } |