From 77ab7ce084d32c45273d79e9ec4f52c43e3a1d97 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Mon, 25 Apr 2011 15:11:29 -0700 Subject: Fixed the transmission of throttles from root agent to child agents. Child throttles are based on the number of child agents known to the root and at least 1/4 of the throttle given to the root. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 33 +++++++++++------------- 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 00a1487..ef0eb89 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2632,18 +2632,17 @@ namespace OpenSim.Region.Framework.Scenes cadu.GroupAccess = 0; cadu.Position = AbsolutePosition; cadu.regionHandle = m_rootRegionHandle; + + // Throttles float multiplier = 1; - int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); - if (innacurateNeighbors != 0) - { - multiplier = 1f / (float)innacurateNeighbors; - } - if (multiplier <= 0f) - { + int childRegions = m_knownChildRegions.Count; + if (childRegions != 0) + multiplier = 1f / childRegions; + + // Minimum throttle for a child region is 1/4 of the root region throttle + if (multiplier <= 0.25f) multiplier = 0.25f; - } - //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString()); cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier); cadu.Velocity = Velocity; @@ -3039,16 +3038,14 @@ namespace OpenSim.Region.Framework.Scenes // Throttles float multiplier = 1; - int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); - if (innacurateNeighbors != 0) - { - multiplier = 1f / innacurateNeighbors; - } - if (multiplier <= 0f) - { + int childRegions = m_knownChildRegions.Count; + if (childRegions != 0) + multiplier = 1f / childRegions; + + // Minimum throttle for a child region is 1/4 of the root region throttle + if (multiplier <= 0.25f) multiplier = 0.25f; - } - //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString()); + cAgent.Throttles = ControllingClient.GetThrottlesPacked(multiplier); cAgent.HeadRotation = m_headrotation; -- cgit v1.1