diff options
author | Diva Canto | 2010-01-27 08:00:29 -0800 |
---|---|---|
committer | Diva Canto | 2010-01-27 08:00:29 -0800 |
commit | 7c00469cd210cfdda3dd835867469159d4c8b9d9 (patch) | |
tree | 11dc9aa7d60ce0067c44d37ec3a0638753441cb7 /OpenSim/Services | |
parent | Added image for hyperlink map tiles. (diff) | |
download | opensim-SC_OLD-7c00469cd210cfdda3dd835867469159d4c8b9d9.zip opensim-SC_OLD-7c00469cd210cfdda3dd835867469159d4c8b9d9.tar.gz opensim-SC_OLD-7c00469cd210cfdda3dd835867469159d4c8b9d9.tar.bz2 opensim-SC_OLD-7c00469cd210cfdda3dd835867469159d4c8b9d9.tar.xz |
Added ExternalName config on Gatekeeper.
Diffstat (limited to 'OpenSim/Services')
4 files changed, 24 insertions, 8 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index ae0a0b6..5ad1af2 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | |||
@@ -45,11 +45,12 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
45 | return "/foreignobject/"; | 45 | return "/foreignobject/"; |
46 | } | 46 | } |
47 | 47 | ||
48 | public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string imageURL, out string reason) | 48 | public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason) |
49 | { | 49 | { |
50 | regionID = UUID.Zero; | 50 | regionID = UUID.Zero; |
51 | imageURL = string.Empty; | 51 | imageURL = string.Empty; |
52 | realHandle = 0; | 52 | realHandle = 0; |
53 | externalName = string.Empty; | ||
53 | reason = string.Empty; | 54 | reason = string.Empty; |
54 | 55 | ||
55 | Hashtable hash = new Hashtable(); | 56 | Hashtable hash = new Hashtable(); |
@@ -97,9 +98,9 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
97 | //m_log.Debug(">> HERE, realHandle: " + realHandle); | 98 | //m_log.Debug(">> HERE, realHandle: " + realHandle); |
98 | } | 99 | } |
99 | if (hash["region_image"] != null) | 100 | if (hash["region_image"] != null) |
100 | { | ||
101 | imageURL = (string)hash["region_image"]; | 101 | imageURL = (string)hash["region_image"]; |
102 | } | 102 | if (hash["external_name"] != null) |
103 | externalName = (string)hash["external_name"]; | ||
103 | } | 104 | } |
104 | 105 | ||
105 | } | 106 | } |
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 1289cf6..cda7dae 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs | |||
@@ -214,8 +214,9 @@ namespace OpenSim.Services.GridService | |||
214 | // Finally, link it | 214 | // Finally, link it |
215 | ulong handle = 0; | 215 | ulong handle = 0; |
216 | UUID regionID = UUID.Zero; | 216 | UUID regionID = UUID.Zero; |
217 | string externalName = string.Empty; | ||
217 | string imageURL = string.Empty; | 218 | string imageURL = string.Empty; |
218 | if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out imageURL, out reason)) | 219 | if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out externalName, out imageURL, out reason)) |
219 | return false; | 220 | return false; |
220 | 221 | ||
221 | if (regionID != UUID.Zero) | 222 | if (regionID != UUID.Zero) |
@@ -229,11 +230,22 @@ namespace OpenSim.Services.GridService | |||
229 | } | 230 | } |
230 | 231 | ||
231 | regInfo.RegionID = regionID; | 232 | regInfo.RegionID = regionID; |
233 | Uri uri = null; | ||
234 | try | ||
235 | { | ||
236 | uri = new Uri(externalName); | ||
237 | regInfo.ExternalHostName = uri.Host; | ||
238 | regInfo.HttpPort = (uint)uri.Port; | ||
239 | } | ||
240 | catch | ||
241 | { | ||
242 | m_log.WarnFormat("[HYPERGRID LINKER]: Remote Gatekeeper at {0} provided malformed ExternalName {1}", regInfo.ExternalHostName, externalName); | ||
243 | } | ||
232 | regInfo.RegionName = regInfo.ExternalHostName + ":" + regInfo.HttpPort + ":" + regInfo.RegionName; | 244 | regInfo.RegionName = regInfo.ExternalHostName + ":" + regInfo.HttpPort + ":" + regInfo.RegionName; |
233 | // Try get the map image | 245 | // Try get the map image |
234 | regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL); | 246 | //regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL); |
235 | // I need a texture that works for this... the one I tried doesn't seem to be working | 247 | // I need a texture that works for this... the one I tried doesn't seem to be working |
236 | //regInfo.TerrainImage = m_HGMapImage; | 248 | regInfo.TerrainImage = m_HGMapImage; |
237 | 249 | ||
238 | AddHyperlinkRegion(regInfo, handle); | 250 | AddHyperlinkRegion(regInfo, handle); |
239 | m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID); | 251 | m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID); |
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 283ab3e..3cb5d50 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs | |||
@@ -59,6 +59,7 @@ namespace OpenSim.Services.HypergridService | |||
59 | 59 | ||
60 | UUID m_ScopeID; | 60 | UUID m_ScopeID; |
61 | bool m_AllowTeleportsToAnyRegion; | 61 | bool m_AllowTeleportsToAnyRegion; |
62 | string m_ExternalName; | ||
62 | GridRegion m_DefaultGatewayRegion; | 63 | GridRegion m_DefaultGatewayRegion; |
63 | 64 | ||
64 | public GatekeeperService(IConfigSource config, ISimulationService simService) | 65 | public GatekeeperService(IConfigSource config, ISimulationService simService) |
@@ -83,6 +84,7 @@ namespace OpenSim.Services.HypergridService | |||
83 | UUID.TryParse(scope, out m_ScopeID); | 84 | UUID.TryParse(scope, out m_ScopeID); |
84 | //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); | 85 | //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); |
85 | m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); | 86 | m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); |
87 | m_ExternalName = serverConfig.GetString("ExternalName", string.Empty); | ||
86 | 88 | ||
87 | Object[] args = new Object[] { config }; | 89 | Object[] args = new Object[] { config }; |
88 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | 90 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); |
@@ -109,10 +111,11 @@ namespace OpenSim.Services.HypergridService | |||
109 | { | 111 | { |
110 | } | 112 | } |
111 | 113 | ||
112 | public bool LinkRegion(string regionName, out UUID regionID, out ulong regionHandle, out string imageURL, out string reason) | 114 | public bool LinkRegion(string regionName, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason) |
113 | { | 115 | { |
114 | regionID = UUID.Zero; | 116 | regionID = UUID.Zero; |
115 | regionHandle = 0; | 117 | regionHandle = 0; |
118 | externalName = m_ExternalName; | ||
116 | imageURL = string.Empty; | 119 | imageURL = string.Empty; |
117 | reason = string.Empty; | 120 | reason = string.Empty; |
118 | 121 | ||
diff --git a/OpenSim/Services/Interfaces/IGatekeeperService.cs b/OpenSim/Services/Interfaces/IGatekeeperService.cs index 5b5c9d1..f8eb817 100644 --- a/OpenSim/Services/Interfaces/IGatekeeperService.cs +++ b/OpenSim/Services/Interfaces/IGatekeeperService.cs | |||
@@ -36,7 +36,7 @@ namespace OpenSim.Services.Interfaces | |||
36 | { | 36 | { |
37 | public interface IGatekeeperService | 37 | public interface IGatekeeperService |
38 | { | 38 | { |
39 | bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string imageURL, out string reason); | 39 | bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason); |
40 | GridRegion GetHyperlinkRegion(UUID regionID); | 40 | GridRegion GetHyperlinkRegion(UUID regionID); |
41 | 41 | ||
42 | bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason); | 42 | bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason); |