mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
* Expose a client_throttle_multiplier setting in OpenSim.ini. This multiplier is applied to all the client throttle settings received by the client
* This should probably be 1, but currently by default it is 8, to reflect what was being eon3 in OpenSim before this revision. So if the client requested a maximum throttle of 1500 kilobits per second, we would actually send out 1500 kilobytes per second * Adjusting this multiplier down towards 1 may improve your OpenSim experience, though in other situations it may degrade (e.g. if you're using a standalone over high bandwidth links) * This is currently a user setting because adjusting it down may currently reveal other OpenSim bugs.
This commit is contained in:
@@ -34,12 +34,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
private int m_currentThrottle;
|
||||
private const int m_throttleTimeDivisor = 7;
|
||||
private int m_currentBitsSent;
|
||||
|
||||
/// <value>
|
||||
/// Temporary field
|
||||
/// </value>
|
||||
private float m_throttleMultiplier;
|
||||
|
||||
public LLPacketThrottle(int Min, int Max, int Throttle)
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="min"></param>
|
||||
/// <param name="max"></param>
|
||||
/// <param name="throttle"></param>
|
||||
/// <param name="throttleMultiplier">
|
||||
/// A temporary parameter that's ends up multiplying all throttle settings. This only exists as a path to
|
||||
/// using real throttle values instead of the *8 multipler that we had been using (bytes instead of btis)
|
||||
/// </param>
|
||||
public LLPacketThrottle(int min, int max, int throttle, float throttleMultiplier)
|
||||
{
|
||||
m_maxAllowableThrottle = Max;
|
||||
m_minAllowableThrottle = Min;
|
||||
m_currentThrottle = Throttle;
|
||||
m_throttleMultiplier = throttleMultiplier;
|
||||
m_maxAllowableThrottle = (int)(max * throttleMultiplier);
|
||||
m_minAllowableThrottle = (int)(Min * throttleMultiplier);
|
||||
m_currentThrottle = (int)(Throttle * throttleMultiplier);
|
||||
m_currentBitsSent = 0;
|
||||
}
|
||||
|
||||
@@ -61,9 +77,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
public int AddBytes(int bytes)
|
||||
{
|
||||
// XXX: Temporarily treat bytes as bits. This is a temporary revert of r6714 until other underlying issues
|
||||
// are addressed.
|
||||
m_currentBitsSent += bytes;
|
||||
m_currentBitsSent += bytes * 8;
|
||||
return m_currentBitsSent;
|
||||
}
|
||||
|
||||
@@ -83,17 +97,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
get { return m_currentThrottle; }
|
||||
set
|
||||
{
|
||||
if (value > m_maxAllowableThrottle)
|
||||
int multipliedValue = (int)(value * m_throttleMultiplier);
|
||||
|
||||
if (multipliedValue > m_maxAllowableThrottle)
|
||||
{
|
||||
m_currentThrottle = m_maxAllowableThrottle;
|
||||
}
|
||||
else if (value < m_minAllowableThrottle)
|
||||
else if (multipliedValue < m_minAllowableThrottle)
|
||||
{
|
||||
m_currentThrottle = m_minAllowableThrottle;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_currentThrottle = value;
|
||||
m_currentThrottle = multipliedValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user