aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/GridService
diff options
context:
space:
mode:
authorUbitUmarov2019-11-14 06:34:44 +0000
committerUbitUmarov2019-11-14 06:34:44 +0000
commit31aef4e82b2e746837a6ef0fcd8d3f1b7385bc8e (patch)
tree1714d1b387d631925abc9bb417adc17565084dc9 /OpenSim/Services/GridService
parentComplete PostGres from previous commit - (Not Tested) (diff)
downloadopensim-SC-31aef4e82b2e746837a6ef0fcd8d3f1b7385bc8e.zip
opensim-SC-31aef4e82b2e746837a6ef0fcd8d3f1b7385bc8e.tar.gz
opensim-SC-31aef4e82b2e746837a6ef0fcd8d3f1b7385bc8e.tar.bz2
opensim-SC-31aef4e82b2e746837a6ef0fcd8d3f1b7385bc8e.tar.xz
work on previus 2 patchs
Diffstat (limited to 'OpenSim/Services/GridService')
-rwxr-xr-xOpenSim/Services/GridService/GridService.cs36
1 files changed, 17 insertions, 19 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index b672e8c..d8f3720 100755
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -476,9 +476,9 @@ namespace OpenSim.Services.GridService
476 476
477 public GridRegion GetRegionByName(UUID scopeID, string name) 477 public GridRegion GetRegionByName(UUID scopeID, string name)
478 { 478 {
479 List<RegionData> rdatas = m_Database.Get(Util.EscapeForLike(name), scopeID); 479 RegionData rdata = m_Database.GetSpecific(name, scopeID);
480 if ((rdatas != null) && (rdatas.Count > 0)) 480 if (rdata != null)
481 return RegionData2RegionInfo(rdatas[0]); // get the first 481 return RegionData2RegionInfo(rdata);
482 482
483 if (m_AllowHypergridMapSearch) 483 if (m_AllowHypergridMapSearch)
484 { 484 {
@@ -490,18 +490,7 @@ namespace OpenSim.Services.GridService
490 return null; 490 return null;
491 } 491 }
492 492
493 //BA MOD.... 493 public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
494 public GridRegion GetRegionByNameSpecific(UUID scopeID, string name)
495 {
496 RegionData rdata = m_Database.GetSpecific(name, scopeID);
497 if (rdata != null)
498 {
499 return RegionData2RegionInfo(rdata);
500 }
501 return null;
502 }
503
504 public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
505 { 494 {
506// m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); 495// m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name);
507 496
@@ -510,7 +499,7 @@ namespace OpenSim.Services.GridService
510 int count = 0; 499 int count = 0;
511 List<GridRegion> rinfos = new List<GridRegion>(); 500 List<GridRegion> rinfos = new List<GridRegion>();
512 501
513 if (count < maxNumber && m_AllowHypergridMapSearch && name.Contains(".")) 502 if (m_AllowHypergridMapSearch && name.Contains("."))
514 { 503 {
515 string regionURI = ""; 504 string regionURI = "";
516 string regionHost = ""; 505 string regionHost = "";
@@ -538,7 +527,7 @@ namespace OpenSim.Services.GridService
538 { 527 {
539 if (count++ < maxNumber) 528 if (count++ < maxNumber)
540 rinfos.Add(RegionData2RegionInfo(rdata)); 529 rinfos.Add(RegionData2RegionInfo(rdata));
541 if(rdata.RegionName == mapname) 530 if(mapname.Equals(rdata.RegionName,StringComparison.InvariantCultureIgnoreCase))
542 { 531 {
543 haveMatch = true; 532 haveMatch = true;
544 if(count == maxNumber) 533 if(count == maxNumber)
@@ -560,7 +549,7 @@ namespace OpenSim.Services.GridService
560 { 549 {
561 if (count++ < maxNumber) 550 if (count++ < maxNumber)
562 rinfos.Add(RegionData2RegionInfo(rdata)); 551 rinfos.Add(RegionData2RegionInfo(rdata));
563 if(rdata.RegionName == mapname) 552 if (mapname.Equals(rdata.RegionName, StringComparison.InvariantCultureIgnoreCase))
564 { 553 {
565 haveMatch = true; 554 haveMatch = true;
566 if(count == maxNumber) 555 if(count == maxNumber)
@@ -588,11 +577,20 @@ namespace OpenSim.Services.GridService
588 } 577 }
589 else if (rdatas != null && (rdatas.Count > 0)) 578 else if (rdatas != null && (rdatas.Count > 0))
590 { 579 {
591// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count); 580 //m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
592 foreach (RegionData rdata in rdatas) 581 foreach (RegionData rdata in rdatas)
593 { 582 {
594 if (count++ < maxNumber) 583 if (count++ < maxNumber)
595 rinfos.Add(RegionData2RegionInfo(rdata)); 584 rinfos.Add(RegionData2RegionInfo(rdata));
585 if (name.Equals(rdata.RegionName, StringComparison.InvariantCultureIgnoreCase))
586 {
587 if (count == maxNumber)
588 {
589 rinfos.RemoveAt(count - 1);
590 rinfos.Add(RegionData2RegionInfo(rdata));
591 break;
592 }
593 }
596 } 594 }
597 } 595 }
598 596