From a58f5b2f6679bfb8565741afaead7e6d8dc8c299 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Nov 2011 22:08:34 +0000 Subject: 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. --- OpenSim/Region/Framework/Scenes/SceneManager.cs | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/Framework') 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 } /// - /// 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. /// /// /// Name of avatar to debug public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name) { - ForEachCurrentScene( - delegate(Scene scene) + ForEachCurrentScene(scene => + scene.ForEachScenePresence(sp => { - scene.ForEachRootClient(delegate(IClientAPI client) + if (name == null || sp.Name == name) { - if (name == null || client.Name == name) - { - m_log.DebugFormat("Packet debug for {0} {1} set to {2}", - client.FirstName, - client.LastName, - newDebug); + m_log.DebugFormat( + "Packet debug for {0} ({1}) set to {2}", + sp.Name, sp.IsChildAgent ? "child" : "root", newDebug); - client.DebugPacketLevel = newDebug; - } - }); - } + sp.ControllingClient.DebugPacketLevel = newDebug; + } + }) ); } -- cgit v1.1