diff options
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r-- | OpenSim/Services/Connectors/Grid/GridServicesConnector.cs | 51 | ||||
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs | 6 |
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); |