diff options
More redirects to HGGridConnector-as-HyperlinkService.
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs | 21 |
1 files changed, 16 insertions, 5 deletions
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; | |||
42 | using OpenSim.Region.Framework.Scenes; | 42 | using OpenSim.Region.Framework.Scenes; |
43 | using OpenSim.Region.Framework.Scenes.Hypergrid; | 43 | using OpenSim.Region.Framework.Scenes.Hypergrid; |
44 | using OpenSim.Region.Framework.Scenes.Serialization; | 44 | using OpenSim.Region.Framework.Scenes.Serialization; |
45 | using OpenSim.Services.Interfaces; | ||
45 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 46 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
46 | 47 | ||
47 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | 48 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion |
@@ -60,6 +61,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
60 | 61 | ||
61 | protected RegionToRegionClient m_regionClient; | 62 | protected RegionToRegionClient m_regionClient; |
62 | 63 | ||
64 | protected IHyperlinkService m_hyperlinkService; | ||
65 | |||
63 | protected bool m_safemode; | 66 | protected bool m_safemode; |
64 | protected IPAddress m_thisIP; | 67 | protected IPAddress m_thisIP; |
65 | 68 | ||
@@ -135,7 +138,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
135 | m_localBackend = new LocalInterregionComms(); | 138 | m_localBackend = new LocalInterregionComms(); |
136 | m_commsManager = scene.CommsManager; | 139 | m_commsManager = scene.CommsManager; |
137 | m_aScene = scene; | 140 | m_aScene = scene; |
138 | m_regionClient = new RegionToRegionClient(m_aScene); | 141 | m_hyperlinkService = m_aScene.RequestModuleInterface<IHyperlinkService>(); |
142 | m_regionClient = new RegionToRegionClient(m_aScene, m_hyperlinkService); | ||
139 | m_thisIP = Util.GetHostFromDNS(scene.RegionInfo.ExternalHostName); | 143 | m_thisIP = Util.GetHostFromDNS(scene.RegionInfo.ExternalHostName); |
140 | } | 144 | } |
141 | 145 | ||
@@ -789,16 +793,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
789 | protected class RegionToRegionClient : RegionClient | 793 | protected class RegionToRegionClient : RegionClient |
790 | { | 794 | { |
791 | Scene m_aScene = null; | 795 | Scene m_aScene = null; |
796 | IHyperlinkService m_hyperlinkService; | ||
792 | 797 | ||
793 | public RegionToRegionClient(Scene s) | 798 | public RegionToRegionClient(Scene s, IHyperlinkService hyperService) |
794 | { | 799 | { |
795 | m_aScene = s; | 800 | m_aScene = s; |
801 | m_hyperlinkService = hyperService; | ||
796 | } | 802 | } |
797 | 803 | ||
798 | public override ulong GetRegionHandle(ulong handle) | 804 | public override ulong GetRegionHandle(ulong handle) |
799 | { | 805 | { |
800 | if (m_aScene.SceneGridService is HGSceneCommunicationService) | 806 | if (m_aScene.SceneGridService is HGSceneCommunicationService) |
801 | return ((HGSceneCommunicationService)(m_aScene.SceneGridService)).m_hg.FindRegionHandle(handle); | 807 | { |
808 | if (m_hyperlinkService != null) | ||
809 | return m_hyperlinkService.FindRegionHandle(handle); | ||
810 | } | ||
802 | 811 | ||
803 | return handle; | 812 | return handle; |
804 | } | 813 | } |
@@ -806,8 +815,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
806 | public override bool IsHyperlink(ulong handle) | 815 | public override bool IsHyperlink(ulong handle) |
807 | { | 816 | { |
808 | if (m_aScene.SceneGridService is HGSceneCommunicationService) | 817 | if (m_aScene.SceneGridService is HGSceneCommunicationService) |
809 | return ((HGSceneCommunicationService)(m_aScene.SceneGridService)).m_hg.IsHyperlinkRegion(handle); | 818 | { |
810 | 819 | if ((m_hyperlinkService != null) && (m_hyperlinkService.GetHyperlinkRegion(handle) != null)) | |
820 | return true; | ||
821 | } | ||
811 | return false; | 822 | return false; |
812 | } | 823 | } |
813 | 824 | ||