* minor: Minor documentation and small minor change on LLPacketThrottle to remove some unnecessary lines

0.6.1-post-fixes
Justin Clarke Casey 2008-12-17 17:01:02 +00:00
parent ac451485d6
commit 2e79fd0f0c
1 changed files with 22 additions and 20 deletions

View File

@ -40,6 +40,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// Value with which to multiply all the throttle fields /// Value with which to multiply all the throttle fields
/// </value> /// </value>
private float m_throttleMultiplier; private float m_throttleMultiplier;
public int Max
{
get { return m_maxAllowableThrottle; }
}
public int Min
{
get { return m_minAllowableThrottle; }
}
/// <summary> /// <summary>
/// Constructor. /// Constructor.
@ -64,9 +74,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
CalcBits(); CalcBits();
} }
public void CalcBits() /// <summary>
/// Calculate the actual throttle required.
/// </summary>
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() public void Reset()
@ -85,34 +98,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return m_currentBitsSent; return m_currentBitsSent;
} }
public int Max
{
get { return m_maxAllowableThrottle; }
}
public int Min
{
get { return m_minAllowableThrottle; }
}
public int Throttle public int Throttle
{ {
get { return m_currentThrottle; } get { return m_currentThrottle; }
set set
{ {
if (value < m_minAllowableThrottle) if (value < m_minAllowableThrottle)
{ {
m_currentThrottle = m_minAllowableThrottle; m_currentThrottle = m_minAllowableThrottle;
CalcBits(); }
return; else if (value > m_maxAllowableThrottle)
}
if (value > m_maxAllowableThrottle)
{ {
m_currentThrottle = m_maxAllowableThrottle; m_currentThrottle = m_maxAllowableThrottle;
CalcBits();
return;
} }
m_currentThrottle = value; else
{
m_currentThrottle = value;
}
CalcBits(); CalcBits();
} }