In "appearance show", if a particular avatar is specified, print out texture UUID for each bake type and whether the simulator can find it.

0.7.2-post-fixes
Justin Clark-Casey (justincc) 2011-12-06 18:32:27 +00:00
parent cd132966df
commit ddb74bc68d
1 changed files with 36 additions and 5 deletions

View File

@ -49,9 +49,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
public class AppearanceInfoModule : ISharedRegionModule public class AppearanceInfoModule : ISharedRegionModule
{ {
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>(); public const string SHOW_APPEARANCE_FORMAT = "{0,-9} {1}";
protected IAvatarFactory m_avatarFactory;
private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
private IAvatarFactory m_avatarFactory;
public string Name { get { return "Appearance Information Module"; } } public string Name { get { return "Appearance Information Module"; } }
@ -96,8 +98,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
this, "appearance show", this, "appearance show",
"appearance show", "appearance show",
"Show appearance information for each avatar in the simulator.", "Show appearance information for each avatar in the simulator.",
"Optionally, you can view just a particular avatar's appearance information" "This command checks whether the simulator has all the baked textures required to display an avatar to other viewers. "
+ "\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.", + "\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); HandleShowAppearanceCommand);
scene.AddCommand( scene.AddCommand(
@ -188,7 +192,34 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName); ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName);
if (sp != null && !sp.IsChildAgent) 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<BakeType, Primitive.TextureEntryFace> 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.ControllingClient); bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp.ControllingClient);
MainConsole.Instance.OutputFormat( MainConsole.Instance.OutputFormat(
"{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
} }