From 9dbb6f28bc7e91b4643d2e80e2182f273d7e9121 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 21 Jul 2008 10:02:55 +0000 Subject: * eliminated some warnings and added some const and readonlies * refactored some member names for readability and ccc (code convention conformance) * took away two refs from Rest.Inventory since * System.IO is part of System * System.Xml.Serialization is part of System.Xml --- .../Region/ClientStack/LindenUDP/LLPacketServer.cs | 2 +- .../ClientStack/LindenUDP/LLPacketThrottle.cs | 42 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs index 5983454..2a3f2e1 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP //private static readonly log4net.ILog m_log // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private LLClientStackNetworkHandler m_networkHandler; + private readonly LLClientStackNetworkHandler m_networkHandler; private IScene m_scene; //private readonly ClientManager m_clientManager = new ClientManager(); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs index cd5ff7e..b9f4594 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs @@ -29,63 +29,63 @@ namespace OpenSim.Region.ClientStack.LindenUDP { public class LLPacketThrottle { - private int max; // max allowable throttle - private int min; // min allowable throttle - private int throttle; // current throttle setting - private static int divisor = 7; // the throttle time divisor, this probably should factor out - private int sent; // current number of bytes sent + private readonly int m_maxAllowableThrottle; + private readonly int m_minAllowableThrottle; + private int m_currentThrottle; + private const int m_throttleTimeDivisor = 7; + private int m_currentBytesSent; public LLPacketThrottle(int Min, int Max, int Throttle) { - max = Max; - min = Min; - throttle = Throttle; - sent = 0; + m_maxAllowableThrottle = Max; + m_minAllowableThrottle = Min; + m_currentThrottle = Throttle; + m_currentBytesSent = 0; } public void Reset() { - sent = 0; + m_currentBytesSent = 0; } public bool UnderLimit() { - return (sent < (throttle/divisor)); + return (m_currentBytesSent < (m_currentThrottle/m_throttleTimeDivisor)); } public int Add(int bytes) { - sent += bytes; - return sent; + m_currentBytesSent += bytes; + return m_currentBytesSent; } // Properties public int Max { - get { return max; } + get { return m_maxAllowableThrottle; } } public int Min { - get { return min; } + get { return m_minAllowableThrottle; } } public int Throttle { - get { return throttle; } + get { return m_currentThrottle; } set { - if (value > max) + if (value > m_maxAllowableThrottle) { - throttle = max; + m_currentThrottle = m_maxAllowableThrottle; } - else if (value < min) + else if (value < m_minAllowableThrottle) { - throttle = min; + m_currentThrottle = m_minAllowableThrottle; } else { - throttle = value; + m_currentThrottle = value; } } } -- cgit v1.1