From b9a461c5ad10753e98a17b17858cc3b2eae568ea Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 6 Dec 2011 18:32:27 +0000 Subject: In "appearance show", if a particular avatar is specified, print out texture UUID for each bake type and whether the simulator can find it. --- .../Avatar/Appearance/AppearanceInfoModule.cs | 40 +++++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs index b6dfc5c..b949059 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs @@ -49,9 +49,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance public class AppearanceInfoModule : ISharedRegionModule { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - protected Dictionary m_scenes = new Dictionary(); - protected IAvatarFactoryModule m_avatarFactory; + + public const string SHOW_APPEARANCE_FORMAT = "{0,-9} {1}"; + + private Dictionary m_scenes = new Dictionary(); + private IAvatarFactoryModule m_avatarFactory; public string Name { get { return "Appearance Information Module"; } } @@ -96,8 +98,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance this, "appearance show", "appearance show", "Show appearance information for each avatar in the simulator.", - "Optionally, you can view just a particular avatar's appearance information" - + "\nAt the moment this actually just checks that we have all the required baked textures. If not, then appearance is 'corrupt' and other avatars will continue to see a cloud.", + "This command checks whether the simulator has all the baked textures required to display an avatar to other viewers. " + + "\nIf not, then appearance is 'corrupt' and other avatars will continue to see it as a cloud." + + "\nOptionally, you can view just a particular avatar's appearance information." + + "\nIn this case, the texture UUID for each bake type is also shown and whether the simulator can find the referenced texture.", HandleShowAppearanceCommand); scene.AddCommand( @@ -188,6 +192,32 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName); if (sp != null && !sp.IsChildAgent) { + MainConsole.Instance.OutputFormat("For {0} in {1}", sp.Name, scene.RegionInfo.RegionName); + MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, "Bake Type", "UUID"); + + Dictionary bakedTextures + = scene.AvatarFactory.GetBakedTextureFaces(sp.UUID); + foreach (BakeType bt in bakedTextures.Keys) + { + string rawTextureID; + + if (bakedTextures[bt] == null) + { + rawTextureID = "not set"; + } + else + { + rawTextureID = bakedTextures[bt].TextureID.ToString(); + + if (scene.AssetService.Get(rawTextureID) == null) + rawTextureID += " (not found)"; + else + rawTextureID += " (uploaded)"; + } + + MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, bt, rawTextureID); + } + bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp); MainConsole.Instance.OutputFormat( "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); -- cgit v1.1