diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 57 |
1 files changed, 49 insertions, 8 deletions
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 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | ||
29 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Threading; | ||
32 | using System.Text; | ||
33 | using System.Timers; | ||
30 | using log4net; | 34 | using log4net; |
31 | using Nini.Config; | 35 | using Nini.Config; |
32 | using OpenMetaverse; | 36 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
34 | |||
35 | using System.Threading; | ||
36 | using System.Timers; | ||
37 | using System.Collections.Generic; | ||
38 | |||
39 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
40 | using OpenSim.Region.Framework.Scenes; | 39 | using OpenSim.Region.Framework.Scenes; |
41 | using OpenSim.Services.Interfaces; | 40 | using OpenSim.Services.Interfaces; |
@@ -45,6 +44,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
45 | public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule | 44 | public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule |
46 | { | 45 | { |
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | |||
48 | public const string BAKED_TEXTURES_REPORT_FORMAT = "{0,-9} {1}"; | ||
49 | |||
48 | private Scene m_scene = null; | 50 | private Scene m_scene = null; |
49 | 51 | ||
50 | private int m_savetime = 5; // seconds to wait before saving changed appearance | 52 | private int m_savetime = 5; // seconds to wait before saving changed appearance |
@@ -147,9 +149,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
147 | // Process the baked texture array | 149 | // Process the baked texture array |
148 | if (textureEntry != null) | 150 | if (textureEntry != null) |
149 | { | 151 | { |
152 | m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID); | ||
153 | |||
154 | // WriteBakedTexturesReport(sp, m_log.DebugFormat); | ||
155 | |||
150 | changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; | 156 | changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; |
151 | 157 | ||
152 | m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID); | 158 | // WriteBakedTexturesReport(sp, m_log.DebugFormat); |
153 | ValidateBakedTextureCache(sp, false); | 159 | ValidateBakedTextureCache(sp, false); |
154 | 160 | ||
155 | // This appears to be set only in the final stage of the appearance | 161 | // This appears to be set only in the final stage of the appearance |
@@ -254,9 +260,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
254 | } | 260 | } |
255 | 261 | ||
256 | /// <summary> | 262 | /// <summary> |
257 | /// Queue up a request to send appearance, makes it possible to | 263 | /// Queue up a request to send appearance. |
258 | /// accumulate changes without sending out each one separately. | ||
259 | /// </summary> | 264 | /// </summary> |
265 | /// <remarks> | ||
266 | /// Makes it possible to accumulate changes without sending out each one separately. | ||
267 | /// </remarks> | ||
268 | /// <param name="agentId"></param> | ||
260 | public void QueueAppearanceSend(UUID agentid) | 269 | public void QueueAppearanceSend(UUID agentid) |
261 | { | 270 | { |
262 | // m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid); | 271 | // m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid); |
@@ -557,5 +566,37 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
557 | } | 566 | } |
558 | } | 567 | } |
559 | #endregion | 568 | #endregion |
569 | |||
570 | public void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction outputAction) | ||
571 | { | ||
572 | outputAction("For {0} in {1}", sp.Name, m_scene.RegionInfo.RegionName); | ||
573 | outputAction(BAKED_TEXTURES_REPORT_FORMAT, "Bake Type", "UUID"); | ||
574 | |||
575 | Dictionary<BakeType, Primitive.TextureEntryFace> bakedTextures = GetBakedTextureFaces(sp.UUID); | ||
576 | |||
577 | foreach (BakeType bt in bakedTextures.Keys) | ||
578 | { | ||
579 | string rawTextureID; | ||
580 | |||
581 | if (bakedTextures[bt] == null) | ||
582 | { | ||
583 | rawTextureID = "not set"; | ||
584 | } | ||
585 | else | ||
586 | { | ||
587 | rawTextureID = bakedTextures[bt].TextureID.ToString(); | ||
588 | |||
589 | if (m_scene.AssetService.Get(rawTextureID) == null) | ||
590 | rawTextureID += " (not found)"; | ||
591 | else | ||
592 | rawTextureID += " (uploaded)"; | ||
593 | } | ||
594 | |||
595 | outputAction(BAKED_TEXTURES_REPORT_FORMAT, bt, rawTextureID); | ||
596 | } | ||
597 | |||
598 | bool bakedTextureValid = m_scene.AvatarFactory.ValidateBakedTextureCache(sp); | ||
599 | outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); | ||
600 | } | ||
560 | } | 601 | } |
561 | } | 602 | } |