aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/Grid/GridServiceConnector.cs98
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs10
-rw-r--r--OpenSim/Services/GridService/GridService.cs30
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs23
4 files changed, 85 insertions, 76 deletions
diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
index 202bad7..80f0d2d 100644
--- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
@@ -556,55 +556,55 @@ namespace OpenSim.Services.Connectors
556 return rinfos; 556 return rinfos;
557 } 557 }
558 558
559 public List<GridRegion> GetHyperlinks(UUID scopeID) 559 public List<GridRegion> GetHyperlinks(UUID scopeID)
560 { 560 {
561 Dictionary<string, object> sendData = new Dictionary<string, object>(); 561 Dictionary<string, object> sendData = new Dictionary<string, object>();
562 562
563 sendData["SCOPEID"] = scopeID.ToString(); 563 sendData["SCOPEID"] = scopeID.ToString();
564 564
565 sendData["METHOD"] = "get_hyperlinks"; 565 sendData["METHOD"] = "get_hyperlinks";
566 566
567 List<GridRegion> rinfos = new List<GridRegion>(); 567 List<GridRegion> rinfos = new List<GridRegion>();
568 string reply = string.Empty; 568 string reply = string.Empty;
569 try 569 try
570 { 570 {
571 reply = SynchronousRestFormsRequester.MakeRequest("POST", 571 reply = SynchronousRestFormsRequester.MakeRequest("POST",
572 m_ServerURI + "/grid", 572 m_ServerURI + "/grid",
573 ServerUtils.BuildQueryString(sendData)); 573 ServerUtils.BuildQueryString(sendData));
574 574
575 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); 575 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
576 } 576 }
577 catch (Exception e) 577 catch (Exception e)
578 { 578 {
579 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 579 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
580 return rinfos; 580 return rinfos;
581 } 581 }
582 582
583 if (reply != string.Empty) 583 if (reply != string.Empty)
584 { 584 {
585 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 585 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
586 586
587 if (replyData != null) 587 if (replyData != null)
588 { 588 {
589 Dictionary<string, object>.ValueCollection rinfosList = replyData.Values; 589 Dictionary<string, object>.ValueCollection rinfosList = replyData.Values;
590 foreach (object r in rinfosList) 590 foreach (object r in rinfosList)
591 { 591 {
592 if (r is Dictionary<string, object>) 592 if (r is Dictionary<string, object>)
593 { 593 {
594 GridRegion rinfo = new GridRegion((Dictionary<string, object>)r); 594 GridRegion rinfo = new GridRegion((Dictionary<string, object>)r);
595 rinfos.Add(rinfo); 595 rinfos.Add(rinfo);
596 } 596 }
597 } 597 }
598 } 598 }
599 else 599 else
600 m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks {0} received null response", 600 m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks {0} received null response",
601 scopeID); 601 scopeID);
602 } 602 }
603 else 603 else
604 m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks received null reply"); 604 m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks received null reply");
605 605
606 return rinfos; 606 return rinfos;
607 } 607 }
608 608
609 public virtual int GetRegionFlags(UUID scopeID, UUID regionID) 609 public virtual int GetRegionFlags(UUID scopeID, UUID regionID)
610 { 610 {
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
index 7bc85c6..fefdad6 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
@@ -357,11 +357,11 @@ namespace OpenSim.Services.Connectors.SimianGrid
357 return new List<GridRegion>(0); 357 return new List<GridRegion>(0);
358 } 358 }
359 359
360 public List<GridRegion> GetHyperlinks(UUID scopeID) 360 public List<GridRegion> GetHyperlinks(UUID scopeID)
361 { 361 {
362 // Hypergrid/linked regions are not supported 362 // Hypergrid/linked regions are not supported
363 return new List<GridRegion>(); 363 return new List<GridRegion>();
364 } 364 }
365 365
366 public int GetRegionFlags(UUID scopeID, UUID regionID) 366 public int GetRegionFlags(UUID scopeID, UUID regionID)
367 { 367 {
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 79a45fe..ce6f64b 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -426,21 +426,21 @@ namespace OpenSim.Services.GridService
426 return ret; 426 return ret;
427 } 427 }
428 428
429 public List<GridRegion> GetHyperlinks(UUID scopeID) 429 public List<GridRegion> GetHyperlinks(UUID scopeID)
430 { 430 {
431 List<GridRegion> ret = new List<GridRegion>(); 431 List<GridRegion> ret = new List<GridRegion>();
432 432
433 List<RegionData> regions = m_Database.GetHyperlinks(scopeID); 433 List<RegionData> regions = m_Database.GetHyperlinks(scopeID);
434 434
435 foreach (RegionData r in regions) 435 foreach (RegionData r in regions)
436 { 436 {
437 if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0) 437 if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0)
438 ret.Add(RegionData2RegionInfo(r)); 438 ret.Add(RegionData2RegionInfo(r));
439 } 439 }
440 440
441 m_log.DebugFormat("[GRID SERVICE]: Hyperlinks returned {0} regions", ret.Count); 441 m_log.DebugFormat("[GRID SERVICE]: Hyperlinks returned {0} regions", ret.Count);
442 return ret; 442 return ret;
443 } 443 }
444 444
445 public int GetRegionFlags(UUID scopeID, UUID regionID) 445 public int GetRegionFlags(UUID scopeID, UUID regionID)
446 { 446 {
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 017df41..b190f93 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -27,7 +27,6 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Linq;
31using System.Net; 30using System.Net;
32using System.Reflection; 31using System.Reflection;
33using System.Xml; 32using System.Xml;
@@ -63,6 +62,7 @@ namespace OpenSim.Services.GridService
63 protected GatekeeperServiceConnector m_GatekeeperConnector; 62 protected GatekeeperServiceConnector m_GatekeeperConnector;
64 63
65 protected UUID m_ScopeID = UUID.Zero; 64 protected UUID m_ScopeID = UUID.Zero;
65 protected bool m_Check4096 = true;
66 66
67 // Hyperlink regions are hyperlinks on the map 67 // Hyperlink regions are hyperlinks on the map
68 public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>(); 68 public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
@@ -117,6 +117,8 @@ namespace OpenSim.Services.GridService
117 if (scope != string.Empty) 117 if (scope != string.Empty)
118 UUID.TryParse(scope, out m_ScopeID); 118 UUID.TryParse(scope, out m_ScopeID);
119 119
120 m_Check4096 = gridConfig.GetBoolean("Check4096", true);
121
120 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); 122 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
121 123
122 m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services..."); 124 m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services...");
@@ -278,7 +280,7 @@ namespace OpenSim.Services.GridService
278 } 280 }
279 281
280 uint x, y; 282 uint x, y;
281 if (!Check4096(handle, out x, out y)) 283 if (m_Check4096 && !Check4096(handle, out x, out y))
282 { 284 {
283 RemoveHyperlinkRegion(regInfo.RegionID); 285 RemoveHyperlinkRegion(regInfo.RegionID);
284 reason = "Region is too far (" + x + ", " + y + ")"; 286 reason = "Region is too far (" + x + ", " + y + ")";
@@ -363,11 +365,18 @@ namespace OpenSim.Services.GridService
363 { 365 {
364 // Check for regions which are not linked regions 366 // Check for regions which are not linked regions
365 List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID); 367 List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID);
366 IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks); 368 // would like to use .Except, but doesn't seem to exist
367 if (availableRegions.Count() == 0) 369 //IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
368 { 370 List<GridRegion> availableRegions = regions.FindAll(delegate(GridRegion region)
369 return false; 371 {
370 } 372 // Ewww! n^2
373 if (hyperlinks.Find(delegate(GridRegion r) { return r.RegionID == region.RegionID; }) == null) // not hyperlink. good.
374 return true;
375
376 return false;
377 });
378 if (availableRegions.Count == 0)
379 return false;
371 } 380 }
372 381
373 return true; 382 return true;