* 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.Xml0.6.0-stable
parent
ce90e2ecce
commit
9dbb6f28bc
|
@ -441,7 +441,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
// Preserves the original handler's semantics
|
// 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)
|
if (!IsEnabled)
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
//private static readonly log4net.ILog m_log
|
//private static readonly log4net.ILog m_log
|
||||||
// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private LLClientStackNetworkHandler m_networkHandler;
|
private readonly LLClientStackNetworkHandler m_networkHandler;
|
||||||
private IScene m_scene;
|
private IScene m_scene;
|
||||||
|
|
||||||
//private readonly ClientManager m_clientManager = new ClientManager();
|
//private readonly ClientManager m_clientManager = new ClientManager();
|
||||||
|
|
|
@ -29,63 +29,63 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
public class LLPacketThrottle
|
public class LLPacketThrottle
|
||||||
{
|
{
|
||||||
private int max; // max allowable throttle
|
private readonly int m_maxAllowableThrottle;
|
||||||
private int min; // min allowable throttle
|
private readonly int m_minAllowableThrottle;
|
||||||
private int throttle; // current throttle setting
|
private int m_currentThrottle;
|
||||||
private static int divisor = 7; // the throttle time divisor, this probably should factor out
|
private const int m_throttleTimeDivisor = 7;
|
||||||
private int sent; // current number of bytes sent
|
private int m_currentBytesSent;
|
||||||
|
|
||||||
public LLPacketThrottle(int Min, int Max, int Throttle)
|
public LLPacketThrottle(int Min, int Max, int Throttle)
|
||||||
{
|
{
|
||||||
max = Max;
|
m_maxAllowableThrottle = Max;
|
||||||
min = Min;
|
m_minAllowableThrottle = Min;
|
||||||
throttle = Throttle;
|
m_currentThrottle = Throttle;
|
||||||
sent = 0;
|
m_currentBytesSent = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
sent = 0;
|
m_currentBytesSent = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool UnderLimit()
|
public bool UnderLimit()
|
||||||
{
|
{
|
||||||
return (sent < (throttle/divisor));
|
return (m_currentBytesSent < (m_currentThrottle/m_throttleTimeDivisor));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Add(int bytes)
|
public int Add(int bytes)
|
||||||
{
|
{
|
||||||
sent += bytes;
|
m_currentBytesSent += bytes;
|
||||||
return sent;
|
return m_currentBytesSent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
public int Max
|
public int Max
|
||||||
{
|
{
|
||||||
get { return max; }
|
get { return m_maxAllowableThrottle; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Min
|
public int Min
|
||||||
{
|
{
|
||||||
get { return min; }
|
get { return m_minAllowableThrottle; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Throttle
|
public int Throttle
|
||||||
{
|
{
|
||||||
get { return throttle; }
|
get { return m_currentThrottle; }
|
||||||
set
|
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
|
else
|
||||||
{
|
{
|
||||||
throttle = value;
|
m_currentThrottle = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -921,7 +921,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
[XmlIgnore]
|
[XmlIgnore]
|
||||||
public LLUUID RegionID
|
public virtual LLUUID RegionID
|
||||||
{
|
{
|
||||||
get { return ParentGroup.Scene.RegionInfo.RegionID; }
|
get { return ParentGroup.Scene.RegionInfo.RegionID; }
|
||||||
set {} // read only
|
set {} // read only
|
||||||
|
|
|
@ -1189,9 +1189,7 @@
|
||||||
<ReferencePath>../../../../bin/</ReferencePath>
|
<ReferencePath>../../../../bin/</ReferencePath>
|
||||||
<Reference name="Mono.Addins.dll" />
|
<Reference name="Mono.Addins.dll" />
|
||||||
<Reference name="System"/>
|
<Reference name="System"/>
|
||||||
<Reference name="System.IO"/>
|
|
||||||
<Reference name="System.Xml"/>
|
<Reference name="System.Xml"/>
|
||||||
<Reference name="System.Xml.Serialization"/>
|
|
||||||
<Reference name="libsecondlife.dll" />
|
<Reference name="libsecondlife.dll" />
|
||||||
<Reference name="Nini.dll" />
|
<Reference name="Nini.dll" />
|
||||||
<Reference name="XMLRPC.dll" />
|
<Reference name="XMLRPC.dll" />
|
||||||
|
|
Loading…
Reference in New Issue