coment out some debug, clean a bit

avinationmerge
UbitUmarov 2015-09-26 14:14:05 +01:00
parent 05db03e809
commit 239dcaffb7
3 changed files with 3 additions and 32 deletions

View File

@ -201,15 +201,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
uint regionX = Util.WorldToRegionLoc((uint)x); uint regionX = Util.WorldToRegionLoc((uint)x);
uint regionY = Util.WorldToRegionLoc((uint)y); uint regionY = Util.WorldToRegionLoc((uint)y);
/* we are insane now
// Sanity check
if ((Util.RegionToWorldLoc(regionX) != (uint)x) || (Util.RegionToWorldLoc(regionY) != (uint)y))
{
m_log.WarnFormat("{0} GetRegionByPosition. Bad position requested: not the base of the region. Requested Pos=<{1},{2}>, Should Be=<{3},{4}>",
LogHeader, x, y, Util.RegionToWorldLoc(regionX), Util.RegionToWorldLoc(regionY));
}
*/
// First see if it's a neighbour, even if it isn't on this sim. // First see if it's a neighbour, even if it isn't on this sim.
// Neighbour data is cached in memory, so this is fast // Neighbour data is cached in memory, so this is fast
@ -220,9 +211,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
region = rcache.GetRegionByPosition(x, y); region = rcache.GetRegionByPosition(x, y);
if (region != null) if (region != null)
{ {
m_log.DebugFormat("{0} GetRegionByPosition. Found region {1} in cache (of region {2}). Pos=<{3},{4}>", //m_log.DebugFormat("{0} GetRegionByPosition. Found region {1} in cache (of region {2}). Pos=<{3},{4}>",
LogHeader, region.RegionName, rcache.RegionName, // LogHeader, region.RegionName, rcache.RegionName,
Util.WorldToRegionLoc((uint)region.RegionLocX), Util.WorldToRegionLoc((uint)region.RegionLocY)); // Util.WorldToRegionLoc((uint)region.RegionLocX), Util.WorldToRegionLoc((uint)region.RegionLocY));
break; break;
} }
} }

View File

@ -82,20 +82,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
return new List<GridRegion>(m_neighbours.Values); return new List<GridRegion>(m_neighbours.Values);
} }
public GridRegion GetRegionByPosition(int x, int y) public GridRegion GetRegionByPosition(int x, int y)
{ {
/*
uint xsnap = (uint)(x / Constants.RegionSize) * Constants.RegionSize;
uint ysnap = (uint)(y / Constants.RegionSize) * Constants.RegionSize;
ulong handle = Util.RegionWorldLocToHandle(xsnap, ysnap);
if (m_neighbours.ContainsKey(handle))
return m_neighbours[handle];
return null;
*/
// do actual search by position // do actual search by position
// not the best, but this will not hold that many regions // not the best, but this will not hold that many regions
GridRegion foundRegion = null; GridRegion foundRegion = null;

View File

@ -487,14 +487,6 @@ namespace OpenSim.Services.GridService
if (region != null) if (region != null)
{ {
// Not really? Maybe?
/* this fails wiht var regions. My_sql db should now handle var regions
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);
*/
// so send normal search area
List<RegionData> rdatas = m_Database.Get( List<RegionData> rdatas = m_Database.Get(
region.posX - 1, region.posY - 1, region.posX - 1, region.posY - 1,
region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID); region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID);