From d39e67d5b2ca974e7e2506bcb717ec25ae061e75 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 26 Sep 2009 08:06:14 -0700 Subject: More redirects to HGGridConnector-as-HyperlinkService. --- .../ServiceConnectorsOut/Grid/HGGridConnector.cs | 5 ++++- .../Interregion/RESTInterregionComms.cs | 21 ++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs index b5bade6..66cde91 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs @@ -567,6 +567,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid foreach (GridRegion r in m_HyperlinkRegions.Values) if (r.RegionHandle == handle) return r; + foreach (GridRegion r in m_knownRegions.Values) + if (r.RegionHandle == handle) + return r; return null; } @@ -575,7 +578,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid foreach (GridRegion r in m_HyperlinkRegions.Values) if ((r.RegionHandle == handle) && (m_HyperlinkHandles.ContainsKey(r.RegionID))) return m_HyperlinkHandles[r.RegionID]; - return 0; + return handle; } #endregion diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs index f27b2f9..adf747a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs @@ -42,6 +42,7 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes.Hypergrid; using OpenSim.Region.Framework.Scenes.Serialization; +using OpenSim.Services.Interfaces; using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion @@ -60,6 +61,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion protected RegionToRegionClient m_regionClient; + protected IHyperlinkService m_hyperlinkService; + protected bool m_safemode; protected IPAddress m_thisIP; @@ -135,7 +138,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion m_localBackend = new LocalInterregionComms(); m_commsManager = scene.CommsManager; m_aScene = scene; - m_regionClient = new RegionToRegionClient(m_aScene); + m_hyperlinkService = m_aScene.RequestModuleInterface(); + m_regionClient = new RegionToRegionClient(m_aScene, m_hyperlinkService); m_thisIP = Util.GetHostFromDNS(scene.RegionInfo.ExternalHostName); } @@ -789,16 +793,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion protected class RegionToRegionClient : RegionClient { Scene m_aScene = null; + IHyperlinkService m_hyperlinkService; - public RegionToRegionClient(Scene s) + public RegionToRegionClient(Scene s, IHyperlinkService hyperService) { m_aScene = s; + m_hyperlinkService = hyperService; } public override ulong GetRegionHandle(ulong handle) { if (m_aScene.SceneGridService is HGSceneCommunicationService) - return ((HGSceneCommunicationService)(m_aScene.SceneGridService)).m_hg.FindRegionHandle(handle); + { + if (m_hyperlinkService != null) + return m_hyperlinkService.FindRegionHandle(handle); + } return handle; } @@ -806,8 +815,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion public override bool IsHyperlink(ulong handle) { if (m_aScene.SceneGridService is HGSceneCommunicationService) - return ((HGSceneCommunicationService)(m_aScene.SceneGridService)).m_hg.IsHyperlinkRegion(handle); - + { + if ((m_hyperlinkService != null) && (m_hyperlinkService.GetHyperlinkRegion(handle) != null)) + return true; + } return false; } -- cgit v1.1