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.
0.7.2-post-fixes
Justin Clark-Casey (justincc) 2011-11-24 22:08:34 +00:00
parent a819890137
commit 1e88bf78f1
2 changed files with 21 additions and 21 deletions

View File

@ -11613,7 +11613,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
logPacket = false; logPacket = false;
if (logPacket) if (logPacket)
m_log.DebugFormat("[CLIENT]: Packet OUT {0} to {1}", packet.Type, Name); m_log.DebugFormat(
"[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}",
Name, ChildAgentStatus() ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type);
} }
m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method); m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method);
@ -11656,19 +11658,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
if (DebugPacketLevel > 0) if (DebugPacketLevel > 0)
{ {
bool outputPacket = true; bool logPacket = true;
if (DebugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate) if (DebugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate)
outputPacket = false; logPacket = false;
if (DebugPacketLevel <= 200 && packet.Type == PacketType.RequestImage) if (DebugPacketLevel <= 200 && packet.Type == PacketType.RequestImage)
outputPacket = false; logPacket = false;
if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation)) if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
outputPacket = false; logPacket = false;
if (outputPacket) if (logPacket)
m_log.DebugFormat("[CLIENT]: Packet IN {0} from {1}", packet.Type, Name); m_log.DebugFormat(
"[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}",
Name, ChildAgentStatus() ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type);
} }
if (!ProcessPacketMethod(packet)) if (!ProcessPacketMethod(packet))

View File

@ -448,29 +448,25 @@ namespace OpenSim.Region.Framework.Scenes
} }
/// <summary> /// <summary>
/// Set the debug packet level on the current scene. This level governs which packets are printed out to the /// Set the debug packet level on each current scene. This level governs which packets are printed out to the
/// console. /// console.
/// </summary> /// </summary>
/// <param name="newDebug"></param> /// <param name="newDebug"></param>
/// <param name="name">Name of avatar to debug</param> /// <param name="name">Name of avatar to debug</param>
public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name) public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name)
{ {
ForEachCurrentScene( ForEachCurrentScene(scene =>
delegate(Scene scene) scene.ForEachScenePresence(sp =>
{ {
scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) if (name == null || sp.Name == name)
{ {
if (name == null || scenePresence.Name == name) m_log.DebugFormat(
{ "Packet debug for {0} ({1}) set to {2}",
m_log.DebugFormat("Packet debug for {0} {1} set to {2}", sp.Name, sp.IsChildAgent ? "child" : "root", newDebug);
scenePresence.Firstname,
scenePresence.Lastname,
newDebug);
scenePresence.ControllingClient.DebugPacketLevel = newDebug; sp.ControllingClient.DebugPacketLevel = newDebug;
} }
}); })
}
); );
} }