* Enables Child Agents for all virtual regions in the region and their neighbors. There still may be issues with crossing into the mentioned neighbors of the virtual regions. This makes regions larger then 512x512 (3 virtual regions) display fully to clients.

* Uses a grid request multiple times, so the more regions are in the instance, the longer logging in takes.   Consider this temporary until there's a RegionInfo request similar to the MapItem Request.
remotes/origin/0.6.7-post-fixes
Teravus Ovares (Dan Olivares) 2009-09-07 12:57:30 -04:00
parent c4edefd9a0
commit 326c3ee14f
1 changed files with 56 additions and 2 deletions

View File

@ -367,6 +367,7 @@ namespace OpenSim.Region.Framework.Scenes
string reason = String.Empty; string reason = String.Empty;
//bool regionAccepted = m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, a); //bool regionAccepted = m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, a);
bool regionAccepted = m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, out reason); bool regionAccepted = m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, out reason);
if (regionAccepted && newAgent) if (regionAccepted && newAgent)
@ -384,7 +385,7 @@ namespace OpenSim.Region.Framework.Scenes
eq.EnableSimulator(reg.RegionHandle, endPoint, avatar.UUID); eq.EnableSimulator(reg.RegionHandle, endPoint, avatar.UUID);
eq.EstablishAgentCommunication(avatar.UUID, endPoint, capsPath); eq.EstablishAgentCommunication(avatar.UUID, endPoint, capsPath);
m_log.DebugFormat("[CAPS]: Sending new CAPS seed url {0} to client {1} in region {2}", m_log.DebugFormat("[CAPS]: Sending new CAPS seed url {0} to client {1} in region {2}",
capsPath, avatar.UUID, avatar.Scene.RegionInfo.RegionName); capsPath, avatar.UUID, avatar.Scene.RegionInfo.RegionName);
} }
else else
@ -394,7 +395,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
m_log.Info("[INTERGRID]: Completed inform client about neighbour " + endPoint.ToString()); m_log.Info("[INTERGRID]: Completed inform client about neighbour " + endPoint.ToString());
} }
} }
public void RequestNeighbors(RegionInfo region) public void RequestNeighbors(RegionInfo region)
@ -421,7 +424,48 @@ namespace OpenSim.Region.Framework.Scenes
} }
else else
{ {
return m_commsProvider.GridService.RequestNeighbours(pRegionLocX, pRegionLocY); Vector2 extent = Vector2.Zero;
for (int i=0;i<eastBorders.Length;i++)
{
extent.X = (eastBorders[i].BorderLine.Z > extent.X) ? eastBorders[i].BorderLine.Z : extent.X;
}
for (int i=0;i<northBorders.Length;i++)
{
extent.Y = (northBorders[i].BorderLine.Z > extent.Y) ? northBorders[i].BorderLine.Z : extent.Y;
}
List<SimpleRegionInfo> neighbourList = new List<SimpleRegionInfo>();
// Loss of fraction on purpose
extent.X = ((int)extent.X / (int)Constants.RegionSize) + 1;
extent.Y = ((int)extent.Y / (int)Constants.RegionSize) + 1;
int startX = (int) pRegionLocX - 1;
int startY = (int) pRegionLocY - 1;
int endX = (int) pRegionLocX + (int)extent.X + 1;
int endY = (int) pRegionLocY + (int)extent.Y + 1;
for (int i=startX;i<endX;i++)
{
for (int j=startY;j<endY;j++)
{
// Skip CurrentRegion
if (i == (int)pRegionLocX && j == (int)pRegionLocY)
continue;
ulong regionHandle = Util.UIntsToLong((uint)(i * Constants.RegionSize),
(uint)(j * Constants.RegionSize));
RegionInfo neighborreg = m_commsProvider.GridService.RequestNeighbourInfo(regionHandle);
if (neighborreg != null)
{
neighbourList.Add(neighborreg);
}
}
}
return neighbourList;
//SimpleRegionInfo regionData = m_commsProvider.GridService.RequestNeighbourInfo()
//return m_commsProvider.GridService.RequestNeighbours(pRegionLocX, pRegionLocY);
} }
} }
@ -554,6 +598,16 @@ namespace OpenSim.Region.Framework.Scenes
InformClientOfNeighbourCompleted, InformClientOfNeighbourCompleted,
d); d);
} }
catch (ArgumentOutOfRangeException)
{
m_log.ErrorFormat(
"[REGIONINFO]: Neighbour Regions response included the current region in the neighbor list. The following region will not display to the client: {0} for region {1} ({2}, {3}).",
neighbour.ExternalHostName,
neighbour.RegionHandle,
neighbour.RegionLocX,
neighbour.RegionLocY);
}
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat( m_log.ErrorFormat(