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 --- .../Rest/Inventory/RestHandler.cs | 2 +- .../Region/ClientStack/LindenUDP/LLPacketServer.cs | 2 +- .../ClientStack/LindenUDP/LLPacketThrottle.cs | 42 +++++++++++----------- .../Region/Environment/Scenes/SceneObjectPart.cs | 2 +- prebuild.xml | 2 -- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs index c351272..9a1f628 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs @@ -441,7 +441,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // Preserves the original handler's semantics - public new void AddStreamHandler(string httpMethod, string path, RestMethod method) + public void AddStreamHandler(string httpMethod, string path, RestMethod method) { if (!IsEnabled) 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; } } } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index edccbe5..156310b 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -921,7 +921,7 @@ namespace OpenSim.Region.Environment.Scenes } [XmlIgnore] - public LLUUID RegionID + public virtual LLUUID RegionID { get { return ParentGroup.Scene.RegionInfo.RegionID; } set {} // read only diff --git a/prebuild.xml b/prebuild.xml index 97f9394..513b419 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1189,9 +1189,7 @@ ../../../../bin/ - - -- cgit v1.1