diff options
author | Melanie | 2011-12-19 21:30:57 +0000 |
---|---|---|
committer | Melanie | 2011-12-19 21:30:57 +0000 |
commit | efa4284391d6098172c6b57fe8fa5e1d881a31ab (patch) | |
tree | ad5ecc940b428f93e977f096218c85f1d1e146bc /OpenSim/Region/CoreModules | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Stop sending the viewer its own AvatarAppearance packet. (diff) | |
download | opensim-SC_OLD-efa4284391d6098172c6b57fe8fa5e1d881a31ab.zip opensim-SC_OLD-efa4284391d6098172c6b57fe8fa5e1d881a31ab.tar.gz opensim-SC_OLD-efa4284391d6098172c6b57fe8fa5e1d881a31ab.tar.bz2 opensim-SC_OLD-efa4284391d6098172c6b57fe8fa5e1d881a31ab.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules')
-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 acf36df..bc7bf66 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); |
@@ -404,10 +413,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
404 | m_savequeue.Remove(avatarID); | 413 | m_savequeue.Remove(avatarID); |
405 | } | 414 | } |
406 | } | 415 | } |
407 | } | ||
408 | 416 | ||
409 | if (m_savequeue.Count == 0 && m_sendqueue.Count == 0) | 417 | // We must lock both queues here so that QueueAppearanceSave() or *Send() don't m_updateTimer.Start() on |
410 | m_updateTimer.Stop(); | 418 | // another thread inbetween the first count calls and m_updateTimer.Stop() on this thread. |
419 | lock (m_sendqueue) | ||
420 | if (m_savequeue.Count == 0 && m_sendqueue.Count == 0) | ||
421 | m_updateTimer.Stop(); | ||
422 | } | ||
411 | } | 423 | } |
412 | 424 | ||
413 | private void SaveAppearance(UUID agentid) | 425 | private void SaveAppearance(UUID agentid) |
@@ -553,5 +565,37 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
553 | } | 565 | } |
554 | } | 566 | } |
555 | #endregion | 567 | #endregion |
568 | |||
569 | public void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction outputAction) | ||
570 | { | ||
571 | outputAction("For {0} in {1}", sp.Name, m_scene.RegionInfo.RegionName); | ||
572 | outputAction(BAKED_TEXTURES_REPORT_FORMAT, "Bake Type", "UUID"); | ||
573 | |||
574 | Dictionary<BakeType, Primitive.TextureEntryFace> bakedTextures = GetBakedTextureFaces(sp.UUID); | ||
575 | |||
576 | foreach (BakeType bt in bakedTextures.Keys) | ||
577 | { | ||
578 | string rawTextureID; | ||
579 | |||
580 | if (bakedTextures[bt] == null) | ||
581 | { | ||
582 | rawTextureID = "not set"; | ||
583 | } | ||
584 | else | ||
585 | { | ||
586 | rawTextureID = bakedTextures[bt].TextureID.ToString(); | ||
587 | |||
588 | if (m_scene.AssetService.Get(rawTextureID) == null) | ||
589 | rawTextureID += " (not found)"; | ||
590 | else | ||
591 | rawTextureID += " (uploaded)"; | ||
592 | } | ||
593 | |||
594 | outputAction(BAKED_TEXTURES_REPORT_FORMAT, bt, rawTextureID); | ||
595 | } | ||
596 | |||
597 | bool bakedTextureValid = m_scene.AvatarFactory.ValidateBakedTextureCache(sp); | ||
598 | outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); | ||
599 | } | ||
556 | } | 600 | } |
557 | } | 601 | } |