From 0b91ec8dd2b78461cb0fcdec567a83e88a76ac87 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 19 Dec 2011 18:58:05 +0000 Subject: Migrate detailed "appearance show" report generation up to AvatarFactoryModule from AppearanceInfoModule so that it can be used in debug (inactive). Further filters "debug packet " to exclused [Request]ObjectPropertiesFamily if level is below 25. Adjust some method doc Minor changes to some logging messages. --- .../Avatar/AvatarFactory/AvatarFactoryModule.cs | 57 +++++++++++++++++++--- 1 file changed, 49 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 29e3580..f1a81ae 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -26,16 +26,15 @@ */ using System; +using System.Collections.Generic; using System.Reflection; +using System.Threading; +using System.Text; +using System.Timers; using log4net; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; - -using System.Threading; -using System.Timers; -using System.Collections.Generic; - using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; @@ -45,6 +44,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + public const string BAKED_TEXTURES_REPORT_FORMAT = "{0,-9} {1}"; + private Scene m_scene = null; private int m_savetime = 5; // seconds to wait before saving changed appearance @@ -147,9 +149,13 @@ 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); + +// WriteBakedTexturesReport(sp, m_log.DebugFormat); + changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; - m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID); +// WriteBakedTexturesReport(sp, m_log.DebugFormat); ValidateBakedTextureCache(sp, false); // This appears to be set only in the final stage of the appearance @@ -254,9 +260,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory } /// - /// Queue up a request to send appearance, makes it possible to - /// accumulate changes without sending out each one separately. + /// Queue up a request to send appearance. /// + /// + /// Makes it possible to accumulate changes without sending out each one separately. + /// + /// public void QueueAppearanceSend(UUID agentid) { // m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid); @@ -557,5 +566,37 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory } } #endregion + + public void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction outputAction) + { + outputAction("For {0} in {1}", sp.Name, m_scene.RegionInfo.RegionName); + outputAction(BAKED_TEXTURES_REPORT_FORMAT, "Bake Type", "UUID"); + + Dictionary bakedTextures = 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 (m_scene.AssetService.Get(rawTextureID) == null) + rawTextureID += " (not found)"; + else + rawTextureID += " (uploaded)"; + } + + outputAction(BAKED_TEXTURES_REPORT_FORMAT, bt, rawTextureID); + } + + bool bakedTextureValid = m_scene.AvatarFactory.ValidateBakedTextureCache(sp); + outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); + } } } -- cgit v1.1