aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/GridService
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/GridService')
-rw-r--r--OpenSim/Services/GridService/GridService.cs14
1 files changed, 12 insertions, 2 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index e72b7f9..137ce04 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -313,8 +313,9 @@ namespace OpenSim.Services.GridService
313 if (region != null) 313 if (region != null)
314 { 314 {
315 // Not really? Maybe? 315 // Not really? Maybe?
316 List<RegionData> rdatas = m_Database.Get(region.posX - (int)Constants.RegionSize - 1, region.posY - (int)Constants.RegionSize - 1, 316 List<RegionData> rdatas = m_Database.Get(
317 region.posX + (int)Constants.RegionSize + 1, region.posY + (int)Constants.RegionSize + 1, scopeID); 317 region.posX - region.sizeX - 1, region.posY - region.sizeY - 1,
318 region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID);
318 319
319 foreach (RegionData rdata in rdatas) 320 foreach (RegionData rdata in rdatas)
320 { 321 {
@@ -347,6 +348,11 @@ namespace OpenSim.Services.GridService
347 return null; 348 return null;
348 } 349 }
349 350
351 // Get a region given its base coordinates.
352 // NOTE: this is NOT 'get a region by some point in the region'. The coordinate MUST
353 // be the base coordinate of the region.
354 // The snapping is technically unnecessary but is harmless because regions are always
355 // multiples of the legacy region size (256).
350 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) 356 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
351 { 357 {
352 int snapX = (int)(x / Constants.RegionSize) * (int)Constants.RegionSize; 358 int snapX = (int)(x / Constants.RegionSize) * (int)Constants.RegionSize;
@@ -441,6 +447,8 @@ namespace OpenSim.Services.GridService
441 RegionData rdata = new RegionData(); 447 RegionData rdata = new RegionData();
442 rdata.posX = (int)rinfo.RegionLocX; 448 rdata.posX = (int)rinfo.RegionLocX;
443 rdata.posY = (int)rinfo.RegionLocY; 449 rdata.posY = (int)rinfo.RegionLocY;
450 rdata.sizeX = rinfo.RegionSizeX;
451 rdata.sizeY = rinfo.RegionSizeY;
444 rdata.RegionID = rinfo.RegionID; 452 rdata.RegionID = rinfo.RegionID;
445 rdata.RegionName = rinfo.RegionName; 453 rdata.RegionName = rinfo.RegionName;
446 rdata.Data = rinfo.ToKeyValuePairs(); 454 rdata.Data = rinfo.ToKeyValuePairs();
@@ -454,6 +462,8 @@ namespace OpenSim.Services.GridService
454 GridRegion rinfo = new GridRegion(rdata.Data); 462 GridRegion rinfo = new GridRegion(rdata.Data);
455 rinfo.RegionLocX = rdata.posX; 463 rinfo.RegionLocX = rdata.posX;
456 rinfo.RegionLocY = rdata.posY; 464 rinfo.RegionLocY = rdata.posY;
465 rinfo.RegionSizeX = rdata.sizeX;
466 rinfo.RegionSizeY = rdata.sizeY;
457 rinfo.RegionID = rdata.RegionID; 467 rinfo.RegionID = rdata.RegionID;
458 rinfo.RegionName = rdata.RegionName; 468 rinfo.RegionName = rdata.RegionName;
459 rinfo.ScopeID = rdata.ScopeID; 469 rinfo.ScopeID = rdata.ScopeID;