From d67e8291c86beb5c3c8e8b11a7f95b49c834c779 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 10 Jan 2012 18:41:07 +0000 Subject: [PATCH 1/4] Add "app find " command to find the appearance using a particular baked texture, if any. This is for debugging to relate texture console entries back to particular users on the simulator end. --- .../Avatar/Appearance/AppearanceInfoModule.cs | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs index 39cd4c992c..2369d94aa1 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Reflection; using System.Text; using log4net; @@ -124,6 +125,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance + "\nIf the viewer has not yet sent the server any texture ids then nothing will happen" + "\nsince requests can only be made for ids that the client has already sent us", HandleRebakeAppearanceCommand); + + scene.AddCommand( + this, "appearance find", + "appearance find ", + "Find out which avatar uses the given asset as a baked texture, if any.", + "You can specify just the beginning of the uuid, e.g. 2008a8d. A longer UUID must be in dashed format.", + HandleFindAppearanceCommand); } private void HandleSendAppearanceCommand(string module, string[] cmd) @@ -254,5 +262,47 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance } } } + + protected void HandleFindAppearanceCommand(string module, string[] cmd) + { + if (cmd.Length != 3) + { + MainConsole.Instance.OutputFormat("Usage: appearance find "); + return; + } + + string rawUuid = cmd[2]; + + HashSet matchedAvatars = new HashSet(); + + lock (m_scenes) + { + foreach (Scene scene in m_scenes.Values) + { + scene.ForEachRootScenePresence( + sp => + { + Dictionary bakedFaces = scene.AvatarFactory.GetBakedTextureFaces(sp.UUID); + foreach (Primitive.TextureEntryFace face in bakedFaces.Values) + { + if (face != null && face.TextureID.ToString().StartsWith(rawUuid)) + matchedAvatars.Add(sp); + } + }); + } + } + + if (matchedAvatars.Count == 0) + { + MainConsole.Instance.OutputFormat("{0} did not match any baked avatar textures in use", rawUuid); + } + else + { + MainConsole.Instance.OutputFormat( + "{0} matched {1}", + rawUuid, + string.Join(", ", matchedAvatars.ToList().ConvertAll(sp => sp.Name).ToArray())); + } + } } } \ No newline at end of file From 3deb52d3996b45228c2301ecc7445514099f3b13 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Tue, 10 Jan 2012 13:41:35 -0500 Subject: [PATCH 2/4] Teleport Debugging Move setting from ini to existing facitilies - thanks justincc toggle with console command: debug teleport --- OpenSim/Region/Application/OpenSim.cs | 17 +++++++++++++++++ OpenSim/Region/Framework/Scenes/Scene.cs | 2 -- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 3a1a8c7c53..867e36d77e 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -250,6 +250,8 @@ namespace OpenSim + "If level <= 0 then no extra http logging is done.\n", Debug); + m_console.Commands.AddCommand("region", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug); + m_console.Commands.AddCommand("region", false, "debug scene", "debug scene ", "Turn on scene debugging", Debug); @@ -948,6 +950,21 @@ namespace OpenSim break; + case "teleport": + foreach(Scene s in m_sceneManager.Scenes) + { + if (s.DEBUG) + { + s.DEBUG = false; + MainConsole.Instance.Output("Teleport debugging is disabled!"); + } + else{ + s.DEBUG = true; + MainConsole.Instance.Output("Teleport debugging is enabled!"); + } + } + break; + default: MainConsole.Instance.Output("Unknown debug command"); break; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index ed6f68a112..f03c345072 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -651,8 +651,6 @@ namespace OpenSim.Region.Framework.Scenes // IConfig startupConfig = m_config.Configs["Startup"]; - DEBUG = startupConfig.GetBoolean("DEBUG", false); - m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance); m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup); if (!m_useBackup) From a3bb1a81de9f39b126a04afb984483f7e4a4aa24 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 10 Jan 2012 18:47:30 +0000 Subject: [PATCH 3/4] correct very minor typo in "debug scene" help --- OpenSim/Region/Application/OpenSim.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 867e36d77e..832d93cca3 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -253,7 +253,7 @@ namespace OpenSim m_console.Commands.AddCommand("region", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug); m_console.Commands.AddCommand("region", false, "debug scene", - "debug scene ", + "debug scene ", "Turn on scene debugging", Debug); m_console.Commands.AddCommand("region", false, "change region", From 18497cef73c5dc5609caebe59fb7980e2542574d Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 10 Jan 2012 18:54:20 +0000 Subject: [PATCH 4/4] Add avatar names to appearance log messages --- .../CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index d68d28c345..8d503bd7e6 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // Process the baked texture array if (textureEntry != null) { - m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID); + m_log.InfoFormat("[AVFACTORY]: Received texture update for {0} {1}", sp.Name, sp.UUID); // WriteBakedTexturesReport(sp, m_log.DebugFormat); @@ -315,7 +315,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory return false; } - m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0}", sp.UUID); + m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0} {1}", sp.Name, sp.UUID); // If we only found default textures, then the appearance is not cached return (defonly ? false : true); @@ -626,4 +626,4 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); } } -} +} \ No newline at end of file