aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
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/Connectors
parentProfiles: Clean up some log entries caused when visiting HG avatar is using l... (diff)
downloadopensim-SC-4cbadc3c4984b8bebc7098a720846309f645ad7b.zip
opensim-SC-4cbadc3c4984b8bebc7098a720846309f645ad7b.tar.gz
opensim-SC-4cbadc3c4984b8bebc7098a720846309f645ad7b.tar.bz2
opensim-SC-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 '')
-rw-r--r--OpenSim/Services/Connectors/Grid/GridServicesConnector.cs51
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs6
2 files changed, 57 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs
index 34ed0d7..0f5a613 100644
--- a/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs
@@ -515,6 +515,57 @@ namespace OpenSim.Services.Connectors
515 return rinfos; 515 return rinfos;
516 } 516 }
517 517
518 public List<GridRegion> GetDefaultHypergridRegions(UUID scopeID)
519 {
520 Dictionary<string, object> sendData = new Dictionary<string, object>();
521
522 sendData["SCOPEID"] = scopeID.ToString();
523
524 sendData["METHOD"] = "get_default_hypergrid_regions";
525
526 List<GridRegion> rinfos = new List<GridRegion>();
527 string reply = string.Empty;
528 string uri = m_ServerURI + "/grid";
529 try
530 {
531 reply = SynchronousRestFormsRequester.MakeRequest("POST",
532 uri,
533 ServerUtils.BuildQueryString(sendData));
534
535 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
536 }
537 catch (Exception e)
538 {
539 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
540 return rinfos;
541 }
542
543 if (reply != string.Empty)
544 {
545 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
546
547 if (replyData != null)
548 {
549 Dictionary<string, object>.ValueCollection rinfosList = replyData.Values;
550 foreach (object r in rinfosList)
551 {
552 if (r is Dictionary<string, object>)
553 {
554 GridRegion rinfo = new GridRegion((Dictionary<string, object>)r);
555 rinfos.Add(rinfo);
556 }
557 }
558 }
559 else
560 m_log.DebugFormat("[GRID CONNECTOR]: GetDefaultHypergridRegions {0} received null response",
561 scopeID);
562 }
563 else
564 m_log.DebugFormat("[GRID CONNECTOR]: GetDefaultHypergridRegions received null reply");
565
566 return rinfos;
567 }
568
518 public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y) 569 public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y)
519 { 570 {
520 Dictionary<string, object> sendData = new Dictionary<string, object>(); 571 Dictionary<string, object> sendData = new Dictionary<string, object>();
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
index bcc1e4a..816591b 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
@@ -330,6 +330,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
330 return new List<GridRegion>(0); 330 return new List<GridRegion>(0);
331 } 331 }
332 332
333 public List<GridRegion> GetDefaultHypergridRegions(UUID scopeID)
334 {
335 // TODO: Allow specifying the default grid location
336 return GetDefaultRegions(scopeID);
337 }
338
333 public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y) 339 public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y)
334 { 340 {
335 GridRegion defRegion = GetNearestRegion(new Vector3d(x, y, 0.0), true); 341 GridRegion defRegion = GetNearestRegion(new Vector3d(x, y, 0.0), true);