aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/GridService/GridService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/GridService/GridService.cs')
-rw-r--r--OpenSim/Services/GridService/GridService.cs294
1 files changed, 148 insertions, 146 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 0c502a2..a5c7d34 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -57,8 +57,6 @@ namespace OpenSim.Services.GridService
57 protected bool m_AllowDuplicateNames = false; 57 protected bool m_AllowDuplicateNames = false;
58 protected bool m_AllowHypergridMapSearch = false; 58 protected bool m_AllowHypergridMapSearch = false;
59 59
60 protected bool m_SuppressVarregionOverlapCheckOnRegistration = false;
61
62 private static Dictionary<string,object> m_ExtraFeatures = new Dictionary<string, object>(); 60 private static Dictionary<string,object> m_ExtraFeatures = new Dictionary<string, object>();
63 61
64 public GridService(IConfigSource config) 62 public GridService(IConfigSource config)
@@ -74,7 +72,7 @@ namespace OpenSim.Services.GridService
74 if (gridConfig != null) 72 if (gridConfig != null)
75 { 73 {
76 m_DeleteOnUnregister = gridConfig.GetBoolean("DeleteOnUnregister", true); 74 m_DeleteOnUnregister = gridConfig.GetBoolean("DeleteOnUnregister", true);
77 75
78 string authService = gridConfig.GetString("AuthenticationService", String.Empty); 76 string authService = gridConfig.GetString("AuthenticationService", String.Empty);
79 77
80 if (authService != String.Empty) 78 if (authService != String.Empty)
@@ -85,8 +83,6 @@ namespace OpenSim.Services.GridService
85 m_AllowDuplicateNames = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames); 83 m_AllowDuplicateNames = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames);
86 m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch); 84 m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch);
87 85
88 m_SuppressVarregionOverlapCheckOnRegistration = gridConfig.GetBoolean("SuppressVarregionOverlapCheckOnRegistration", m_SuppressVarregionOverlapCheckOnRegistration);
89
90 // This service is also used locally by a simulator running in grid mode. This switches prevents 86 // This service is also used locally by a simulator running in grid mode. This switches prevents
91 // inappropriate console commands from being registered 87 // inappropriate console commands from being registered
92 suppressConsoleCommands = gridConfig.GetBoolean("SuppressConsoleCommands", suppressConsoleCommands); 88 suppressConsoleCommands = gridConfig.GetBoolean("SuppressConsoleCommands", suppressConsoleCommands);
@@ -155,9 +151,9 @@ namespace OpenSim.Services.GridService
155 151
156 if (loginConfig == null || gridConfig == null) 152 if (loginConfig == null || gridConfig == null)
157 return; 153 return;
158 154
159 string configVal; 155 string configVal;
160 156
161 configVal = loginConfig.GetString("SearchURL", string.Empty); 157 configVal = loginConfig.GetString("SearchURL", string.Empty);
162 if (!string.IsNullOrEmpty(configVal)) 158 if (!string.IsNullOrEmpty(configVal))
163 m_ExtraFeatures["search-server-url"] = configVal; 159 m_ExtraFeatures["search-server-url"] = configVal;
@@ -201,15 +197,28 @@ namespace OpenSim.Services.GridService
201 if (regionInfos.RegionID == UUID.Zero) 197 if (regionInfos.RegionID == UUID.Zero)
202 return "Invalid RegionID - cannot be zero UUID"; 198 return "Invalid RegionID - cannot be zero UUID";
203 199
200 if (regionInfos.RegionLocY <= Constants.MaximumRegionSize)
201 return "Region location reserved for HG links coord Y must be higher than " + (Constants.MaximumRegionSize/256).ToString();
202
204 String reason = "Region overlaps another region"; 203 String reason = "Region overlaps another region";
205 RegionData region = FindAnyConflictingRegion(regionInfos, scopeID, out reason); 204
206 // If there is a conflicting region, if it has the same ID and same coordinates 205 List<RegionData> rdatas = m_Database.Get(
207 // then it is a region re-registering (permissions and ownership checked later). 206 regionInfos.RegionLocX,
208 if ((region != null) 207 regionInfos.RegionLocY,
209 && ( (region.coordX != regionInfos.RegionCoordX) 208 regionInfos.RegionLocX + regionInfos.RegionSizeX - 1,
210 || (region.coordY != regionInfos.RegionCoordY) 209 regionInfos.RegionLocY + regionInfos.RegionSizeY - 1 ,
211 || (region.RegionID != regionInfos.RegionID) ) 210 scopeID);
212 ) 211
212 RegionData region = null;
213 if(rdatas.Count > 1)
214 {
215 m_log.WarnFormat("{0} Register region overlaps with {1} regions", LogHeader, scopeID, rdatas.Count);
216 return reason;
217 }
218 else if(rdatas.Count == 1)
219 region = rdatas[0];
220
221 if ((region != null) && (region.RegionID != regionInfos.RegionID))
213 { 222 {
214 // If not same ID and same coordinates, this new region has conflicts and can't be registered. 223 // If not same ID and same coordinates, this new region has conflicts and can't be registered.
215 m_log.WarnFormat("{0} Register region conflict in scope {1}. {2}", LogHeader, scopeID, reason); 224 m_log.WarnFormat("{0} Register region conflict in scope {1}. {2}", LogHeader, scopeID, reason);
@@ -263,7 +272,7 @@ namespace OpenSim.Services.GridService
263 { 272 {
264 if (d.RegionID != regionInfos.RegionID) 273 if (d.RegionID != regionInfos.RegionID)
265 { 274 {
266 m_log.WarnFormat("[GRID SERVICE]: Region tried to register using a duplicate name. New region: {0} ({1}), existing region: {2} ({3}).", 275 m_log.WarnFormat("[GRID SERVICE]: Region tried to register using a duplicate name. New region: {0} ({1}), existing region: {2} ({3}).",
267 regionInfos.RegionName, regionInfos.RegionID, d.RegionName, d.RegionID); 276 regionInfos.RegionName, regionInfos.RegionID, d.RegionName, d.RegionID);
268 return "Duplicate region name"; 277 return "Duplicate region name";
269 } 278 }
@@ -273,7 +282,7 @@ namespace OpenSim.Services.GridService
273 282
274 // If there is an old record for us, delete it if it is elsewhere. 283 // If there is an old record for us, delete it if it is elsewhere.
275 region = m_Database.Get(regionInfos.RegionID, scopeID); 284 region = m_Database.Get(regionInfos.RegionID, scopeID);
276 if ((region != null) && (region.RegionID == regionInfos.RegionID) && 285 if ((region != null) && (region.RegionID == regionInfos.RegionID) &&
277 ((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY))) 286 ((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY)))
278 { 287 {
279 if ((Convert.ToInt32(region.Data["flags"]) & (int)OpenSim.Framework.RegionFlags.NoMove) != 0) 288 if ((Convert.ToInt32(region.Data["flags"]) & (int)OpenSim.Framework.RegionFlags.NoMove) != 0)
@@ -284,7 +293,7 @@ namespace OpenSim.Services.GridService
284 293
285 // Region reregistering in other coordinates. Delete the old entry 294 // Region reregistering in other coordinates. Delete the old entry
286 m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) was previously registered at {2}-{3}. Deleting old entry.", 295 m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) was previously registered at {2}-{3}. Deleting old entry.",
287 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY); 296 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionCoordX, regionInfos.RegionCoordY);
288 297
289 try 298 try
290 { 299 {
@@ -299,7 +308,7 @@ namespace OpenSim.Services.GridService
299 // Everything is ok, let's register 308 // Everything is ok, let's register
300 RegionData rdata = RegionInfo2RegionData(regionInfos); 309 RegionData rdata = RegionInfo2RegionData(regionInfos);
301 rdata.ScopeID = scopeID; 310 rdata.ScopeID = scopeID;
302 311
303 if (region != null) 312 if (region != null)
304 { 313 {
305 int oldFlags = Convert.ToInt32(region.Data["flags"]); 314 int oldFlags = Convert.ToInt32(region.Data["flags"]);
@@ -336,107 +345,15 @@ namespace OpenSim.Services.GridService
336 m_log.DebugFormat("[GRID SERVICE]: Database exception: {0}", e); 345 m_log.DebugFormat("[GRID SERVICE]: Database exception: {0}", e);
337 } 346 }
338 347
339 m_log.InfoFormat 348 m_log.DebugFormat
340 ("[GRID SERVICE]: Region {0} ({1}, {2}x{3}) registered at {4},{5} with flags {6}", 349 ("[GRID SERVICE]: Region {0} ({1}, {2}x{3}) registered at {4},{5} with flags {6}",
341 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionSizeX, regionInfos.RegionSizeY, 350 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionSizeX, regionInfos.RegionSizeY,
342 regionInfos.RegionCoordX, regionInfos.RegionCoordY, 351 regionInfos.RegionCoordX, regionInfos.RegionCoordY,
343 (OpenSim.Framework.RegionFlags)flags); 352 (OpenSim.Framework.RegionFlags)flags);
344 353
345 return String.Empty; 354 return String.Empty;
346 } 355 }
347 356
348 /// <summary>
349 /// Search the region map for regions conflicting with this region.
350 /// The region to be added is passed and we look for any existing regions that are
351 /// in the requested location, that are large varregions that overlap this region, or
352 /// are previously defined regions that would lie under this new region.
353 /// </summary>
354 /// <param name="regionInfos">Information on region requested to be added to the world map</param>
355 /// <param name="scopeID">Grid id for region</param>
356 /// <param name="reason">The reason the returned region conflicts with passed region</param>
357 /// <returns></returns>
358 private RegionData FindAnyConflictingRegion(GridRegion regionInfos, UUID scopeID, out string reason)
359 {
360 reason = "Reregistration";
361 // First see if there is an existing region right where this region is trying to go
362 // (We keep this result so it can be returned if suppressing errors)
363 RegionData noErrorRegion = m_Database.Get(regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID);
364 RegionData region = noErrorRegion;
365 if (region != null
366 && region.RegionID == regionInfos.RegionID
367 && region.sizeX == regionInfos.RegionSizeX
368 && region.sizeY == regionInfos.RegionSizeY)
369 {
370 // If this seems to be exactly the same region, return this as it could be
371 // a re-registration (permissions checked by calling routine).
372 m_log.DebugFormat("{0} FindAnyConflictingRegion: re-register of {1}",
373 LogHeader, RegionString(regionInfos));
374 return region;
375 }
376
377 // No region exactly there or we're resizing an existing region.
378 // Fetch regions that could be varregions overlapping requested location.
379 int xmin = regionInfos.RegionLocX - (int)Constants.MaximumRegionSize + 10;
380 int xmax = regionInfos.RegionLocX;
381 int ymin = regionInfos.RegionLocY - (int)Constants.MaximumRegionSize + 10;
382 int ymax = regionInfos.RegionLocY;
383 List<RegionData> rdatas = m_Database.Get(xmin, ymin, xmax, ymax, scopeID);
384 foreach (RegionData rdata in rdatas)
385 {
386 // m_log.DebugFormat("{0} FindAnyConflictingRegion: find existing. Checking {1}", LogHeader, RegionString(rdata) );
387 if ( (rdata.posX + rdata.sizeX > regionInfos.RegionLocX)
388 && (rdata.posY + rdata.sizeY > regionInfos.RegionLocY) )
389 {
390 region = rdata;
391 m_log.WarnFormat("{0} FindAnyConflictingRegion: conflict of {1} by existing varregion {2}",
392 LogHeader, RegionString(regionInfos), RegionString(region));
393 reason = String.Format("Region location is overlapped by existing varregion {0}",
394 RegionString(region));
395
396 if (m_SuppressVarregionOverlapCheckOnRegistration)
397 region = noErrorRegion;
398 return region;
399 }
400 }
401
402 // There isn't a region that overlaps this potential region.
403 // See if this potential region overlaps an existing region.
404 // First, a shortcut of not looking for overlap if new region is legacy region sized
405 // and connot overlap anything.
406 if (regionInfos.RegionSizeX != Constants.RegionSize
407 || regionInfos.RegionSizeY != Constants.RegionSize)
408 {
409 // trim range looked for so we don't pick up neighbor regions just off the edges
410 xmin = regionInfos.RegionLocX;
411 xmax = regionInfos.RegionLocX + regionInfos.RegionSizeX - 10;
412 ymin = regionInfos.RegionLocY;
413 ymax = regionInfos.RegionLocY + regionInfos.RegionSizeY - 10;
414 rdatas = m_Database.Get(xmin, ymin, xmax, ymax, scopeID);
415
416 // If the region is being resized, the found region could be ourself.
417 foreach (RegionData rdata in rdatas)
418 {
419 // m_log.DebugFormat("{0} FindAnyConflictingRegion: see if overlap. Checking {1}", LogHeader, RegionString(rdata) );
420 if (region == null || region.RegionID != regionInfos.RegionID)
421 {
422 region = rdata;
423 m_log.WarnFormat("{0} FindAnyConflictingRegion: conflict of varregion {1} overlaps existing region {2}",
424 LogHeader, RegionString(regionInfos), RegionString(region));
425 reason = String.Format("Region {0} would overlap existing region {1}",
426 RegionString(regionInfos), RegionString(region));
427
428 if (m_SuppressVarregionOverlapCheckOnRegistration)
429 region = noErrorRegion;
430 return region;
431 }
432 }
433 }
434
435 // If we get here, region is either null (nothing found here) or
436 // is the non-conflicting region found at the location being requested.
437 return region;
438 }
439
440 // String describing name and region location of passed region 357 // String describing name and region location of passed region
441 private String RegionString(RegionData reg) 358 private String RegionString(RegionData reg)
442 { 359 {
@@ -463,7 +380,7 @@ namespace OpenSim.Services.GridService
463 380
464 int flags = Convert.ToInt32(region.Data["flags"]); 381 int flags = Convert.ToInt32(region.Data["flags"]);
465 382
466 if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Framework.RegionFlags.Persistent) != 0) 383 if ((!m_DeleteOnUnregister) || ((flags & (int)OpenSim.Framework.RegionFlags.Persistent) != 0))
467 { 384 {
468 flags &= ~(int)OpenSim.Framework.RegionFlags.RegionOnline; 385 flags &= ~(int)OpenSim.Framework.RegionFlags.RegionOnline;
469 region.Data["flags"] = flags.ToString(); 386 region.Data["flags"] = flags.ToString();
@@ -478,7 +395,6 @@ namespace OpenSim.Services.GridService
478 } 395 }
479 396
480 return true; 397 return true;
481
482 } 398 }
483 399
484 return m_Database.Delete(regionID); 400 return m_Database.Delete(regionID);
@@ -488,13 +404,11 @@ namespace OpenSim.Services.GridService
488 { 404 {
489 List<GridRegion> rinfos = new List<GridRegion>(); 405 List<GridRegion> rinfos = new List<GridRegion>();
490 RegionData region = m_Database.Get(regionID, scopeID); 406 RegionData region = m_Database.Get(regionID, scopeID);
491 407
492 if (region != null) 408 if (region != null)
493 { 409 {
494 // Not really? Maybe?
495 // The adjacent regions are presumed to be the same size as the current region
496 List<RegionData> rdatas = m_Database.Get( 410 List<RegionData> rdatas = m_Database.Get(
497 region.posX - region.sizeX - 1, region.posY - region.sizeY - 1, 411 region.posX - 1, region.posY - 1,
498 region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID); 412 region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID);
499 413
500 foreach (RegionData rdata in rdatas) 414 foreach (RegionData rdata in rdatas)
@@ -516,10 +430,10 @@ namespace OpenSim.Services.GridService
516 else 430 else
517 { 431 {
518 m_log.WarnFormat( 432 m_log.WarnFormat(
519 "[GRID SERVICE]: GetNeighbours() called for scope {0}, region {1} but no such region found", 433 "[GRID SERVICE]: GetNeighbours() called for scope {0}, region {1} but no such region found",
520 scopeID, regionID); 434 scopeID, regionID);
521 } 435 }
522 436
523 return rinfos; 437 return rinfos;
524 } 438 }
525 439
@@ -537,6 +451,7 @@ namespace OpenSim.Services.GridService
537 // be the base coordinate of the region. 451 // be the base coordinate of the region.
538 // The snapping is technically unnecessary but is harmless because regions are always 452 // The snapping is technically unnecessary but is harmless because regions are always
539 // multiples of the legacy region size (256). 453 // multiples of the legacy region size (256).
454
540 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) 455 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
541 { 456 {
542 uint regionX = Util.WorldToRegionLoc((uint)x); 457 uint regionX = Util.WorldToRegionLoc((uint)x);
@@ -553,8 +468,8 @@ namespace OpenSim.Services.GridService
553 } 468 }
554 else 469 else
555 { 470 {
556 m_log.DebugFormat("{0} GetRegionByPosition. Did not find region in database. Pos=<{1},{2}>", 471// m_log.DebugFormat("{0} GetRegionByPosition. Did not find region in database. Pos=<{1},{2}>",
557 LogHeader, regionX, regionY); 472// LogHeader, regionX, regionY);
558 return null; 473 return null;
559 } 474 }
560 } 475 }
@@ -584,7 +499,78 @@ namespace OpenSim.Services.GridService
584 int count = 0; 499 int count = 0;
585 List<GridRegion> rinfos = new List<GridRegion>(); 500 List<GridRegion> rinfos = new List<GridRegion>();
586 501
587 if (rdatas != null) 502 if (count < maxNumber && m_AllowHypergridMapSearch && name.Contains("."))
503 {
504 string regionURI = "";
505 string regionName = "";
506 if(!Util.buildHGRegionURI(name, out regionURI, out regionName))
507 return null;
508
509 string mapname;
510 bool localGrid = m_HypergridLinker.IsLocalGrid(regionURI);
511 if(localGrid)
512 mapname = regionName;
513 else
514 mapname = regionURI + regionName;
515
516 bool haveMatch = false;
517
518 if (rdatas != null && (rdatas.Count > 0))
519 {
520// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
521 foreach (RegionData rdata in rdatas)
522 {
523 if (count++ < maxNumber)
524 rinfos.Add(RegionData2RegionInfo(rdata));
525 if(rdata.RegionName == mapname)
526 {
527 haveMatch = true;
528 if(count == maxNumber)
529 {
530 rinfos.RemoveAt(count - 1);
531 rinfos.Add(RegionData2RegionInfo(rdata));
532 }
533 }
534 }
535 if(haveMatch)
536 return rinfos;
537 }
538
539 rdatas = m_Database.Get(Util.EscapeForLike(mapname)+ "%", scopeID);
540 if (rdatas != null && (rdatas.Count > 0))
541 {
542// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
543 foreach (RegionData rdata in rdatas)
544 {
545 if (count++ < maxNumber)
546 rinfos.Add(RegionData2RegionInfo(rdata));
547 if(rdata.RegionName == mapname)
548 {
549 haveMatch = true;
550 if(count == maxNumber)
551 {
552 rinfos.RemoveAt(count - 1);
553 rinfos.Add(RegionData2RegionInfo(rdata));
554 break;
555 }
556 }
557 }
558 if(haveMatch)
559 return rinfos;
560 }
561 if(!localGrid && !string.IsNullOrWhiteSpace(regionURI))
562 {
563 string HGname = regionURI +" "+ regionName; // include space for compatibility
564 GridRegion r = m_HypergridLinker.LinkRegion(scopeID, HGname);
565 if (r != null)
566 {
567 if( count == maxNumber)
568 rinfos.RemoveAt(count - 1);
569 rinfos.Add(r);
570 }
571 }
572 }
573 else if (rdatas != null && (rdatas.Count > 0))
588 { 574 {
589// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count); 575// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
590 foreach (RegionData rdata in rdatas) 576 foreach (RegionData rdata in rdatas)
@@ -594,13 +580,6 @@ namespace OpenSim.Services.GridService
594 } 580 }
595 } 581 }
596 582
597 if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0)))
598 {
599 GridRegion r = GetHypergridRegionByName(scopeID, name);
600 if (r != null)
601 rinfos.Add(r);
602 }
603
604 return rinfos; 583 return rinfos;
605 } 584 }
606 585
@@ -613,9 +592,30 @@ namespace OpenSim.Services.GridService
613 protected GridRegion GetHypergridRegionByName(UUID scopeID, string name) 592 protected GridRegion GetHypergridRegionByName(UUID scopeID, string name)
614 { 593 {
615 if (name.Contains(".")) 594 if (name.Contains("."))
616 return m_HypergridLinker.LinkRegion(scopeID, name); 595 {
617 else 596 string regionURI = "";
618 return null; 597 string regionName = "";
598 if(!Util.buildHGRegionURI(name, out regionURI, out regionName))
599 return null;
600
601 string mapname;
602 bool localGrid = m_HypergridLinker.IsLocalGrid(regionURI);
603 if(localGrid)
604 mapname = regionName;
605 else
606 mapname = regionURI + regionName;
607
608 List<RegionData> rdatas = m_Database.Get(Util.EscapeForLike(mapname), scopeID);
609 if ((rdatas != null) && (rdatas.Count > 0))
610 return RegionData2RegionInfo(rdatas[0]); // get the first
611
612 if(!localGrid && !string.IsNullOrWhiteSpace(regionURI))
613 {
614 string HGname = regionURI +" "+ regionName;
615 return m_HypergridLinker.LinkRegion(scopeID, HGname);
616 }
617 }
618 return null;
619 } 619 }
620 620
621 public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) 621 public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
@@ -666,7 +666,7 @@ namespace OpenSim.Services.GridService
666 return rinfo; 666 return rinfo;
667 } 667 }
668 668
669 #endregion 669 #endregion
670 670
671 public List<GridRegion> GetDefaultRegions(UUID scopeID) 671 public List<GridRegion> GetDefaultRegions(UUID scopeID)
672 { 672 {
@@ -705,7 +705,7 @@ namespace OpenSim.Services.GridService
705 int normalDefaultRegionsFoundOnline = ret.Count - hgDefaultRegionsFoundOnline; 705 int normalDefaultRegionsFoundOnline = ret.Count - hgDefaultRegionsFoundOnline;
706 706
707 m_log.DebugFormat( 707 m_log.DebugFormat(
708 "[GRID SERVICE]: GetDefaultHypergridRegions returning {0} hypergrid default and {1} normal default regions", 708 "[GRID SERVICE]: GetDefaultHypergridRegions returning {0} hypergrid default and {1} normal default regions",
709 hgDefaultRegionsFoundOnline, normalDefaultRegionsFoundOnline); 709 hgDefaultRegionsFoundOnline, normalDefaultRegionsFoundOnline);
710 710
711 return ret; 711 return ret;
@@ -742,7 +742,7 @@ namespace OpenSim.Services.GridService
742 m_log.DebugFormat("[GRID SERVICE]: Hyperlinks returned {0} regions", ret.Count); 742 m_log.DebugFormat("[GRID SERVICE]: Hyperlinks returned {0} regions", ret.Count);
743 return ret; 743 return ret;
744 } 744 }
745 745
746 public int GetRegionFlags(UUID scopeID, UUID regionID) 746 public int GetRegionFlags(UUID scopeID, UUID regionID)
747 { 747 {
748 RegionData region = m_Database.Get(regionID, scopeID); 748 RegionData region = m_Database.Get(regionID, scopeID);
@@ -804,14 +804,14 @@ namespace OpenSim.Services.GridService
804 return; 804 return;
805 } 805 }
806 806
807 List<RegionData> regions = m_Database.Get(int.MinValue, int.MinValue, int.MaxValue, int.MaxValue, UUID.Zero); 807 List<RegionData> regions = m_Database.Get(0, 0, int.MaxValue, int.MaxValue, UUID.Zero);
808 808
809 OutputRegionsToConsoleSummary(regions); 809 OutputRegionsToConsoleSummary(regions);
810 } 810 }
811 811
812 private void HandleShowGridSize(string module, string[] cmd) 812 private void HandleShowGridSize(string module, string[] cmd)
813 { 813 {
814 List<RegionData> regions = m_Database.Get(int.MinValue, int.MinValue, int.MaxValue, int.MaxValue, UUID.Zero); 814 List<RegionData> regions = m_Database.Get(0, 0, int.MaxValue, int.MaxValue, UUID.Zero);
815 815
816 double size = 0; 816 double size = 0;
817 817
@@ -872,7 +872,9 @@ namespace OpenSim.Services.GridService
872 return; 872 return;
873 } 873 }
874 874
875
875 RegionData region = m_Database.Get((int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y), UUID.Zero); 876 RegionData region = m_Database.Get((int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y), UUID.Zero);
877
876 if (region == null) 878 if (region == null)
877 { 879 {
878 MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y); 880 MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y);
@@ -889,7 +891,7 @@ namespace OpenSim.Services.GridService
889 ConsoleDisplayList dispList = new ConsoleDisplayList(); 891 ConsoleDisplayList dispList = new ConsoleDisplayList();
890 dispList.AddRow("Region Name", r.RegionName); 892 dispList.AddRow("Region Name", r.RegionName);
891 dispList.AddRow("Region ID", r.RegionID); 893 dispList.AddRow("Region ID", r.RegionID);
892 dispList.AddRow("Position", string.Format("{0},{1}", r.coordX, r.coordY)); 894 dispList.AddRow("Location", string.Format("{0},{1}", r.coordX, r.coordY));
893 dispList.AddRow("Size", string.Format("{0}x{1}", r.sizeX, r.sizeY)); 895 dispList.AddRow("Size", string.Format("{0}x{1}", r.sizeX, r.sizeY));
894 dispList.AddRow("URI", r.Data["serverURI"]); 896 dispList.AddRow("URI", r.Data["serverURI"]);
895 dispList.AddRow("Owner ID", r.Data["owner_uuid"]); 897 dispList.AddRow("Owner ID", r.Data["owner_uuid"]);
@@ -907,9 +909,9 @@ namespace OpenSim.Services.GridService
907 private void OutputRegionsToConsoleSummary(List<RegionData> regions) 909 private void OutputRegionsToConsoleSummary(List<RegionData> regions)
908 { 910 {
909 ConsoleDisplayTable dispTable = new ConsoleDisplayTable(); 911 ConsoleDisplayTable dispTable = new ConsoleDisplayTable();
910 dispTable.AddColumn("Name", 44); 912 dispTable.AddColumn("Name", ConsoleDisplayUtil.RegionNameSize);
911 dispTable.AddColumn("ID", 36); 913 dispTable.AddColumn("ID", ConsoleDisplayUtil.UuidSize);
912 dispTable.AddColumn("Position", 11); 914 dispTable.AddColumn("Position", ConsoleDisplayUtil.CoordTupleSize);
913 dispTable.AddColumn("Size", 11); 915 dispTable.AddColumn("Size", 11);
914 dispTable.AddColumn("Flags", 60); 916 dispTable.AddColumn("Flags", 60);
915 917
@@ -992,7 +994,7 @@ namespace OpenSim.Services.GridService
992 } 994 }
993 995
994 /// <summary> 996 /// <summary>
995 /// Gets the grid extra service URls we wish for the region to send in OpenSimExtras to dynamically refresh 997 /// Gets the grid extra service URls we wish for the region to send in OpenSimExtras to dynamically refresh
996 /// parameters in the viewer used to access services like map, search and destination guides. 998 /// parameters in the viewer used to access services like map, search and destination guides.
997 /// <para>see "SimulatorFeaturesModule" </para> 999 /// <para>see "SimulatorFeaturesModule" </para>
998 /// </summary> 1000 /// </summary>