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.cs295
1 files changed, 149 insertions, 146 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 0c502a2..e0500a6 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,29 @@ 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 m_log.WarnFormat("{0} Region location reserved for HG links coord Y should be higher than {1}.", LogHeader, (Constants.MaximumRegionSize/256).ToString());
202//// return "Region location reserved for HG links coord Y must be higher than " + (Constants.MaximumRegionSize/256).ToString();
203
204 String reason = "Region overlaps another region"; 204 String reason = "Region overlaps another region";
205 RegionData region = FindAnyConflictingRegion(regionInfos, scopeID, out reason); 205
206 // If there is a conflicting region, if it has the same ID and same coordinates 206 List<RegionData> rdatas = m_Database.Get(
207 // then it is a region re-registering (permissions and ownership checked later). 207 regionInfos.RegionLocX,
208 if ((region != null) 208 regionInfos.RegionLocY,
209 && ( (region.coordX != regionInfos.RegionCoordX) 209 regionInfos.RegionLocX + regionInfos.RegionSizeX - 1,
210 || (region.coordY != regionInfos.RegionCoordY) 210 regionInfos.RegionLocY + regionInfos.RegionSizeY - 1 ,
211 || (region.RegionID != regionInfos.RegionID) ) 211 scopeID);
212 ) 212
213 RegionData region = null;
214 if(rdatas.Count > 1)
215 {
216 m_log.WarnFormat("{0} Register region overlaps with {1} regions", LogHeader, scopeID, rdatas.Count);
217 return reason;
218 }
219 else if(rdatas.Count == 1)
220 region = rdatas[0];
221
222 if ((region != null) && (region.RegionID != regionInfos.RegionID))
213 { 223 {
214 // If not same ID and same coordinates, this new region has conflicts and can't be registered. 224 // 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); 225 m_log.WarnFormat("{0} Register region conflict in scope {1}. {2}", LogHeader, scopeID, reason);
@@ -263,7 +273,7 @@ namespace OpenSim.Services.GridService
263 { 273 {
264 if (d.RegionID != regionInfos.RegionID) 274 if (d.RegionID != regionInfos.RegionID)
265 { 275 {
266 m_log.WarnFormat("[GRID SERVICE]: Region tried to register using a duplicate name. New region: {0} ({1}), existing region: {2} ({3}).", 276 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); 277 regionInfos.RegionName, regionInfos.RegionID, d.RegionName, d.RegionID);
268 return "Duplicate region name"; 278 return "Duplicate region name";
269 } 279 }
@@ -273,7 +283,7 @@ namespace OpenSim.Services.GridService
273 283
274 // If there is an old record for us, delete it if it is elsewhere. 284 // If there is an old record for us, delete it if it is elsewhere.
275 region = m_Database.Get(regionInfos.RegionID, scopeID); 285 region = m_Database.Get(regionInfos.RegionID, scopeID);
276 if ((region != null) && (region.RegionID == regionInfos.RegionID) && 286 if ((region != null) && (region.RegionID == regionInfos.RegionID) &&
277 ((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY))) 287 ((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY)))
278 { 288 {
279 if ((Convert.ToInt32(region.Data["flags"]) & (int)OpenSim.Framework.RegionFlags.NoMove) != 0) 289 if ((Convert.ToInt32(region.Data["flags"]) & (int)OpenSim.Framework.RegionFlags.NoMove) != 0)
@@ -284,7 +294,7 @@ namespace OpenSim.Services.GridService
284 294
285 // Region reregistering in other coordinates. Delete the old entry 295 // 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.", 296 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); 297 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionCoordX, regionInfos.RegionCoordY);
288 298
289 try 299 try
290 { 300 {
@@ -299,7 +309,7 @@ namespace OpenSim.Services.GridService
299 // Everything is ok, let's register 309 // Everything is ok, let's register
300 RegionData rdata = RegionInfo2RegionData(regionInfos); 310 RegionData rdata = RegionInfo2RegionData(regionInfos);
301 rdata.ScopeID = scopeID; 311 rdata.ScopeID = scopeID;
302 312
303 if (region != null) 313 if (region != null)
304 { 314 {
305 int oldFlags = Convert.ToInt32(region.Data["flags"]); 315 int oldFlags = Convert.ToInt32(region.Data["flags"]);
@@ -337,106 +347,14 @@ namespace OpenSim.Services.GridService
337 } 347 }
338 348
339 m_log.InfoFormat 349 m_log.InfoFormat
340 ("[GRID SERVICE]: Region {0} ({1}, {2}x{3}) registered at {4},{5} with flags {6}", 350 ("[GRID SERVICE]: Region {0} ({1}, {2}x{3}) registered at {4},{5} with flags {6}",
341 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionSizeX, regionInfos.RegionSizeY, 351 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionSizeX, regionInfos.RegionSizeY,
342 regionInfos.RegionCoordX, regionInfos.RegionCoordY, 352 regionInfos.RegionCoordX, regionInfos.RegionCoordY,
343 (OpenSim.Framework.RegionFlags)flags); 353 (OpenSim.Framework.RegionFlags)flags);
344 354
345 return String.Empty; 355 return String.Empty;
346 } 356 }
347 357
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 358 // String describing name and region location of passed region
441 private String RegionString(RegionData reg) 359 private String RegionString(RegionData reg)
442 { 360 {
@@ -457,13 +375,13 @@ namespace OpenSim.Services.GridService
457 if (region == null) 375 if (region == null)
458 return false; 376 return false;
459 377
460 m_log.DebugFormat( 378 m_log.InfoFormat(
461 "[GRID SERVICE]: Deregistering region {0} ({1}) at {2}-{3}", 379 "[GRID SERVICE]: Deregistering region {0} ({1}) at {2}-{3}",
462 region.RegionName, region.RegionID, region.coordX, region.coordY); 380 region.RegionName, region.RegionID, region.coordX, region.coordY);
463 381
464 int flags = Convert.ToInt32(region.Data["flags"]); 382 int flags = Convert.ToInt32(region.Data["flags"]);
465 383
466 if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Framework.RegionFlags.Persistent) != 0) 384 if ((!m_DeleteOnUnregister) || ((flags & (int)OpenSim.Framework.RegionFlags.Persistent) != 0))
467 { 385 {
468 flags &= ~(int)OpenSim.Framework.RegionFlags.RegionOnline; 386 flags &= ~(int)OpenSim.Framework.RegionFlags.RegionOnline;
469 region.Data["flags"] = flags.ToString(); 387 region.Data["flags"] = flags.ToString();
@@ -478,7 +396,6 @@ namespace OpenSim.Services.GridService
478 } 396 }
479 397
480 return true; 398 return true;
481
482 } 399 }
483 400
484 return m_Database.Delete(regionID); 401 return m_Database.Delete(regionID);
@@ -488,13 +405,11 @@ namespace OpenSim.Services.GridService
488 { 405 {
489 List<GridRegion> rinfos = new List<GridRegion>(); 406 List<GridRegion> rinfos = new List<GridRegion>();
490 RegionData region = m_Database.Get(regionID, scopeID); 407 RegionData region = m_Database.Get(regionID, scopeID);
491 408
492 if (region != null) 409 if (region != null)
493 { 410 {
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( 411 List<RegionData> rdatas = m_Database.Get(
497 region.posX - region.sizeX - 1, region.posY - region.sizeY - 1, 412 region.posX - 1, region.posY - 1,
498 region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID); 413 region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID);
499 414
500 foreach (RegionData rdata in rdatas) 415 foreach (RegionData rdata in rdatas)
@@ -516,10 +431,10 @@ namespace OpenSim.Services.GridService
516 else 431 else
517 { 432 {
518 m_log.WarnFormat( 433 m_log.WarnFormat(
519 "[GRID SERVICE]: GetNeighbours() called for scope {0}, region {1} but no such region found", 434 "[GRID SERVICE]: GetNeighbours() called for scope {0}, region {1} but no such region found",
520 scopeID, regionID); 435 scopeID, regionID);
521 } 436 }
522 437
523 return rinfos; 438 return rinfos;
524 } 439 }
525 440
@@ -537,6 +452,7 @@ namespace OpenSim.Services.GridService
537 // be the base coordinate of the region. 452 // be the base coordinate of the region.
538 // The snapping is technically unnecessary but is harmless because regions are always 453 // The snapping is technically unnecessary but is harmless because regions are always
539 // multiples of the legacy region size (256). 454 // multiples of the legacy region size (256).
455
540 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) 456 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
541 { 457 {
542 uint regionX = Util.WorldToRegionLoc((uint)x); 458 uint regionX = Util.WorldToRegionLoc((uint)x);
@@ -553,8 +469,8 @@ namespace OpenSim.Services.GridService
553 } 469 }
554 else 470 else
555 { 471 {
556 m_log.DebugFormat("{0} GetRegionByPosition. Did not find region in database. Pos=<{1},{2}>", 472// m_log.DebugFormat("{0} GetRegionByPosition. Did not find region in database. Pos=<{1},{2}>",
557 LogHeader, regionX, regionY); 473// LogHeader, regionX, regionY);
558 return null; 474 return null;
559 } 475 }
560 } 476 }
@@ -584,7 +500,78 @@ namespace OpenSim.Services.GridService
584 int count = 0; 500 int count = 0;
585 List<GridRegion> rinfos = new List<GridRegion>(); 501 List<GridRegion> rinfos = new List<GridRegion>();
586 502
587 if (rdatas != null) 503 if (count < maxNumber && m_AllowHypergridMapSearch && name.Contains("."))
504 {
505 string regionURI = "";
506 string regionName = "";
507 if(!Util.buildHGRegionURI(name, out regionURI, out regionName))
508 return null;
509
510 string mapname;
511 bool localGrid = m_HypergridLinker.IsLocalGrid(regionURI);
512 if(localGrid)
513 mapname = regionName;
514 else
515 mapname = regionURI + regionName;
516
517 bool haveMatch = false;
518
519 if (rdatas != null && (rdatas.Count > 0))
520 {
521// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
522 foreach (RegionData rdata in rdatas)
523 {
524 if (count++ < maxNumber)
525 rinfos.Add(RegionData2RegionInfo(rdata));
526 if(rdata.RegionName == mapname)
527 {
528 haveMatch = true;
529 if(count == maxNumber)
530 {
531 rinfos.RemoveAt(count - 1);
532 rinfos.Add(RegionData2RegionInfo(rdata));
533 }
534 }
535 }
536 if(haveMatch)
537 return rinfos;
538 }
539
540 rdatas = m_Database.Get(Util.EscapeForLike(mapname)+ "%", scopeID);
541 if (rdatas != null && (rdatas.Count > 0))
542 {
543// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
544 foreach (RegionData rdata in rdatas)
545 {
546 if (count++ < maxNumber)
547 rinfos.Add(RegionData2RegionInfo(rdata));
548 if(rdata.RegionName == mapname)
549 {
550 haveMatch = true;
551 if(count == maxNumber)
552 {
553 rinfos.RemoveAt(count - 1);
554 rinfos.Add(RegionData2RegionInfo(rdata));
555 break;
556 }
557 }
558 }
559 if(haveMatch)
560 return rinfos;
561 }
562 if(!localGrid && !string.IsNullOrWhiteSpace(regionURI))
563 {
564 string HGname = regionURI +" "+ regionName; // include space for compatibility
565 GridRegion r = m_HypergridLinker.LinkRegion(scopeID, HGname);
566 if (r != null)
567 {
568 if( count == maxNumber)
569 rinfos.RemoveAt(count - 1);
570 rinfos.Add(r);
571 }
572 }
573 }
574 else if (rdatas != null && (rdatas.Count > 0))
588 { 575 {
589// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count); 576// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
590 foreach (RegionData rdata in rdatas) 577 foreach (RegionData rdata in rdatas)
@@ -594,13 +581,6 @@ namespace OpenSim.Services.GridService
594 } 581 }
595 } 582 }
596 583
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; 584 return rinfos;
605 } 585 }
606 586
@@ -613,9 +593,30 @@ namespace OpenSim.Services.GridService
613 protected GridRegion GetHypergridRegionByName(UUID scopeID, string name) 593 protected GridRegion GetHypergridRegionByName(UUID scopeID, string name)
614 { 594 {
615 if (name.Contains(".")) 595 if (name.Contains("."))
616 return m_HypergridLinker.LinkRegion(scopeID, name); 596 {
617 else 597 string regionURI = "";
618 return null; 598 string regionName = "";
599 if(!Util.buildHGRegionURI(name, out regionURI, out regionName))
600 return null;
601
602 string mapname;
603 bool localGrid = m_HypergridLinker.IsLocalGrid(regionURI);
604 if(localGrid)
605 mapname = regionName;
606 else
607 mapname = regionURI + regionName;
608
609 List<RegionData> rdatas = m_Database.Get(Util.EscapeForLike(mapname), scopeID);
610 if ((rdatas != null) && (rdatas.Count > 0))
611 return RegionData2RegionInfo(rdatas[0]); // get the first
612
613 if(!localGrid && !string.IsNullOrWhiteSpace(regionURI))
614 {
615 string HGname = regionURI +" "+ regionName;
616 return m_HypergridLinker.LinkRegion(scopeID, HGname);
617 }
618 }
619 return null;
619 } 620 }
620 621
621 public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) 622 public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
@@ -666,7 +667,7 @@ namespace OpenSim.Services.GridService
666 return rinfo; 667 return rinfo;
667 } 668 }
668 669
669 #endregion 670 #endregion
670 671
671 public List<GridRegion> GetDefaultRegions(UUID scopeID) 672 public List<GridRegion> GetDefaultRegions(UUID scopeID)
672 { 673 {
@@ -705,7 +706,7 @@ namespace OpenSim.Services.GridService
705 int normalDefaultRegionsFoundOnline = ret.Count - hgDefaultRegionsFoundOnline; 706 int normalDefaultRegionsFoundOnline = ret.Count - hgDefaultRegionsFoundOnline;
706 707
707 m_log.DebugFormat( 708 m_log.DebugFormat(
708 "[GRID SERVICE]: GetDefaultHypergridRegions returning {0} hypergrid default and {1} normal default regions", 709 "[GRID SERVICE]: GetDefaultHypergridRegions returning {0} hypergrid default and {1} normal default regions",
709 hgDefaultRegionsFoundOnline, normalDefaultRegionsFoundOnline); 710 hgDefaultRegionsFoundOnline, normalDefaultRegionsFoundOnline);
710 711
711 return ret; 712 return ret;
@@ -742,7 +743,7 @@ namespace OpenSim.Services.GridService
742 m_log.DebugFormat("[GRID SERVICE]: Hyperlinks returned {0} regions", ret.Count); 743 m_log.DebugFormat("[GRID SERVICE]: Hyperlinks returned {0} regions", ret.Count);
743 return ret; 744 return ret;
744 } 745 }
745 746
746 public int GetRegionFlags(UUID scopeID, UUID regionID) 747 public int GetRegionFlags(UUID scopeID, UUID regionID)
747 { 748 {
748 RegionData region = m_Database.Get(regionID, scopeID); 749 RegionData region = m_Database.Get(regionID, scopeID);
@@ -804,14 +805,14 @@ namespace OpenSim.Services.GridService
804 return; 805 return;
805 } 806 }
806 807
807 List<RegionData> regions = m_Database.Get(int.MinValue, int.MinValue, int.MaxValue, int.MaxValue, UUID.Zero); 808 List<RegionData> regions = m_Database.Get(0, 0, int.MaxValue, int.MaxValue, UUID.Zero);
808 809
809 OutputRegionsToConsoleSummary(regions); 810 OutputRegionsToConsoleSummary(regions);
810 } 811 }
811 812
812 private void HandleShowGridSize(string module, string[] cmd) 813 private void HandleShowGridSize(string module, string[] cmd)
813 { 814 {
814 List<RegionData> regions = m_Database.Get(int.MinValue, int.MinValue, int.MaxValue, int.MaxValue, UUID.Zero); 815 List<RegionData> regions = m_Database.Get(0, 0, int.MaxValue, int.MaxValue, UUID.Zero);
815 816
816 double size = 0; 817 double size = 0;
817 818
@@ -872,7 +873,9 @@ namespace OpenSim.Services.GridService
872 return; 873 return;
873 } 874 }
874 875
876
875 RegionData region = m_Database.Get((int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y), UUID.Zero); 877 RegionData region = m_Database.Get((int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y), UUID.Zero);
878
876 if (region == null) 879 if (region == null)
877 { 880 {
878 MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y); 881 MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y);
@@ -889,7 +892,7 @@ namespace OpenSim.Services.GridService
889 ConsoleDisplayList dispList = new ConsoleDisplayList(); 892 ConsoleDisplayList dispList = new ConsoleDisplayList();
890 dispList.AddRow("Region Name", r.RegionName); 893 dispList.AddRow("Region Name", r.RegionName);
891 dispList.AddRow("Region ID", r.RegionID); 894 dispList.AddRow("Region ID", r.RegionID);
892 dispList.AddRow("Position", string.Format("{0},{1}", r.coordX, r.coordY)); 895 dispList.AddRow("Location", string.Format("{0},{1}", r.coordX, r.coordY));
893 dispList.AddRow("Size", string.Format("{0}x{1}", r.sizeX, r.sizeY)); 896 dispList.AddRow("Size", string.Format("{0}x{1}", r.sizeX, r.sizeY));
894 dispList.AddRow("URI", r.Data["serverURI"]); 897 dispList.AddRow("URI", r.Data["serverURI"]);
895 dispList.AddRow("Owner ID", r.Data["owner_uuid"]); 898 dispList.AddRow("Owner ID", r.Data["owner_uuid"]);
@@ -907,9 +910,9 @@ namespace OpenSim.Services.GridService
907 private void OutputRegionsToConsoleSummary(List<RegionData> regions) 910 private void OutputRegionsToConsoleSummary(List<RegionData> regions)
908 { 911 {
909 ConsoleDisplayTable dispTable = new ConsoleDisplayTable(); 912 ConsoleDisplayTable dispTable = new ConsoleDisplayTable();
910 dispTable.AddColumn("Name", 44); 913 dispTable.AddColumn("Name", ConsoleDisplayUtil.RegionNameSize);
911 dispTable.AddColumn("ID", 36); 914 dispTable.AddColumn("ID", ConsoleDisplayUtil.UuidSize);
912 dispTable.AddColumn("Position", 11); 915 dispTable.AddColumn("Position", ConsoleDisplayUtil.CoordTupleSize);
913 dispTable.AddColumn("Size", 11); 916 dispTable.AddColumn("Size", 11);
914 dispTable.AddColumn("Flags", 60); 917 dispTable.AddColumn("Flags", 60);
915 918
@@ -992,7 +995,7 @@ namespace OpenSim.Services.GridService
992 } 995 }
993 996
994 /// <summary> 997 /// <summary>
995 /// Gets the grid extra service URls we wish for the region to send in OpenSimExtras to dynamically refresh 998 /// 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. 999 /// parameters in the viewer used to access services like map, search and destination guides.
997 /// <para>see "SimulatorFeaturesModule" </para> 1000 /// <para>see "SimulatorFeaturesModule" </para>
998 /// </summary> 1001 /// </summary>