diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 66 |
1 files changed, 55 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 29e3580..e8aee3e 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); |
@@ -408,10 +417,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
408 | m_savequeue.Remove(avatarID); | 417 | m_savequeue.Remove(avatarID); |
409 | } | 418 | } |
410 | } | 419 | } |
411 | } | ||
412 | 420 | ||
413 | if (m_savequeue.Count == 0 && m_sendqueue.Count == 0) | 421 | // We must lock both queues here so that QueueAppearanceSave() or *Send() don't m_updateTimer.Start() on |
414 | m_updateTimer.Stop(); | 422 | // another thread inbetween the first count calls and m_updateTimer.Stop() on this thread. |
423 | lock (m_sendqueue) | ||
424 | if (m_savequeue.Count == 0 && m_sendqueue.Count == 0) | ||
425 | m_updateTimer.Stop(); | ||
426 | } | ||
415 | } | 427 | } |
416 | 428 | ||
417 | private void SaveAppearance(UUID agentid) | 429 | private void SaveAppearance(UUID agentid) |
@@ -557,5 +569,37 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
557 | } | 569 | } |
558 | } | 570 | } |
559 | #endregion | 571 | #endregion |
572 | |||
573 | public void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction outputAction) | ||
574 | { | ||
575 | outputAction("For {0} in {1}", sp.Name, m_scene.RegionInfo.RegionName); | ||
576 | outputAction(BAKED_TEXTURES_REPORT_FORMAT, "Bake Type", "UUID"); | ||
577 | |||
578 | Dictionary<BakeType, Primitive.TextureEntryFace> bakedTextures = GetBakedTextureFaces(sp.UUID); | ||
579 | |||
580 | foreach (BakeType bt in bakedTextures.Keys) | ||
581 | { | ||
582 | string rawTextureID; | ||
583 | |||
584 | if (bakedTextures[bt] == null) | ||
585 | { | ||
586 | rawTextureID = "not set"; | ||
587 | } | ||
588 | else | ||
589 | { | ||
590 | rawTextureID = bakedTextures[bt].TextureID.ToString(); | ||
591 | |||
592 | if (m_scene.AssetService.Get(rawTextureID) == null) | ||
593 | rawTextureID += " (not found)"; | ||
594 | else | ||
595 | rawTextureID += " (uploaded)"; | ||
596 | } | ||
597 | |||
598 | outputAction(BAKED_TEXTURES_REPORT_FORMAT, bt, rawTextureID); | ||
599 | } | ||
600 | |||
601 | bool bakedTextureValid = m_scene.AvatarFactory.ValidateBakedTextureCache(sp); | ||
602 | outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); | ||
603 | } | ||
560 | } | 604 | } |
561 | } | 605 | } |