diff options
author | Diva Canto | 2011-03-28 19:34:55 -0700 |
---|---|---|
committer | Diva Canto | 2011-03-28 19:34:55 -0700 |
commit | 309eb712a32fe14f593941b9f0a5ce41f10bcd7f (patch) | |
tree | efbc8efc6651beeaccb9ba14302d299d40ffe97b /OpenSim/Services/GridService/HypergridLinker.cs | |
parent | Added code to load a terrain tile of tiff/jpg format. Previously it only work... (diff) | |
download | opensim-SC-309eb712a32fe14f593941b9f0a5ce41f10bcd7f.zip opensim-SC-309eb712a32fe14f593941b9f0a5ce41f10bcd7f.tar.gz opensim-SC-309eb712a32fe14f593941b9f0a5ce41f10bcd7f.tar.bz2 opensim-SC-309eb712a32fe14f593941b9f0a5ce41f10bcd7f.tar.xz |
Improvement over 2 commits ago: make the hyperlink check understand port 80.
Diffstat (limited to 'OpenSim/Services/GridService/HypergridLinker.cs')
-rw-r--r-- | OpenSim/Services/GridService/HypergridLinker.cs | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 585d088..c539047 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs | |||
@@ -66,6 +66,7 @@ namespace OpenSim.Services.GridService | |||
66 | protected bool m_Check4096 = true; | 66 | protected bool m_Check4096 = true; |
67 | protected string m_MapTileDirectory = string.Empty; | 67 | protected string m_MapTileDirectory = string.Empty; |
68 | protected string m_ThisGatekeeper = string.Empty; | 68 | protected string m_ThisGatekeeper = string.Empty; |
69 | protected Uri m_ThisGatekeeperURI = null; | ||
69 | 70 | ||
70 | // Hyperlink regions are hyperlinks on the map | 71 | // Hyperlink regions are hyperlinks on the map |
71 | public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>(); | 72 | public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>(); |
@@ -125,6 +126,14 @@ namespace OpenSim.Services.GridService | |||
125 | m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles"); | 126 | m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles"); |
126 | 127 | ||
127 | m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty); | 128 | m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty); |
129 | try | ||
130 | { | ||
131 | m_ThisGatekeeperURI = new Uri(m_ThisGatekeeper); | ||
132 | } | ||
133 | catch | ||
134 | { | ||
135 | m_log.WarnFormat("[HYPERGRID LINKER]: Malformed URL in [GridService], variable Gatekeeper = {0}", m_ThisGatekeeper); | ||
136 | } | ||
128 | 137 | ||
129 | m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); | 138 | m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); |
130 | 139 | ||
@@ -249,6 +258,8 @@ namespace OpenSim.Services.GridService | |||
249 | remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize); | 258 | remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize); |
250 | 259 | ||
251 | reason = string.Empty; | 260 | reason = string.Empty; |
261 | Uri uri = null; | ||
262 | |||
252 | regInfo = new GridRegion(); | 263 | regInfo = new GridRegion(); |
253 | if ( externalPort > 0) | 264 | if ( externalPort > 0) |
254 | regInfo.HttpPort = externalPort; | 265 | regInfo.HttpPort = externalPort; |
@@ -259,8 +270,17 @@ namespace OpenSim.Services.GridService | |||
259 | else | 270 | else |
260 | regInfo.ExternalHostName = "0.0.0.0"; | 271 | regInfo.ExternalHostName = "0.0.0.0"; |
261 | if ( serverURI != null) | 272 | if ( serverURI != null) |
273 | { | ||
262 | regInfo.ServerURI = serverURI; | 274 | regInfo.ServerURI = serverURI; |
263 | 275 | try | |
276 | { | ||
277 | uri = new Uri(serverURI); | ||
278 | regInfo.ExternalHostName = uri.Host; | ||
279 | regInfo.HttpPort = (uint)uri.Port; | ||
280 | } | ||
281 | catch {} | ||
282 | } | ||
283 | |||
264 | if ( remoteRegionName != string.Empty ) | 284 | if ( remoteRegionName != string.Empty ) |
265 | regInfo.RegionName = remoteRegionName; | 285 | regInfo.RegionName = remoteRegionName; |
266 | 286 | ||
@@ -270,11 +290,16 @@ namespace OpenSim.Services.GridService | |||
270 | regInfo.EstateOwner = ownerID; | 290 | regInfo.EstateOwner = ownerID; |
271 | 291 | ||
272 | // Make sure we're not hyperlinking to regions on this grid! | 292 | // Make sure we're not hyperlinking to regions on this grid! |
273 | if (regInfo.ServerURI.Trim(new char[]{'/', ' '}) == m_ThisGatekeeper.Trim(new char[]{'/', ' '})) | 293 | if (m_ThisGatekeeperURI != null) |
274 | { | 294 | { |
275 | reason = "Cannot hyperlink to regions on the same grid"; | 295 | if (regInfo.ExternalHostName == m_ThisGatekeeperURI.Host && regInfo.HttpPort == m_ThisGatekeeperURI.Port) |
276 | return false; | 296 | { |
297 | reason = "Cannot hyperlink to regions on the same grid"; | ||
298 | return false; | ||
299 | } | ||
277 | } | 300 | } |
301 | else | ||
302 | m_log.WarnFormat("[HYPERGRID LINKER]: Please set this grid's Gatekeeper's address in [GridService]!"); | ||
278 | 303 | ||
279 | // Check for free coordinates | 304 | // Check for free coordinates |
280 | GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY); | 305 | GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY); |