Merge branch 'master' into careminster-presence-refactor

Also prevent god takes from ending up in Lost and Found
This commit is contained in:
Melanie
2010-12-03 02:36:13 +00:00
45 changed files with 1185 additions and 548 deletions

View File

@@ -400,7 +400,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return data;
}
public bool EnqueueOutgoing(OutgoingPacket packet)
/// <summary>
/// Queue an outgoing packet if appropriate.
/// </summary>
/// <param name="packet"></param>
/// <param name="forceQueue">Always queue the packet if at all possible.</param>
/// <returns>
/// true if the packet has been queued,
/// false if the packet has not been queued and should be sent immediately.
/// </returns>
public bool EnqueueOutgoing(OutgoingPacket packet, bool forceQueue)
{
int category = (int)packet.Category;
@@ -416,14 +425,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
TokenBucket bucket = m_throttleCategories[category];
if (bucket.RemoveTokens(packet.Buffer.DataLength))
if (!forceQueue && bucket.RemoveTokens(packet.Buffer.DataLength))
{
// Enough tokens were removed from the bucket, the packet will not be queued
return false;
}
else
{
// Not enough tokens in the bucket, queue this packet
// Force queue specified or not enough tokens in the bucket, queue this packet
queue.Enqueue(packet);
return true;
}