aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-08-31 18:27:10 +0100
committerJustin Clark-Casey (justincc)2010-08-31 18:27:10 +0100
commitb8c58e5f9f5957ae5b28bc17b2db2eb9f55dcd7b (patch)
tree80fd6d3047dfd92daaf6685e7774c88aed30161f /OpenSim/Region
parentminor: Add some method doc to BaseHttpServer.HandleRequest() (diff)
downloadopensim-SC_OLD-b8c58e5f9f5957ae5b28bc17b2db2eb9f55dcd7b.zip
opensim-SC_OLD-b8c58e5f9f5957ae5b28bc17b2db2eb9f55dcd7b.tar.gz
opensim-SC_OLD-b8c58e5f9f5957ae5b28bc17b2db2eb9f55dcd7b.tar.bz2
opensim-SC_OLD-b8c58e5f9f5957ae5b28bc17b2db2eb9f55dcd7b.tar.xz
reinsert functionality to debug log more levels of incoming and outgoing client protocol packets
These levels correspond to packets that one isn't usually interested in when debugging (e.g. regular outgoing SimStats packets) This is equivalent to what we had a year ago before it was removed. It's extremely crude since it doesn't allow one to pick individual clients or packets. However, it can still be useful when debugging packet race conditions.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs8
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs1
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs52
3 files changed, 50 insertions, 11 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 6834606..3c2575d 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -218,7 +218,13 @@ namespace OpenSim
218 218
219 m_console.Commands.AddCommand("region", false, "debug packet", 219 m_console.Commands.AddCommand("region", false, "debug packet",
220 "debug packet <level>", 220 "debug packet <level>",
221 "Turn on packet debugging", Debug); 221 "Turn on packet debugging",
222 "If level > 255 then all incoming and outgoing packets are logged.\n"
223 + "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n"
224 + "If level <= 200 then incoming RequestImage and outgoing ImagePacket, ImageData, LayerData and CoarseLocationUpdate packets are not logged.\n"
225 + "If level <= 100 then incoming ViewerEffect and AgentAnimation and outgoing ViewerEffect and AvatarAnimation packets are not logged.\n"
226 + "If level <= 0 then no packets are logged.",
227 Debug);
222 228
223 m_console.Commands.AddCommand("region", false, "debug scene", 229 m_console.Commands.AddCommand("region", false, "debug scene",
224 "debug scene <cripting> <collisions> <physics>", 230 "debug scene <cripting> <collisions> <physics>",
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 526d3b5..d2d2607 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -36,7 +36,6 @@ using Nini.Config;
36using OpenMetaverse; 36using OpenMetaverse;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Communications; 38using OpenSim.Framework.Communications;
39
40using OpenSim.Framework.Console; 39using OpenSim.Framework.Console;
41using OpenSim.Framework.Servers; 40using OpenSim.Framework.Servers;
42using OpenSim.Framework.Servers.HttpServer; 41using OpenSim.Framework.Servers.HttpServer;
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 0d142f4..fddb966 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
60 public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector 60 public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector
61 { 61 {
62 /// <value> 62 /// <value>
63 /// Debug packet level. At the moment, only 255 does anything (prints out all in and out packets). 63 /// Debug packet level. See OpenSim.RegisterConsoleCommands() for more details.
64 /// </value> 64 /// </value>
65 protected int m_debugPacketLevel = 0; 65 protected int m_debugPacketLevel = 0;
66 66
@@ -11174,8 +11174,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11174 /// handles splitting manually</param> 11174 /// handles splitting manually</param>
11175 protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting) 11175 protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting)
11176 { 11176 {
11177 if (m_debugPacketLevel >= 255) 11177 if (m_debugPacketLevel > 0)
11178 m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); 11178 {
11179 bool outputPacket = true;
11180
11181 if (m_debugPacketLevel <= 255
11182 && (packet.Type == PacketType.SimStats || packet.Type == PacketType.SimulatorViewerTimeMessage))
11183 outputPacket = false;
11184
11185 if (m_debugPacketLevel <= 200
11186 &&
11187 (packet.Type == PacketType.ImagePacket
11188 || packet.Type == PacketType.ImageData
11189 || packet.Type == PacketType.LayerData
11190 || packet.Type == PacketType.CoarseLocationUpdate))
11191 outputPacket = false;
11192
11193 if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.AvatarAnimation || packet.Type == PacketType.ViewerEffect))
11194 outputPacket = false;
11195
11196 if (outputPacket)
11197 m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type);
11198 }
11179 11199
11180 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting); 11200 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting);
11181 } 11201 }
@@ -11246,15 +11266,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11246 /// Entryway from the client to the simulator. All UDP packets from the client will end up here 11266 /// Entryway from the client to the simulator. All UDP packets from the client will end up here
11247 /// </summary> 11267 /// </summary>
11248 /// <param name="Pack">OpenMetaverse.packet</param> 11268 /// <param name="Pack">OpenMetaverse.packet</param>
11249 public void ProcessInPacket(Packet Pack) 11269 public void ProcessInPacket(Packet packet)
11250 { 11270 {
11251 if (m_debugPacketLevel >= 255) 11271 if (m_debugPacketLevel > 0)
11252 m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type); 11272 {
11273 bool outputPacket = true;
11274
11275 if (m_debugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate)
11276 outputPacket = false;
11277
11278 if (m_debugPacketLevel <= 200 && packet.Type == PacketType.RequestImage)
11279 outputPacket = false;
11280
11281 if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
11282 outputPacket = false;
11283
11284 if (outputPacket)
11285 m_log.DebugFormat("[CLIENT]: Packet IN {0}", packet.Type);
11286 }
11253 11287
11254 if (!ProcessPacketMethod(Pack)) 11288 if (!ProcessPacketMethod(packet))
11255 m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type); 11289 m_log.Warn("[CLIENT]: unhandled packet " + packet.Type);
11256 11290
11257 PacketPool.Instance.ReturnPacket(Pack); 11291 PacketPool.Instance.ReturnPacket(packet);
11258 } 11292 }
11259 11293
11260 private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) 11294 private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket)