From 9822bb664b58693790201606126e3fd26f7a4d52 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 2 Feb 2013 02:57:38 +0000 Subject: Log missing assets on "fcache assets" found. This ignores references found by scanning LSL/notecard files since these are the source of false positives. This also changes UuidGatherer to reutn an AssetType.Unknown for embedded script/lsl references instead of Texture, since these are often not textures. This is added to help people in determining when they have missing assets such as textures, etc. In this case, one wants to run "fcache clear" first. --- .../Region/CoreModules/Asset/FlotsamAssetCache.cs | 41 ++++++++++++++-------- OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 7 ++-- 2 files changed, 31 insertions(+), 17 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 8e800cb..00af175 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -707,32 +707,43 @@ namespace OpenSim.Region.CoreModules.Asset { UuidGatherer gatherer = new UuidGatherer(m_AssetService); + HashSet uniqueUuids = new HashSet(); Dictionary assets = new Dictionary(); + foreach (Scene s in m_Scenes) { StampRegionStatusFile(s.RegionInfo.RegionID); s.ForEachSOG(delegate(SceneObjectGroup e) - { + { gatherer.GatherAssetUuids(e, assets); - }); - } - foreach (UUID assetID in assets.Keys) - { - string filename = GetFileName(assetID.ToString()); + foreach (UUID assetID in assets.Keys) + { + uniqueUuids.Add(assetID); - if (File.Exists(filename)) - { - File.SetLastAccessTime(filename, DateTime.Now); - } - else if (storeUncached) - { - m_AssetService.Get(assetID.ToString()); - } + string filename = GetFileName(assetID.ToString()); + + if (File.Exists(filename)) + { + File.SetLastAccessTime(filename, DateTime.Now); + } + else if (storeUncached) + { + AssetBase cachedAsset = m_AssetService.Get(assetID.ToString()); + if (cachedAsset == null && assets[assetID] != AssetType.Unknown) + m_log.DebugFormat( + "[FLOTSAM ASSET CACHE]: Could not find asset {0}, type {1} referenced by object {2} at {3} in scene {4} when pre-caching all scene assets", + assetID, assets[assetID], e.Name, e.AbsolutePosition, s.Name); + } + } + + assets.Clear(); + }); } - return assets.Keys.Count; + + return uniqueUuids.Count; } /// diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index e238d01..c7cec41 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -131,7 +131,10 @@ namespace OpenSim.Region.Framework.Scenes /// within this object). /// /// The scene object for which to gather assets - /// The assets gathered + /// + /// A dictionary which is populated with the asset UUIDs gathered and the type of that asset. + /// For assets where the type is not clear (e.g. UUIDs extracted from LSL and notecards), the type is Unknown. + /// public void GatherAssetUuids(SceneObjectGroup sceneObject, IDictionary assetUuids) { // m_log.DebugFormat( @@ -262,7 +265,7 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat("[ARCHIVER]: Recording {0} in text", uuid); // Assume AssetIDs embedded are textures. - assetUuids[uuid] = AssetType.Texture; + assetUuids[uuid] = AssetType.Unknown; } } } -- cgit v1.1 From 0d0bfa4dcd2fe61a489abc39e53755762d759490 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 2 Feb 2013 03:02:04 +0000 Subject: minor: change comment about assuming script references are textures in UuidGatherer since this is no longer the behaviour. --- OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index c7cec41..ad33607 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -264,7 +264,8 @@ namespace OpenSim.Region.Framework.Scenes UUID uuid = new UUID(uuidMatch.Value); // m_log.DebugFormat("[ARCHIVER]: Recording {0} in text", uuid); - // Assume AssetIDs embedded are textures. + // Embedded asset references (if not false positives) could be for many types of asset, so we will + // label these as unknown. assetUuids[uuid] = AssetType.Unknown; } } -- cgit v1.1