aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/GridService
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/GridService')
-rw-r--r--OpenSim/Services/GridService/GridService.cs12
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs46
2 files changed, 21 insertions, 37 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 125c2be..985d77b 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -271,6 +271,7 @@ namespace OpenSim.Services.GridService
271 { 271 {
272 List<GridRegion> rinfos = new List<GridRegion>(); 272 List<GridRegion> rinfos = new List<GridRegion>();
273 RegionData region = m_Database.Get(regionID, scopeID); 273 RegionData region = m_Database.Get(regionID, scopeID);
274
274 if (region != null) 275 if (region != null)
275 { 276 {
276 // Not really? Maybe? 277 // Not really? Maybe?
@@ -278,15 +279,24 @@ namespace OpenSim.Services.GridService
278 region.posX + (int)Constants.RegionSize + 1, region.posY + (int)Constants.RegionSize + 1, scopeID); 279 region.posX + (int)Constants.RegionSize + 1, region.posY + (int)Constants.RegionSize + 1, scopeID);
279 280
280 foreach (RegionData rdata in rdatas) 281 foreach (RegionData rdata in rdatas)
282 {
281 if (rdata.RegionID != regionID) 283 if (rdata.RegionID != regionID)
282 { 284 {
283 int flags = Convert.ToInt32(rdata.Data["flags"]); 285 int flags = Convert.ToInt32(rdata.Data["flags"]);
284 if ((flags & (int)Data.RegionFlags.Hyperlink) == 0) // no hyperlinks as neighbours 286 if ((flags & (int)Data.RegionFlags.Hyperlink) == 0) // no hyperlinks as neighbours
285 rinfos.Add(RegionData2RegionInfo(rdata)); 287 rinfos.Add(RegionData2RegionInfo(rdata));
286 } 288 }
289 }
287 290
291 m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighbours", region.RegionName, rinfos.Count);
288 } 292 }
289 m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighours", region.RegionName, rinfos.Count); 293 else
294 {
295 m_log.WarnFormat(
296 "[GRID SERVICE]: GetNeighbours() called for scope {0}, region {1} but no such region found",
297 scopeID, regionID);
298 }
299
290 return rinfos; 300 return rinfos;
291 } 301 }
292 302
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index c02c813..a4aa44d 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -121,7 +121,7 @@ namespace OpenSim.Services.GridService
121 121
122 m_Check4096 = gridConfig.GetBoolean("Check4096", true); 122 m_Check4096 = gridConfig.GetBoolean("Check4096", true);
123 123
124 m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", string.Empty); 124 m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles");
125 125
126 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); 126 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
127 127
@@ -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);