aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-11-24 22:08:34 +0000
committerJustin Clark-Casey (justincc)2011-11-24 22:08:34 +0000
commita58f5b2f6679bfb8565741afaead7e6d8dc8c299 (patch)
tree733cf5d704a8f5e95a03165515249a1286eb7a42
parentcomment out a noisy log line I accidentally left in from the last commit (diff)
downloadopensim-SC_OLD-a58f5b2f6679bfb8565741afaead7e6d8dc8c299.zip
opensim-SC_OLD-a58f5b2f6679bfb8565741afaead7e6d8dc8c299.tar.gz
opensim-SC_OLD-a58f5b2f6679bfb8565741afaead7e6d8dc8c299.tar.bz2
opensim-SC_OLD-a58f5b2f6679bfb8565741afaead7e6d8dc8c299.tar.xz
When setting packet level logging via "debug packet", apply to all clients, not just root ones.
Also adds scene name and client type (root|child) to logged information.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneManager.cs24
2 files changed, 21 insertions, 21 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 133da0f..7d39ddc 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -11621,7 +11621,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11621 logPacket = false; 11621 logPacket = false;
11622 11622
11623 if (logPacket) 11623 if (logPacket)
11624 m_log.DebugFormat("[CLIENT]: Packet OUT {0} to {1}", packet.Type, Name); 11624 m_log.DebugFormat(
11625 "[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}",
11626 Name, ChildAgentStatus() ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type);
11625 } 11627 }
11626 11628
11627 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method); 11629 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method);
@@ -11664,19 +11666,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11664 { 11666 {
11665 if (DebugPacketLevel > 0) 11667 if (DebugPacketLevel > 0)
11666 { 11668 {
11667 bool outputPacket = true; 11669 bool logPacket = true;
11668 11670
11669 if (DebugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate) 11671 if (DebugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate)
11670 outputPacket = false; 11672 logPacket = false;
11671 11673
11672 if (DebugPacketLevel <= 200 && packet.Type == PacketType.RequestImage) 11674 if (DebugPacketLevel <= 200 && packet.Type == PacketType.RequestImage)
11673 outputPacket = false; 11675 logPacket = false;
11674 11676
11675 if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation)) 11677 if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
11676 outputPacket = false; 11678 logPacket = false;
11677 11679
11678 if (outputPacket) 11680 if (logPacket)
11679 m_log.DebugFormat("[CLIENT]: Packet IN {0} from {1}", packet.Type, Name); 11681 m_log.DebugFormat(
11682 "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}",
11683 Name, ChildAgentStatus() ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type);
11680 } 11684 }
11681 11685
11682 if (!ProcessPacketMethod(packet)) 11686 if (!ProcessPacketMethod(packet))
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index eeb087f..82458e2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -448,29 +448,25 @@ namespace OpenSim.Region.Framework.Scenes
448 } 448 }
449 449
450 /// <summary> 450 /// <summary>
451 /// Set the debug packet level on the current scene. This level governs which packets are printed out to the 451 /// Set the debug packet level on each current scene. This level governs which packets are printed out to the
452 /// console. 452 /// console.
453 /// </summary> 453 /// </summary>
454 /// <param name="newDebug"></param> 454 /// <param name="newDebug"></param>
455 /// <param name="name">Name of avatar to debug</param> 455 /// <param name="name">Name of avatar to debug</param>
456 public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name) 456 public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name)
457 { 457 {
458 ForEachCurrentScene( 458 ForEachCurrentScene(scene =>
459 delegate(Scene scene) 459 scene.ForEachScenePresence(sp =>
460 { 460 {
461 scene.ForEachRootClient(delegate(IClientAPI client) 461 if (name == null || sp.Name == name)
462 { 462 {
463 if (name == null || client.Name == name) 463 m_log.DebugFormat(
464 { 464 "Packet debug for {0} ({1}) set to {2}",
465 m_log.DebugFormat("Packet debug for {0} {1} set to {2}", 465 sp.Name, sp.IsChildAgent ? "child" : "root", newDebug);
466 client.FirstName,
467 client.LastName,
468 newDebug);
469 466
470 client.DebugPacketLevel = newDebug; 467 sp.ControllingClient.DebugPacketLevel = newDebug;
471 } 468 }
472 }); 469 })
473 }
474 ); 470 );
475 } 471 }
476 472