aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/GridService
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-09-02 17:27:45 +0100
committerJustin Clark-Casey (justincc)2013-09-02 17:27:45 +0100
commit4cbadc3c4984b8bebc7098a720846309f645ad7b (patch)
treecb751e8ed85892b49fe207ddcaed034f30f479f5 /OpenSim/Services/GridService
parentProfiles: Clean up some log entries caused when visiting HG avatar is using l... (diff)
downloadopensim-SC_OLD-4cbadc3c4984b8bebc7098a720846309f645ad7b.zip
opensim-SC_OLD-4cbadc3c4984b8bebc7098a720846309f645ad7b.tar.gz
opensim-SC_OLD-4cbadc3c4984b8bebc7098a720846309f645ad7b.tar.bz2
opensim-SC_OLD-4cbadc3c4984b8bebc7098a720846309f645ad7b.tar.xz
Allow one to specify a DefaultHGRegion flag in [GridService] in order to allow different default regions for HG and direct grid logins.
This requires a new GridService.GetDefaultHypergridRegions() so ROBUST services require updating but not simulators. This method still returns regions flagged with just DefaultRegion after any DefaultHGRegions, so if no DefaultHGRegions are specified then existing configured defaults will still work. Immediate use is for conference where we need to be able to specify different defaults However, this is also generally useful to send experienced HG users to one default location and local users whose specified region fails (e.g. no "home" or "last") to another.
Diffstat (limited to 'OpenSim/Services/GridService')
-rw-r--r--OpenSim/Services/GridService/GridService.cs32
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs2
2 files changed, 31 insertions, 3 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index a1485c8..e72b7f9 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -265,8 +265,9 @@ namespace OpenSim.Services.GridService
265 m_log.DebugFormat("[GRID SERVICE]: Database exception: {0}", e); 265 m_log.DebugFormat("[GRID SERVICE]: Database exception: {0}", e);
266 } 266 }
267 267
268 m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) registered successfully at {2}-{3}", 268 m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) registered successfully at {2}-{3} with flags {4}",
269 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionCoordX, regionInfos.RegionCoordY); 269 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionCoordX, regionInfos.RegionCoordY,
270 (OpenSim.Framework.RegionFlags)flags);
270 271
271 return String.Empty; 272 return String.Empty;
272 } 273 }
@@ -478,6 +479,33 @@ namespace OpenSim.Services.GridService
478 return ret; 479 return ret;
479 } 480 }
480 481
482 public List<GridRegion> GetDefaultHypergridRegions(UUID scopeID)
483 {
484 List<GridRegion> ret = new List<GridRegion>();
485
486 List<RegionData> regions = m_Database.GetDefaultHypergridRegions(scopeID);
487
488 foreach (RegionData r in regions)
489 {
490 if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Framework.RegionFlags.RegionOnline) != 0)
491 ret.Add(RegionData2RegionInfo(r));
492 }
493
494 int hgDefaultRegionsFoundOnline = regions.Count;
495
496 // For now, hypergrid default regions will always be given precedence but we will also return simple default
497 // regions in case no specific hypergrid regions are specified.
498 ret.AddRange(GetDefaultRegions(scopeID));
499
500 int normalDefaultRegionsFoundOnline = ret.Count - hgDefaultRegionsFoundOnline;
501
502 m_log.DebugFormat(
503 "[GRID SERVICE]: GetDefaultHypergridRegions returning {0} hypergrid default and {1} normal default regions",
504 hgDefaultRegionsFoundOnline, normalDefaultRegionsFoundOnline);
505
506 return ret;
507 }
508
481 public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y) 509 public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y)
482 { 510 {
483 List<GridRegion> ret = new List<GridRegion>(); 511 List<GridRegion> ret = new List<GridRegion>();
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 8335724..4024295 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Services.GridService
79 { 79 {
80 if (m_DefaultRegion == null) 80 if (m_DefaultRegion == null)
81 { 81 {
82 List<GridRegion> defs = m_GridService.GetDefaultRegions(m_ScopeID); 82 List<GridRegion> defs = m_GridService.GetDefaultHypergridRegions(m_ScopeID);
83 if (defs != null && defs.Count > 0) 83 if (defs != null && defs.Count > 0)
84 m_DefaultRegion = defs[0]; 84 m_DefaultRegion = defs[0];
85 else 85 else