aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/GridService
diff options
context:
space:
mode:
authorTom2011-09-04 07:06:36 -0700
committerTom2011-09-04 07:06:36 -0700
commit66dec3b8742eff04fbbcc6e3249fe4ba87986500 (patch)
tree76cc708a821d35fac5cdbbce2de304b47064e732 /OpenSim/Services/GridService
parentGuard another nullref (diff)
parentFixed BulletSim config files for Linux *.so libraries. (diff)
downloadopensim-SC_OLD-66dec3b8742eff04fbbcc6e3249fe4ba87986500.zip
opensim-SC_OLD-66dec3b8742eff04fbbcc6e3249fe4ba87986500.tar.gz
opensim-SC_OLD-66dec3b8742eff04fbbcc6e3249fe4ba87986500.tar.bz2
opensim-SC_OLD-66dec3b8742eff04fbbcc6e3249fe4ba87986500.tar.xz
Resolve merge commits, stage 1
Diffstat (limited to 'OpenSim/Services/GridService')
-rw-r--r--OpenSim/Services/GridService/GridService.cs38
1 files changed, 30 insertions, 8 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 985d77b..0a4372a 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -320,18 +320,25 @@ namespace OpenSim.Services.GridService
320 return null; 320 return null;
321 } 321 }
322 322
323 public GridRegion GetRegionByName(UUID scopeID, string regionName) 323 public GridRegion GetRegionByName(UUID scopeID, string name)
324 { 324 {
325 List<RegionData> rdatas = m_Database.Get(regionName + "%", scopeID); 325 List<RegionData> rdatas = m_Database.Get(name, scopeID);
326 if ((rdatas != null) && (rdatas.Count > 0)) 326 if ((rdatas != null) && (rdatas.Count > 0))
327 return RegionData2RegionInfo(rdatas[0]); // get the first 327 return RegionData2RegionInfo(rdatas[0]); // get the first
328 328
329 if (m_AllowHypergridMapSearch)
330 {
331 GridRegion r = GetHypergridRegionByName(scopeID, name);
332 if (r != null)
333 return r;
334 }
335
329 return null; 336 return null;
330 } 337 }
331 338
332 public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber) 339 public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
333 { 340 {
334 m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); 341// m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name);
335 342
336 List<RegionData> rdatas = m_Database.Get(name + "%", scopeID); 343 List<RegionData> rdatas = m_Database.Get(name + "%", scopeID);
337 344
@@ -340,7 +347,7 @@ namespace OpenSim.Services.GridService
340 347
341 if (rdatas != null) 348 if (rdatas != null)
342 { 349 {
343 m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count); 350// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
344 foreach (RegionData rdata in rdatas) 351 foreach (RegionData rdata in rdatas)
345 { 352 {
346 if (count++ < maxNumber) 353 if (count++ < maxNumber)
@@ -348,9 +355,9 @@ namespace OpenSim.Services.GridService
348 } 355 }
349 } 356 }
350 357
351 if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0)) && name.Contains(".")) 358 if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0)))
352 { 359 {
353 GridRegion r = m_HypergridLinker.LinkRegion(scopeID, name); 360 GridRegion r = GetHypergridRegionByName(scopeID, name);
354 if (r != null) 361 if (r != null)
355 rinfos.Add(r); 362 rinfos.Add(r);
356 } 363 }
@@ -358,6 +365,20 @@ namespace OpenSim.Services.GridService
358 return rinfos; 365 return rinfos;
359 } 366 }
360 367
368 /// <summary>
369 /// Get a hypergrid region.
370 /// </summary>
371 /// <param name="scopeID"></param>
372 /// <param name="name"></param>
373 /// <returns>null if no hypergrid region could be found.</returns>
374 protected GridRegion GetHypergridRegionByName(UUID scopeID, string name)
375 {
376 if (name.Contains("."))
377 return m_HypergridLinker.LinkRegion(scopeID, name);
378 else
379 return null;
380 }
381
361 public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) 382 public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
362 { 383 {
363 int xminSnap = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize; 384 int xminSnap = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize;
@@ -489,8 +510,9 @@ namespace OpenSim.Services.GridService
489 OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]); 510 OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]);
490 MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} {5}\n\n", 511 MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} {5}\n\n",
491 r.RegionName, r.RegionID, 512 r.RegionName, r.RegionID,
492 String.Format("{0},{1}", r.posX, r.posY), r.Data["serverURI"], 513 String.Format("{0},{1}", r.posX / Constants.RegionSize, r.posY / Constants.RegionSize),
493 r.Data["owner_uuid"].ToString(), flags.ToString())); 514 r.Data["serverURI"],
515 r.Data["owner_uuid"], flags));
494 } 516 }
495 return; 517 return;
496 } 518 }