From 2e79fd0f0c33b43cece2a698dc3ec4d65c27e72c Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 17 Dec 2008 17:01:02 +0000 Subject: * minor: Minor documentation and small minor change on LLPacketThrottle to remove some unnecessary lines --- .../ClientStack/LindenUDP/LLPacketThrottle.cs | 42 +++++++++++----------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs index 31efee7..6d199ad 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs @@ -40,6 +40,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// Value with which to multiply all the throttle fields /// private float m_throttleMultiplier; + + public int Max + { + get { return m_maxAllowableThrottle; } + } + + public int Min + { + get { return m_minAllowableThrottle; } + } /// /// Constructor. @@ -64,9 +74,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP CalcBits(); } - public void CalcBits() + /// + /// Calculate the actual throttle required. + /// + private void CalcBits() { - m_throttleBits = (int)((float)m_currentThrottle*m_throttleMultiplier/(float)m_throttleTimeDivisor); + m_throttleBits = (int)((float)m_currentThrottle * m_throttleMultiplier / (float)m_throttleTimeDivisor); } public void Reset() @@ -85,34 +98,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP return m_currentBitsSent; } - public int Max - { - get { return m_maxAllowableThrottle; } - } - - public int Min - { - get { return m_minAllowableThrottle; } - } - public int Throttle { - get { return m_currentThrottle; } + get { return m_currentThrottle; } set { if (value < m_minAllowableThrottle) { m_currentThrottle = m_minAllowableThrottle; - CalcBits(); - return; - } - if (value > m_maxAllowableThrottle) + } + else if (value > m_maxAllowableThrottle) { m_currentThrottle = m_maxAllowableThrottle; - CalcBits(); - return; } - m_currentThrottle = value; + else + { + m_currentThrottle = value; + } CalcBits(); } -- cgit v1.1