aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP
diff options
context:
space:
mode:
authorArthur Valadares2009-06-29 19:24:30 +0000
committerArthur Valadares2009-06-29 19:24:30 +0000
commit4f6efa024981d9cb988e150bad42a72887fed46a (patch)
tree21f34dad7711b1527a20aa112784566da79f68c2 /OpenSim/Region/ClientStack/LindenUDP
parentThank you kindly, Snowdrop/Snowcrash for a patch that: (diff)
downloadopensim-SC-4f6efa024981d9cb988e150bad42a72887fed46a.zip
opensim-SC-4f6efa024981d9cb988e150bad42a72887fed46a.tar.gz
opensim-SC-4f6efa024981d9cb988e150bad42a72887fed46a.tar.bz2
opensim-SC-4f6efa024981d9cb988e150bad42a72887fed46a.tar.xz
* 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.
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs51
1 files changed, 25 insertions, 26 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index b9ac265..3813367 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -809,33 +809,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP
809 809
810 protected void DebugPacket(string direction, Packet packet) 810 protected void DebugPacket(string direction, Packet packet)
811 { 811 {
812 if (m_debugPacketLevel > 0) 812 string info;
813 {
814 string info;
815
816 if (m_debugPacketLevel < 255 && packet.Type == PacketType.AgentUpdate)
817 return;
818 if (m_debugPacketLevel < 254 && packet.Type == PacketType.ViewerEffect)
819 return;
820 if (m_debugPacketLevel < 253 && (
821 packet.Type == PacketType.CompletePingCheck ||
822 packet.Type == PacketType.StartPingCheck
823 ))
824 return;
825 if (m_debugPacketLevel < 252 && packet.Type == PacketType.PacketAck)
826 return;
827 813
828 if (m_debugPacketLevel > 1) 814 if (m_debugPacketLevel < 255 && packet.Type == PacketType.AgentUpdate)
829 { 815 return;
830 info = packet.ToString(); 816 if (m_debugPacketLevel < 254 && packet.Type == PacketType.ViewerEffect)
831 } 817 return;
832 else 818 if (m_debugPacketLevel < 253 && (
833 { 819 packet.Type == PacketType.CompletePingCheck ||
834 info = packet.Type.ToString(); 820 packet.Type == PacketType.StartPingCheck
835 } 821 ))
822 return;
823 if (m_debugPacketLevel < 252 && packet.Type == PacketType.PacketAck)
824 return;
836 825
837 Console.WriteLine(m_circuitCode + ":" + direction + ": " + info); 826 if (m_debugPacketLevel > 1)
827 {
828 info = packet.ToString();
838 } 829 }
830 else
831 {
832 info = packet.Type.ToString();
833 }
834
835 Console.WriteLine(m_circuitCode + ":" + direction + ": " + info);
839 } 836 }
840 837
841 /// <summary> 838 /// <summary>
@@ -853,12 +850,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
853 850
854 if (nextPacket.Incoming) 851 if (nextPacket.Incoming)
855 { 852 {
856 DebugPacket("IN", nextPacket.Packet); 853 if (m_debugPacketLevel > 0)
854 DebugPacket("IN", nextPacket.Packet);
857 m_PacketHandler.ProcessInPacket(nextPacket); 855 m_PacketHandler.ProcessInPacket(nextPacket);
858 } 856 }
859 else 857 else
860 { 858 {
861 DebugPacket("OUT", nextPacket.Packet); 859 if (m_debugPacketLevel > 0)
860 DebugPacket("OUT", nextPacket.Packet);
862 m_PacketHandler.ProcessOutPacket(nextPacket); 861 m_PacketHandler.ProcessOutPacket(nextPacket);
863 } 862 }
864 } 863 }