diff options
author | Justin Clark-Casey (justincc) | 2011-10-17 20:58:23 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-10-17 20:58:23 +0100 |
commit | aeb4ff02744573cb91e8991bf9df81412b80e156 (patch) | |
tree | 8821cab3c5fd3482559a6b1038c9facfa7526bd5 /OpenSim/Region | |
parent | refactor: Make IClientAPI.DebugPacketFormat a property rather than a setter w... (diff) | |
download | opensim-SC-aeb4ff02744573cb91e8991bf9df81412b80e156.zip opensim-SC-aeb4ff02744573cb91e8991bf9df81412b80e156.tar.gz opensim-SC-aeb4ff02744573cb91e8991bf9df81412b80e156.tar.bz2 opensim-SC-aeb4ff02744573cb91e8991bf9df81412b80e156.tar.xz |
Allow an avatar to be explicitly named to the "debug packet" command
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneManager.cs | 5 |
2 files changed, 11 insertions, 6 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 09958b1..eea008b 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -216,14 +216,15 @@ namespace OpenSim | |||
216 | HandleForceUpdate); | 216 | HandleForceUpdate); |
217 | 217 | ||
218 | m_console.Commands.AddCommand("region", false, "debug packet", | 218 | m_console.Commands.AddCommand("region", false, "debug packet", |
219 | "debug packet <level>", | 219 | "debug packet <level> [<avatar-first-name> <avatar-last-name>]", |
220 | "Turn on packet debugging", | 220 | "Turn on packet debugging", |
221 | "If level > 255 then all incoming and outgoing packets are logged.\n" | 221 | "If level > 255 then all incoming and outgoing packets are logged.\n" |
222 | + "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n" | 222 | + "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n" |
223 | + "If level <= 200 then incoming RequestImage and outgoing ImagePacket, ImageData, LayerData and CoarseLocationUpdate packets are not logged.\n" | 223 | + "If level <= 200 then incoming RequestImage and outgoing ImagePacket, ImageData, LayerData and CoarseLocationUpdate packets are not logged.\n" |
224 | + "If level <= 100 then incoming ViewerEffect and AgentAnimation and outgoing ViewerEffect and AvatarAnimation packets are not logged.\n" | 224 | + "If level <= 100 then incoming ViewerEffect and AgentAnimation and outgoing ViewerEffect and AvatarAnimation packets are not logged.\n" |
225 | + "If level <= 50 then outgoing ImprovedTerseObjectUpdate packets are not logged.\n" | 225 | + "If level <= 50 then outgoing ImprovedTerseObjectUpdate packets are not logged.\n" |
226 | + "If level <= 0 then no packets are logged.", | 226 | + "If level <= 0 then no packets are logged.\n" |
227 | + "If an avatar name is given then only packets from that avatar are logged", | ||
227 | Debug); | 228 | Debug); |
228 | 229 | ||
229 | m_console.Commands.AddCommand("region", false, "debug scene", | 230 | m_console.Commands.AddCommand("region", false, "debug scene", |
@@ -845,18 +846,21 @@ namespace OpenSim | |||
845 | switch (args[1]) | 846 | switch (args[1]) |
846 | { | 847 | { |
847 | case "packet": | 848 | case "packet": |
849 | string name = null; | ||
850 | if (args.Length == 5) | ||
851 | name = string.Format("{0} {1}", args[3], args[4]); | ||
852 | |||
848 | if (args.Length > 2) | 853 | if (args.Length > 2) |
849 | { | 854 | { |
850 | int newDebug; | 855 | int newDebug; |
851 | if (int.TryParse(args[2], out newDebug)) | 856 | if (int.TryParse(args[2], out newDebug)) |
852 | { | 857 | { |
853 | m_sceneManager.SetDebugPacketLevelOnCurrentScene(newDebug); | 858 | m_sceneManager.SetDebugPacketLevelOnCurrentScene(newDebug, name); |
854 | } | 859 | } |
855 | else | 860 | else |
856 | { | 861 | { |
857 | MainConsole.Instance.Output("packet debug should be 0..255"); | 862 | MainConsole.Instance.Output("packet debug should be 0..255"); |
858 | } | 863 | } |
859 | MainConsole.Instance.Output(String.Format("New packet debug: {0}", newDebug)); | ||
860 | } | 864 | } |
861 | 865 | ||
862 | break; | 866 | break; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index c91744c..a58b87d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs | |||
@@ -452,14 +452,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
452 | /// console. | 452 | /// console. |
453 | /// </summary> | 453 | /// </summary> |
454 | /// <param name="newDebug"></param> | 454 | /// <param name="newDebug"></param> |
455 | public void SetDebugPacketLevelOnCurrentScene(int newDebug) | 455 | /// <param name="name">Name of avatar to debug</param> |
456 | public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name) | ||
456 | { | 457 | { |
457 | ForEachCurrentScene( | 458 | ForEachCurrentScene( |
458 | delegate(Scene scene) | 459 | delegate(Scene scene) |
459 | { | 460 | { |
460 | scene.ForEachScenePresence(delegate(ScenePresence scenePresence) | 461 | scene.ForEachScenePresence(delegate(ScenePresence scenePresence) |
461 | { | 462 | { |
462 | if (!scenePresence.IsChildAgent) | 463 | if (!scenePresence.IsChildAgent && (name == null || scenePresence.Name == name)) |
463 | { | 464 | { |
464 | m_log.DebugFormat("Packet debug for {0} {1} set to {2}", | 465 | m_log.DebugFormat("Packet debug for {0} {1} set to {2}", |
465 | scenePresence.Firstname, | 466 | scenePresence.Firstname, |