aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/ClientView.cs
diff options
context:
space:
mode:
authorDalien Talbot2007-09-13 16:39:04 +0000
committerDalien Talbot2007-09-13 16:39:04 +0000
commit1703cacaab91a980c96458f0f49284ab68168130 (patch)
tree233773070afd5b4018fe0c18438b20d95f2f7b06 /OpenSim/Region/ClientStack/ClientView.cs
parentllSetPos(), llGetPos(), llGetLocalPos() now implemented (diff)
downloadopensim-SC-1703cacaab91a980c96458f0f49284ab68168130.zip
opensim-SC-1703cacaab91a980c96458f0f49284ab68168130.tar.gz
opensim-SC-1703cacaab91a980c96458f0f49284ab68168130.tar.bz2
opensim-SC-1703cacaab91a980c96458f0f49284ab68168130.tar.xz
Added CLI "debug packet 0..255" to enable the in/out packet dumps with various verbosity
Diffstat (limited to 'OpenSim/Region/ClientStack/ClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs34
1 files changed, 33 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 4d7dbda..54c9a0d 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Region.ClientStack
70 70
71 //private AgentAssetUpload UploadAssets; 71 //private AgentAssetUpload UploadAssets;
72 private LLUUID newAssetFolder = LLUUID.Zero; 72 private LLUUID newAssetFolder = LLUUID.Zero;
73 private bool debug = false; 73 private int debug = 0;
74 protected IScene m_scene; 74 protected IScene m_scene;
75 private Dictionary<uint, ClientView> m_clientThreads; 75 private Dictionary<uint, ClientView> m_clientThreads;
76 private AssetCache m_assetCache; 76 private AssetCache m_assetCache;
@@ -116,6 +116,11 @@ namespace OpenSim.Region.ClientStack
116 ClientThread.Start(); 116 ClientThread.Start();
117 } 117 }
118 118
119 public void SetDebug(int newDebug)
120 {
121 debug = newDebug;
122 }
123
119 # region Client Methods 124 # region Client Methods
120 125
121 public void KillClient() 126 public void KillClient()
@@ -192,6 +197,31 @@ namespace OpenSim.Region.ClientStack
192 return result; 197 return result;
193 } 198 }
194 199
200 protected void DebugPacket(string direction, Packet packet)
201 {
202 if (debug > 0) {
203 string info;
204 if (debug < 255 && packet.Type == PacketType.AgentUpdate)
205 return;
206 if (debug < 254 && packet.Type == PacketType.ViewerEffect)
207 return;
208 if (debug < 253 && (
209 packet.Type == PacketType.CompletePingCheck ||
210 packet.Type == PacketType.StartPingCheck
211 ) )
212 return;
213 if (debug < 252 && packet.Type == PacketType.PacketAck)
214 return;
215
216 if (debug > 1) {
217 info = packet.ToString();
218 } else {
219 info = packet.Type.ToString();
220 }
221 Console.WriteLine(CircuitCode + ":" + direction + ": " + info);
222 }
223 }
224
195 protected virtual void ClientLoop() 225 protected virtual void ClientLoop()
196 { 226 {
197 MainLog.Instance.Verbose("OpenSimClient.cs:ClientLoop() - Entered loop"); 227 MainLog.Instance.Verbose("OpenSimClient.cs:ClientLoop() - Entered loop");
@@ -205,11 +235,13 @@ namespace OpenSim.Region.ClientStack
205 { 235 {
206 packetsReceived++; 236 packetsReceived++;
207 } 237 }
238 DebugPacket("IN", nextPacket.Packet);
208 ProcessInPacket(nextPacket.Packet); 239 ProcessInPacket(nextPacket.Packet);
209 } 240 }
210 else 241 else
211 { 242 {
212 //is a out going packet 243 //is a out going packet
244 DebugPacket("OUT", nextPacket.Packet);
213 ProcessOutPacket(nextPacket.Packet); 245 ProcessOutPacket(nextPacket.Packet);
214 } 246 }
215 } 247 }