varregion: remove unused Scene.HaveNeighbor routine. Its computation

was wrong for large regions anyway.
varregion
Robert Adams 2013-12-24 12:28:54 -08:00
parent 5c9fa15f30
commit b40b57776b
1 changed files with 1 additions and 42 deletions

View File

@ -1175,48 +1175,6 @@ namespace OpenSim.Region.Framework.Scenes
return found; return found;
} }
/// <summary>
/// Checks whether this region has a neighbour in the given direction.
/// </summary>
/// <param name="car"></param>
/// <param name="fix"></param>
/// <returns>
/// An integer which represents a compass point. N == 1, going clockwise until we reach NW == 8.
/// Returns a positive integer if there is a region in that direction, a negative integer if not.
/// </returns>
public int HaveNeighbor(Cardinals car, ref int[] fix)
{
uint neighbourx = RegionInfo.RegionLocX;
uint neighboury = RegionInfo.RegionLocY;
int dir = (int)car;
if (dir > 1 && dir < 5) //Heading East
neighbourx++;
else if (dir > 5) // Heading West
neighbourx--;
if (dir < 3 || dir == 8) // Heading North
neighboury++;
else if (dir > 3 && dir < 7) // Heading Sout
neighboury--;
// int x = (int)(neighbourx * Constants.RegionSize);
// int y = (int)(neighboury * Constants.RegionSize);
uint x = Util.RegionToWorldLoc(neighbourx);
uint y = Util.RegionToWorldLoc(neighboury);
GridRegion neighbourRegion = GridService.GetRegionByPosition(RegionInfo.ScopeID, (int)x, (int)y);
if (neighbourRegion == null)
{
fix[0] = (int)(RegionInfo.RegionLocX - neighbourx);
fix[1] = (int)(RegionInfo.RegionLocY - neighboury);
return dir * (-1);
}
else
return dir;
}
// Alias IncomingHelloNeighbour OtherRegionUp, for now // Alias IncomingHelloNeighbour OtherRegionUp, for now
public GridRegion IncomingHelloNeighbour(RegionInfo neighbour) public GridRegion IncomingHelloNeighbour(RegionInfo neighbour)
{ {
@ -3917,6 +3875,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
Border crossedBorder = GetCrossedBorder(acd.startpos, Cardinals.E); Border crossedBorder = GetCrossedBorder(acd.startpos, Cardinals.E);
acd.startpos.X = crossedBorder.BorderLine.Z - 1; acd.startpos.X = crossedBorder.BorderLine.Z - 1;
m_log.DebugFormat("{0} NewUserConnection Adjusted border E. startpos={1}", LogHeader, acd.startpos);
} }
if (TestBorderCross(acd.startpos, Cardinals.N)) if (TestBorderCross(acd.startpos, Cardinals.N))