mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 14:16:07 +08:00
* 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.
This commit is contained in:
@@ -809,33 +809,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
info = packet.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
info = packet.Type.ToString();
|
||||
}
|
||||
|
||||
Console.WriteLine(m_circuitCode + ":" + direction + ": " + info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -853,12 +850,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
if (nextPacket.Incoming)
|
||||
{
|
||||
DebugPacket("IN", nextPacket.Packet);
|
||||
if (m_debugPacketLevel > 0)
|
||||
DebugPacket("IN", nextPacket.Packet);
|
||||
m_PacketHandler.ProcessInPacket(nextPacket);
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugPacket("OUT", nextPacket.Packet);
|
||||
if (m_debugPacketLevel > 0)
|
||||
DebugPacket("OUT", nextPacket.Packet);
|
||||
m_PacketHandler.ProcessOutPacket(nextPacket);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user