aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/GridService/GridService.cs
diff options
context:
space:
mode:
authorUbitUmarov2016-12-18 05:03:27 +0000
committerUbitUmarov2016-12-18 05:03:27 +0000
commit82fc8e1a36778a59d4d9c329ea71a60c3f4e8729 (patch)
tree65b5fbfe80c9db6547b2693b04544de18647f7bd /OpenSim/Services/GridService/GridService.cs
parentMerge branch 'master' into httptests (diff)
parentleave stupid broken permissions alone (diff)
downloadopensim-SC-82fc8e1a36778a59d4d9c329ea71a60c3f4e8729.zip
opensim-SC-82fc8e1a36778a59d4d9c329ea71a60c3f4e8729.tar.gz
opensim-SC-82fc8e1a36778a59d4d9c329ea71a60c3f4e8729.tar.bz2
opensim-SC-82fc8e1a36778a59d4d9c329ea71a60c3f4e8729.tar.xz
Merge branch 'master' into httptests
Diffstat (limited to 'OpenSim/Services/GridService/GridService.cs')
-rw-r--r--OpenSim/Services/GridService/GridService.cs58
1 files changed, 36 insertions, 22 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 31a186a..aa13a67 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -57,9 +57,6 @@ namespace OpenSim.Services.GridService
57 protected bool m_AllowDuplicateNames = false; 57 protected bool m_AllowDuplicateNames = false;
58 protected bool m_AllowHypergridMapSearch = false; 58 protected bool m_AllowHypergridMapSearch = false;
59 59
60
61 protected bool m_SuppressVarregionOverlapCheckOnRegistration = false;
62
63 private static Dictionary<string,object> m_ExtraFeatures = new Dictionary<string, object>(); 60 private static Dictionary<string,object> m_ExtraFeatures = new Dictionary<string, object>();
64 61
65 public GridService(IConfigSource config) 62 public GridService(IConfigSource config)
@@ -86,8 +83,6 @@ namespace OpenSim.Services.GridService
86 m_AllowDuplicateNames = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames); 83 m_AllowDuplicateNames = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames);
87 m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch); 84 m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch);
88 85
89 m_SuppressVarregionOverlapCheckOnRegistration = gridConfig.GetBoolean("SuppressVarregionOverlapCheckOnRegistration", m_SuppressVarregionOverlapCheckOnRegistration);
90
91 // This service is also used locally by a simulator running in grid mode. This switches prevents 86 // This service is also used locally by a simulator running in grid mode. This switches prevents
92 // inappropriate console commands from being registered 87 // inappropriate console commands from being registered
93 suppressConsoleCommands = gridConfig.GetBoolean("SuppressConsoleCommands", suppressConsoleCommands); 88 suppressConsoleCommands = gridConfig.GetBoolean("SuppressConsoleCommands", suppressConsoleCommands);
@@ -202,6 +197,9 @@ namespace OpenSim.Services.GridService
202 if (regionInfos.RegionID == UUID.Zero) 197 if (regionInfos.RegionID == UUID.Zero)
203 return "Invalid RegionID - cannot be zero UUID"; 198 return "Invalid RegionID - cannot be zero UUID";
204 199
200 if (regionInfos.RegionLocY <= Constants.MaximumRegionSize)
201 return "Region location reserved for HG links coord Y must be higher than " + (Constants.MaximumRegionSize/256).ToString();
202
205 String reason = "Region overlaps another region"; 203 String reason = "Region overlaps another region";
206 204
207 List<RegionData> rdatas = m_Database.Get( 205 List<RegionData> rdatas = m_Database.Get(
@@ -295,7 +293,7 @@ namespace OpenSim.Services.GridService
295 293
296 // Region reregistering in other coordinates. Delete the old entry 294 // Region reregistering in other coordinates. Delete the old entry
297 m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) was previously registered at {2}-{3}. Deleting old entry.", 295 m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) was previously registered at {2}-{3}. Deleting old entry.",
298 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY); 296 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionCoordX, regionInfos.RegionCoordY);
299 297
300 try 298 try
301 { 299 {
@@ -505,10 +503,16 @@ namespace OpenSim.Services.GridService
505 { 503 {
506 string regionURI = ""; 504 string regionURI = "";
507 string regionName = ""; 505 string regionName = "";
508 if(!m_HypergridLinker.buildHGRegionURI(name, out regionURI, out regionName)) 506 if(!Util.buildHGRegionURI(name, out regionURI, out regionName))
509 return null; 507 return null;
510 508
511 string mapname = regionURI + regionName; 509 string mapname;
510 bool localGrid = m_HypergridLinker.IsLocalGrid(regionURI);
511 if(localGrid)
512 mapname = regionName;
513 else
514 mapname = regionURI + regionName;
515
512 bool haveMatch = false; 516 bool haveMatch = false;
513 517
514 if (rdatas != null && (rdatas.Count > 0)) 518 if (rdatas != null && (rdatas.Count > 0))
@@ -531,7 +535,7 @@ namespace OpenSim.Services.GridService
531 if(haveMatch) 535 if(haveMatch)
532 return rinfos; 536 return rinfos;
533 } 537 }
534 538
535 rdatas = m_Database.Get(Util.EscapeForLike(mapname)+ "%", scopeID); 539 rdatas = m_Database.Get(Util.EscapeForLike(mapname)+ "%", scopeID);
536 if (rdatas != null && (rdatas.Count > 0)) 540 if (rdatas != null && (rdatas.Count > 0))
537 { 541 {
@@ -554,14 +558,16 @@ namespace OpenSim.Services.GridService
554 if(haveMatch) 558 if(haveMatch)
555 return rinfos; 559 return rinfos;
556 } 560 }
557 561 if(!localGrid && !string.IsNullOrWhiteSpace(regionURI))
558 string HGname = regionURI +" "+ regionName;
559 GridRegion r = m_HypergridLinker.LinkRegion(scopeID, HGname);
560 if (r != null)
561 { 562 {
562 if( count == maxNumber) 563 string HGname = regionURI +" "+ regionName; // include space for compatibility
563 rinfos.RemoveAt(count - 1); 564 GridRegion r = m_HypergridLinker.LinkRegion(scopeID, HGname);
564 rinfos.Add(r); 565 if (r != null)
566 {
567 if( count == maxNumber)
568 rinfos.RemoveAt(count - 1);
569 rinfos.Add(r);
570 }
565 } 571 }
566 } 572 }
567 else if (rdatas != null && (rdatas.Count > 0)) 573 else if (rdatas != null && (rdatas.Count > 0))
@@ -589,19 +595,27 @@ namespace OpenSim.Services.GridService
589 { 595 {
590 string regionURI = ""; 596 string regionURI = "";
591 string regionName = ""; 597 string regionName = "";
592 if(!m_HypergridLinker.buildHGRegionURI(name, out regionURI, out regionName)) 598 if(!Util.buildHGRegionURI(name, out regionURI, out regionName))
593 return null; 599 return null;
594 600
595 string mapname = regionURI + regionName; 601 string mapname;
602 bool localGrid = m_HypergridLinker.IsLocalGrid(regionURI);
603 if(localGrid)
604 mapname = regionName;
605 else
606 mapname = regionURI + regionName;
607
596 List<RegionData> rdatas = m_Database.Get(Util.EscapeForLike(mapname), scopeID); 608 List<RegionData> rdatas = m_Database.Get(Util.EscapeForLike(mapname), scopeID);
597 if ((rdatas != null) && (rdatas.Count > 0)) 609 if ((rdatas != null) && (rdatas.Count > 0))
598 return RegionData2RegionInfo(rdatas[0]); // get the first 610 return RegionData2RegionInfo(rdatas[0]); // get the first
599 611
600 string HGname = regionURI +" "+ regionName; 612 if(!localGrid && !string.IsNullOrWhiteSpace(regionURI))
601 return m_HypergridLinker.LinkRegion(scopeID, HGname); 613 {
614 string HGname = regionURI +" "+ regionName;
615 return m_HypergridLinker.LinkRegion(scopeID, HGname);
616 }
602 } 617 }
603 else 618 return null;
604 return null;
605 } 619 }
606 620
607 public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) 621 public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)