aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
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
parentllSetPos(), llGetPos(), llGetLocalPos() now implemented (diff)
downloadopensim-SC_OLD-1703cacaab91a980c96458f0f49284ab68168130.zip
opensim-SC_OLD-1703cacaab91a980c96458f0f49284ab68168130.tar.gz
opensim-SC_OLD-1703cacaab91a980c96458f0f49284ab68168130.tar.bz2
opensim-SC_OLD-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')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs7
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs34
-rw-r--r--OpenSim/Region/ClientStack/ClientViewBase.cs2
3 files changed, 33 insertions, 10 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index d2f311b..fab5433 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -62,13 +62,6 @@ namespace OpenSim.Region.ClientStack
62 protected override void ProcessInPacket(Packet Pack) 62 protected override void ProcessInPacket(Packet Pack)
63 { 63 {
64 ack_pack(Pack); 64 ack_pack(Pack);
65 if (debug)
66 {
67 if (Pack.Type != PacketType.AgentUpdate)
68 {
69 Console.WriteLine(CircuitCode + ":IN: " + Pack.Type.ToString());
70 }
71 }
72 65
73 if (this.ProcessPacketMethod(Pack)) 66 if (this.ProcessPacketMethod(Pack))
74 { 67 {
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 }
diff --git a/OpenSim/Region/ClientStack/ClientViewBase.cs b/OpenSim/Region/ClientStack/ClientViewBase.cs
index 8ff5a11..80d7e53 100644
--- a/OpenSim/Region/ClientStack/ClientViewBase.cs
+++ b/OpenSim/Region/ClientStack/ClientViewBase.cs
@@ -71,8 +71,6 @@ namespace OpenSim.Region.ClientStack
71 // Keep track of when this packet was sent out 71 // Keep track of when this packet was sent out
72 Pack.TickCount = System.Environment.TickCount; 72 Pack.TickCount = System.Environment.TickCount;
73 73
74 // Console.WriteLine(CircuitCode + ":OUT: " + Pack.Type.ToString());
75
76 if (!Pack.Header.Resent) 74 if (!Pack.Header.Resent)
77 { 75 {
78 // Set the sequence number 76 // Set the sequence number