varregion: many more updates removing the constant RegionSize and replacing

with a passed region size. This time in the map code and grid services code.
This commit is contained in:
Robert Adams
2013-12-26 22:45:59 -08:00
parent e5f7c8b6e8
commit 2d2bea4aa7
32 changed files with 224 additions and 239 deletions

View File

@@ -313,8 +313,10 @@ namespace OpenSim.Services.GridService
if (region != null)
{
// Not really? Maybe?
List<RegionData> rdatas = m_Database.Get(region.posX - (int)Constants.RegionSize - 1, region.posY - (int)Constants.RegionSize - 1,
region.posX + (int)Constants.RegionSize + 1, region.posY + (int)Constants.RegionSize + 1, scopeID);
// The adjacent regions are presumed to be the same size as the current region
List<RegionData> rdatas = m_Database.Get(
region.posX - region.sizeX - 1, region.posY - region.sizeY - 1,
region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID);
foreach (RegionData rdata in rdatas)
{
@@ -642,20 +644,20 @@ namespace OpenSim.Services.GridService
return;
}
int x, y;
if (!int.TryParse(cmd[3], out x))
uint x, y;
if (!uint.TryParse(cmd[3], out x))
{
MainConsole.Instance.Output("x-coord must be an integer");
return;
}
if (!int.TryParse(cmd[4], out y))
if (!uint.TryParse(cmd[4], out y))
{
MainConsole.Instance.Output("y-coord must be an integer");
return;
}
RegionData region = m_Database.Get(x * (int)Constants.RegionSize, y * (int)Constants.RegionSize, UUID.Zero);
RegionData region = m_Database.Get((int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y), UUID.Zero);
if (region == null)
{
MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y);