* C# compiler is not smart enough to understand ClientLoop is under very heavy usage and inline DebugPacket, so DebugPacket is run as a method, causing Packet
to be constantly pushed and popped uselessly, if you are not debugging packets. This showed some really big difference in a mock test, let's see how it behaves here.0.6.6-post-fixes
parent
7bb070be55
commit
4f6efa0249
|
@ -809,33 +809,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
protected void DebugPacket(string direction, Packet packet)
|
protected void DebugPacket(string direction, Packet packet)
|
||||||
{
|
{
|
||||||
if (m_debugPacketLevel > 0)
|
string info;
|
||||||
|
|
||||||
|
if (m_debugPacketLevel < 255 && packet.Type == PacketType.AgentUpdate)
|
||||||
|
return;
|
||||||
|
if (m_debugPacketLevel < 254 && packet.Type == PacketType.ViewerEffect)
|
||||||
|
return;
|
||||||
|
if (m_debugPacketLevel < 253 && (
|
||||||
|
packet.Type == PacketType.CompletePingCheck ||
|
||||||
|
packet.Type == PacketType.StartPingCheck
|
||||||
|
))
|
||||||
|
return;
|
||||||
|
if (m_debugPacketLevel < 252 && packet.Type == PacketType.PacketAck)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (m_debugPacketLevel > 1)
|
||||||
{
|
{
|
||||||
string info;
|
info = packet.ToString();
|
||||||
|
|
||||||
if (m_debugPacketLevel < 255 && packet.Type == PacketType.AgentUpdate)
|
|
||||||
return;
|
|
||||||
if (m_debugPacketLevel < 254 && packet.Type == PacketType.ViewerEffect)
|
|
||||||
return;
|
|
||||||
if (m_debugPacketLevel < 253 && (
|
|
||||||
packet.Type == PacketType.CompletePingCheck ||
|
|
||||||
packet.Type == PacketType.StartPingCheck
|
|
||||||
))
|
|
||||||
return;
|
|
||||||
if (m_debugPacketLevel < 252 && packet.Type == PacketType.PacketAck)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (m_debugPacketLevel > 1)
|
|
||||||
{
|
|
||||||
info = packet.ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
info = packet.Type.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
Console.WriteLine(m_circuitCode + ":" + direction + ": " + info);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
info = packet.Type.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine(m_circuitCode + ":" + direction + ": " + info);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -853,12 +850,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
if (nextPacket.Incoming)
|
if (nextPacket.Incoming)
|
||||||
{
|
{
|
||||||
DebugPacket("IN", nextPacket.Packet);
|
if (m_debugPacketLevel > 0)
|
||||||
|
DebugPacket("IN", nextPacket.Packet);
|
||||||
m_PacketHandler.ProcessInPacket(nextPacket);
|
m_PacketHandler.ProcessInPacket(nextPacket);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DebugPacket("OUT", nextPacket.Packet);
|
if (m_debugPacketLevel > 0)
|
||||||
|
DebugPacket("OUT", nextPacket.Packet);
|
||||||
m_PacketHandler.ProcessOutPacket(nextPacket);
|
m_PacketHandler.ProcessOutPacket(nextPacket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue