public bool Check4096(ulong realHandle, out uint x, out uint y)
{
uint ux = 0, uy = 0;
Utils.LongToUInts (realHandle, out ux, out uy);
x = ux / Constants.RegionSize;
y = uy / Constants.RegionSize;
const uint limit = (4096 - 1) * Constants.RegionSize;
uint xmin = ux - limit;
uint xmax = ux + limit;
uint ymin = uy - limit;
uint ymax = uy + limit;
// World map boundary checks
if (xmin < 0 || xmin > ux)
xmin = 0;
if (xmax > int.MaxValue || xmax < ux)
xmax = int.MaxValue;
if (ymin < 0 || ymin > uy)
ymin = 0;
if (ymax > int.MaxValue || ymax < uy)
ymax = int.MaxValue;
// Check for any regions that are within the possible teleport range to the linked region
List<GridRegion> regions = m_GridService.GetRegionRange (null, (int)xmin, (int)xmax, (int)ymin, (int)ymax);
if (regions.Count == 0)
{
return false;
}
else
{
// Check for regions which are not linked regions
List<GridRegion> hyperlinks = m_Database.Get (Aurora.Framework.RegionFlags.Hyperlink);
regions.RemoveAll (delegate (GridRegion r)
{
return hyperlinks.Contains(r);
});
if (regions.Count == 0)
return false;
}
return true;
}