* Added another code path to skip the packet throttle queues when there's no need to queue the packet up.

afrisby
Teravus Ovares 2007-11-22 23:14:38 +00:00
parent f97aeab916
commit 01cd8014da
1 changed files with 73 additions and 7 deletions

View File

@ -225,28 +225,94 @@ namespace OpenSim.Region.ClientStack
item.Packet = NewPack; item.Packet = NewPack;
item.Incoming = false; item.Incoming = false;
item.throttleType = throttlePacketType; // Packet throttle type item.throttleType = throttlePacketType; // Packet throttle type
// The idea.. is if the packet throttle queues are empty and the client is under throttle for the type.
// Queue it up directly.
switch (throttlePacketType) switch (throttlePacketType)
{ {
case ThrottleOutPacketType.Resend: case ThrottleOutPacketType.Resend:
if (ResendthrottleSentPeriod <= ResendthrottleOutbound && ResendOutgoingPacketQueue.Count == 0)
{
throttleSentPeriod += item.Packet.ToBytes().Length;
ResendthrottleSentPeriod += item.Packet.ToBytes().Length;
PacketQueue.Enqueue(item);
}
else
{
ResendOutgoingPacketQueue.Enqueue(item); ResendOutgoingPacketQueue.Enqueue(item);
}
break; break;
case ThrottleOutPacketType.Texture: case ThrottleOutPacketType.Texture:
if (TexturethrottleSentPeriod <= TexturethrottleOutbound && TextureOutgoingPacketQueue.Count == 0)
{
throttleSentPeriod += item.Packet.ToBytes().Length;
TexturethrottleSentPeriod += item.Packet.ToBytes().Length;
PacketQueue.Enqueue(item);
}
else
{
TextureOutgoingPacketQueue.Enqueue(item); TextureOutgoingPacketQueue.Enqueue(item);
}
break; break;
case ThrottleOutPacketType.Task: case ThrottleOutPacketType.Task:
if (TaskthrottleSentPeriod <= TaskthrottleOutbound && TaskOutgoingPacketQueue.Count == 0)
{
throttleSentPeriod += item.Packet.ToBytes().Length;
TaskthrottleSentPeriod += item.Packet.ToBytes().Length;
PacketQueue.Enqueue(item);
}
else
{
TaskOutgoingPacketQueue.Enqueue(item); TaskOutgoingPacketQueue.Enqueue(item);
}
break; break;
case ThrottleOutPacketType.Land: case ThrottleOutPacketType.Land:
if (LandthrottleSentPeriod <= LandthrottleOutbound && LandOutgoingPacketQueue.Count == 0)
{
throttleSentPeriod += item.Packet.ToBytes().Length;
LandthrottleSentPeriod += item.Packet.ToBytes().Length;
PacketQueue.Enqueue(item);
}
else
{
LandOutgoingPacketQueue.Enqueue(item); LandOutgoingPacketQueue.Enqueue(item);
}
break; break;
case ThrottleOutPacketType.Asset: case ThrottleOutPacketType.Asset:
if (AssetthrottleSentPeriod <= AssetthrottleOutbound && AssetOutgoingPacketQueue.Count == 0)
{
throttleSentPeriod += item.Packet.ToBytes().Length;
AssetthrottleSentPeriod += item.Packet.ToBytes().Length;
PacketQueue.Enqueue(item);
}
else
{
AssetOutgoingPacketQueue.Enqueue(item); AssetOutgoingPacketQueue.Enqueue(item);
}
break; break;
case ThrottleOutPacketType.Cloud: case ThrottleOutPacketType.Cloud:
if (CloudthrottleSentPeriod <= CloudthrottleOutbound && CloudOutgoingPacketQueue.Count == 0)
{
throttleSentPeriod += item.Packet.ToBytes().Length;
CloudthrottleSentPeriod += item.Packet.ToBytes().Length;
PacketQueue.Enqueue(item);
}
else
{
CloudOutgoingPacketQueue.Enqueue(item); CloudOutgoingPacketQueue.Enqueue(item);
}
break; break;
case ThrottleOutPacketType.Wind: case ThrottleOutPacketType.Wind:
if (WindthrottleSentPeriod <= WindthrottleOutbound && WindOutgoingPacketQueue.Count == 0)
{
throttleSentPeriod += item.Packet.ToBytes().Length;
WindthrottleSentPeriod += item.Packet.ToBytes().Length;
PacketQueue.Enqueue(item);
}
else
{
WindOutgoingPacketQueue.Enqueue(item); WindOutgoingPacketQueue.Enqueue(item);
}
break; break;
default: default: