* Implemented ChildAgentDataUpdate throttle multiplier based on an inaccurate count of neighbors.

* The neighbor count is always lower then the actual number of neighbors unless your region was up the longest.
* The region you're in is un-affected by this, though, you'll get less packet loss, maybe not get logged off immediately when you log in, and possibly see more prim if your internet connection is semi-unreliable.
0.6.0-stable
Teravus Ovares 2008-05-13 06:05:45 +00:00
parent fcc23be577
commit bfce23dcf4
3 changed files with 62 additions and 3 deletions

View File

@ -361,11 +361,12 @@ namespace OpenSim.Region.Environment.Scenes
// If the RegionInfo isn't exact but is for the same XY World location,
// then the above loop will fix that.
if (!(m_neighbours.Contains(otherRegion)))
if (!(CheckNeighborRegion(otherRegion)))
{
lock (m_neighbours)
{
m_neighbours.Add(otherRegion);
//m_log.Info("[UP]: " + otherRegion.RegionHandle.ToString());
}
}
// If these are cast to INT because long + negative values + abs returns invalid data
@ -407,7 +408,36 @@ namespace OpenSim.Region.Environment.Scenes
}
// Given float seconds, this will restart the region.
public void AddNeighborRegion(RegionInfo region)
{
lock (m_neighbours)
{
if (!CheckNeighborRegion(region))
{
m_neighbours.Add(region);
}
}
}
public bool CheckNeighborRegion(RegionInfo region)
{
bool found = false;
lock (m_neighbours)
{
foreach (RegionInfo reg in m_neighbours)
{
if (reg.RegionHandle == region.RegionHandle)
{
found = true;
break;
}
}
}
return found;
}
public virtual void Restart(float seconds)
{
// notifications are done in 15 second increments
@ -556,7 +586,11 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public int GetInaccurateNeighborCount()
{
lock (m_neighbours)
return m_neighbours.Count;
}
// This is the method that shuts down the scene.
public override void Close()
{
@ -647,6 +681,7 @@ namespace OpenSim.Region.Environment.Scenes
// Aquire a lock so only one update call happens at once
updateLock.WaitOne();
float physicsFPS = 0;
//m_log.Info("sadfadf" + m_neighbours.Count.ToString());
int agentsInScene = m_innerScene.GetRootAgentCount() + m_innerScene.GetChildAgentCount();
if (agentsInScene > 21)

View File

@ -361,6 +361,13 @@ namespace OpenSim.Region.Environment.Scenes
if (regionAccepted)
{
m_log.Info("[INTERGRID]: Completed informing neighbors that I'm here");
handlerRegionUp = OnRegionUp;
// yes, we're notifying ourselves.
if (handlerRegionUp != null)
handlerRegionUp(region);
}
else
{

View File

@ -1568,7 +1568,24 @@ namespace OpenSim.Region.Environment.Scenes
cadu.GroupAccess = 0;
cadu.Position = new sLLVector3(AbsolutePosition);
cadu.regionHandle = m_scene.RegionInfo.RegionHandle;
cadu.throttles = ControllingClient.GetThrottlesPacked(1f);
float multiplier = 1;
int innacurateNeighbors = m_scene.GetInaccurateNeighborCount();
if (innacurateNeighbors != 0)
{
multiplier = 1f / (float)innacurateNeighbors;
}
if (multiplier <= 0f)
{
multiplier = 0.25f;
}
//m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString());
cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier);
cadu.Velocity = new sLLVector3(Velocity);
m_scene.SendOutChildAgentUpdates(cadu,this);
m_LastChildAgentUpdatePosition.X = AbsolutePosition.X;