diff options
author | UbitUmarov | 2019-09-02 22:48:06 +0100 |
---|---|---|
committer | UbitUmarov | 2019-09-02 22:48:42 +0100 |
commit | ae130d9f25de9d46038270337ddc967e0e8ab1d9 (patch) | |
tree | 4b461ef6e616f37eff5c1d6190d4f1820d173c08 /OpenSim/Region | |
parent | mantis 8585 change assets README (diff) | |
download | opensim-SC-ae130d9f25de9d46038270337ddc967e0e8ab1d9.zip opensim-SC-ae130d9f25de9d46038270337ddc967e0e8ab1d9.tar.gz opensim-SC-ae130d9f25de9d46038270337ddc967e0e8ab1d9.tar.bz2 opensim-SC-ae130d9f25de9d46038270337ddc967e0e8ab1d9.tar.xz |
mantis 8580: make some changes on regions find code. (only gatekeeper
host is used on local grid detection, not its port)
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index ee17093..cd67d88 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | |||
@@ -52,7 +52,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
52 | MethodBase.GetCurrentMethod().DeclaringType); | 52 | MethodBase.GetCurrentMethod().DeclaringType); |
53 | 53 | ||
54 | private bool m_Enabled = false; | 54 | private bool m_Enabled = false; |
55 | private string m_ThisGatekeeper = string.Empty; | 55 | private string m_ThisGatekeeperURI = string.Empty; |
56 | private string m_ThisGatekeeperHost = string.Empty; | ||
57 | private string m_ThisGatekeeperIP = string.Empty; | ||
56 | 58 | ||
57 | private IGridService m_LocalGridService; | 59 | private IGridService m_LocalGridService; |
58 | private IGridService m_RemoteGridService; | 60 | private IGridService m_RemoteGridService; |
@@ -126,13 +128,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
126 | if(m_RegionInfoCache == null) | 128 | if(m_RegionInfoCache == null) |
127 | m_RegionInfoCache = new RegionInfoCache(); | 129 | m_RegionInfoCache = new RegionInfoCache(); |
128 | 130 | ||
129 | m_ThisGatekeeper = Util.GetConfigVarFromSections<string>(source, "GatekeeperURI", | 131 | m_ThisGatekeeperURI = Util.GetConfigVarFromSections<string>(source, "GatekeeperURI", |
130 | new string[] { "Startup", "Hypergrid", "GridService" }, String.Empty); | 132 | new string[] { "Startup", "Hypergrid", "GridService" }, String.Empty); |
131 | // Legacy. Remove soon! | 133 | // Legacy. Remove soon! |
132 | m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", m_ThisGatekeeper); | 134 | m_ThisGatekeeperURI = gridConfig.GetString("Gatekeeper", m_ThisGatekeeperURI); |
133 | |||
134 | Util.checkServiceURI(m_ThisGatekeeper, out m_ThisGatekeeper); | ||
135 | 135 | ||
136 | Util.checkServiceURI(m_ThisGatekeeperURI, out m_ThisGatekeeperURI, out m_ThisGatekeeperHost, out m_ThisGatekeeperIP); | ||
136 | return true; | 137 | return true; |
137 | } | 138 | } |
138 | 139 | ||
@@ -247,14 +248,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
247 | string regionName = name; | 248 | string regionName = name; |
248 | if(name.Contains(".")) | 249 | if(name.Contains(".")) |
249 | { | 250 | { |
250 | if(string.IsNullOrWhiteSpace(m_ThisGatekeeper)) | 251 | if(string.IsNullOrWhiteSpace(m_ThisGatekeeperIP)) |
251 | return rinfo; // no HG | 252 | return rinfo; // no HG |
252 | 253 | ||
253 | string regionURI = ""; | 254 | string regionURI = ""; |
254 | if(!Util.buildHGRegionURI(name, out regionURI, out regionName) || string.IsNullOrWhiteSpace(regionName)) | 255 | string regionHost = ""; |
256 | if (!Util.buildHGRegionURI(name, out regionURI, out regionHost, out regionName)) | ||
255 | return rinfo; // invalid | 257 | return rinfo; // invalid |
256 | if(m_ThisGatekeeper != regionURI) | 258 | if (!m_ThisGatekeeperHost.Equals(regionHost, StringComparison.InvariantCultureIgnoreCase) && !m_ThisGatekeeperIP.Equals(regionHost)) |
257 | return rinfo; // not local grid | 259 | return rinfo; // not local grid |
260 | if (String.IsNullOrEmpty(regionName)) | ||
261 | return m_RemoteGridService.GetDefaultRegions(scopeID)[0]; | ||
258 | } | 262 | } |
259 | 263 | ||
260 | rinfo = m_RemoteGridService.GetRegionByName(scopeID, regionName); | 264 | rinfo = m_RemoteGridService.GetRegionByName(scopeID, regionName); |
@@ -273,17 +277,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
273 | string regionName = name; | 277 | string regionName = name; |
274 | if(name.Contains(".")) | 278 | if(name.Contains(".")) |
275 | { | 279 | { |
276 | if(string.IsNullOrWhiteSpace(m_ThisGatekeeper)) | 280 | if(string.IsNullOrWhiteSpace(m_ThisGatekeeperURI)) |
277 | return rinfo; // no HG | 281 | return rinfo; // no HG |
278 | 282 | ||
279 | string regionURI = ""; | 283 | string regionURI = ""; |
280 | if(!Util.buildHGRegionURI(name, out regionURI, out regionName) || string.IsNullOrWhiteSpace(regionName)) | 284 | string regionHost = ""; |
285 | if (!Util.buildHGRegionURI(name, out regionURI, out regionHost, out regionName)) | ||
281 | return rinfo; // invalid | 286 | return rinfo; // invalid |
282 | if(m_ThisGatekeeper != regionURI) | 287 | if (!m_ThisGatekeeperHost.Equals(regionHost, StringComparison.InvariantCultureIgnoreCase) && !m_ThisGatekeeperIP.Equals(regionHost)) |
283 | return rinfo; // not local grid | 288 | return rinfo; // not local grid |
284 | } | 289 | } |
285 | 290 | ||
286 | List<GridRegion> grinfo = m_RemoteGridService.GetRegionsByName(scopeID, regionName, maxNumber); | 291 | List<GridRegion> grinfo = null; |
292 | if (String.IsNullOrEmpty(regionName)) | ||
293 | grinfo = m_RemoteGridService.GetDefaultRegions(scopeID); | ||
294 | else | ||
295 | grinfo = m_RemoteGridService.GetRegionsByName(scopeID, regionName, maxNumber); | ||
287 | 296 | ||
288 | if (grinfo != null) | 297 | if (grinfo != null) |
289 | { | 298 | { |