diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/GridService/HypergridLinker.cs | 44 |
1 files changed, 9 insertions, 35 deletions
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index c02c813..e0d8103 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs | |||
@@ -180,44 +180,18 @@ namespace OpenSim.Services.GridService | |||
180 | public GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, UUID ownerID, out string reason) | 180 | public GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, UUID ownerID, out string reason) |
181 | { | 181 | { |
182 | reason = string.Empty; | 182 | reason = string.Empty; |
183 | string host = "127.0.0.1"; | ||
184 | string portstr; | ||
185 | string regionName = ""; | ||
186 | uint port = 0; | 183 | uint port = 0; |
187 | string[] parts = mapName.Split(new char[] { ':' }); | 184 | string[] parts = mapName.Split(new char[] {':'}); |
188 | if (parts.Length >= 1) | 185 | string regionName = String.Empty; |
186 | if (parts.Length > 1) | ||
189 | { | 187 | { |
190 | host = parts[0]; | 188 | regionName = mapName.Substring(parts[0].Length + 1); |
189 | regionName = regionName.Trim(new char[] {'"'}); | ||
191 | } | 190 | } |
192 | if (parts.Length >= 2) | ||
193 | { | ||
194 | portstr = parts[1]; | ||
195 | //m_log.Debug("-- port = " + portstr); | ||
196 | if (!UInt32.TryParse(portstr, out port)) | ||
197 | regionName = parts[1]; | ||
198 | } | ||
199 | // always take the last one | ||
200 | if (parts.Length >= 3) | ||
201 | { | ||
202 | regionName = parts[2]; | ||
203 | } | ||
204 | |||
205 | //// Sanity check. | ||
206 | //try | ||
207 | //{ | ||
208 | // Util.GetHostFromDNS(host); | ||
209 | //} | ||
210 | //catch | ||
211 | //{ | ||
212 | // reason = "Malformed hostname"; | ||
213 | // return null; | ||
214 | //} | ||
215 | |||
216 | GridRegion regInfo; | 191 | GridRegion regInfo; |
217 | bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, ownerID, out regInfo, out reason); | 192 | if (TryCreateLink(scopeID, xloc, yloc, regionName, 0, null, parts[0], ownerID, out regInfo, out reason)) |
218 | if (success) | ||
219 | { | 193 | { |
220 | regInfo.RegionName = mapName; | 194 | regInfo.RegionName = mapName; |
221 | return regInfo; | 195 | return regInfo; |
222 | } | 196 | } |
223 | 197 | ||
@@ -313,9 +287,9 @@ namespace OpenSim.Services.GridService | |||
313 | 287 | ||
314 | regInfo.RegionID = regionID; | 288 | regInfo.RegionID = regionID; |
315 | 289 | ||
316 | if ( externalName == string.Empty ) | 290 | if (externalName == string.Empty) |
317 | regInfo.RegionName = regInfo.ServerURI; | 291 | regInfo.RegionName = regInfo.ServerURI; |
318 | else | 292 | else |
319 | regInfo.RegionName = externalName; | 293 | regInfo.RegionName = externalName; |
320 | 294 | ||
321 | m_log.Debug("[HYPERGRID LINKER]: naming linked region " + regInfo.RegionName); | 295 | m_log.Debug("[HYPERGRID LINKER]: naming linked region " + regInfo.RegionName); |