diff options
author | Justin Clark-Casey (justincc) | 2013-02-02 02:57:38 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-02-02 02:57:38 +0000 |
commit | 9822bb664b58693790201606126e3fd26f7a4d52 (patch) | |
tree | 4acb0d5a5f569192de99b605b19dc77e5f0a7184 | |
parent | Correct spelling mistake in new RayFilterFlags, LSLPhanton -> LSLPhantom (diff) | |
download | opensim-SC_OLD-9822bb664b58693790201606126e3fd26f7a4d52.zip opensim-SC_OLD-9822bb664b58693790201606126e3fd26f7a4d52.tar.gz opensim-SC_OLD-9822bb664b58693790201606126e3fd26f7a4d52.tar.bz2 opensim-SC_OLD-9822bb664b58693790201606126e3fd26f7a4d52.tar.xz |
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.
-rw-r--r-- | OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 41 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 7 |
2 files changed, 31 insertions, 17 deletions
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 | |||
707 | { | 707 | { |
708 | UuidGatherer gatherer = new UuidGatherer(m_AssetService); | 708 | UuidGatherer gatherer = new UuidGatherer(m_AssetService); |
709 | 709 | ||
710 | HashSet<UUID> uniqueUuids = new HashSet<UUID>(); | ||
710 | Dictionary<UUID, AssetType> assets = new Dictionary<UUID, AssetType>(); | 711 | Dictionary<UUID, AssetType> assets = new Dictionary<UUID, AssetType>(); |
712 | |||
711 | foreach (Scene s in m_Scenes) | 713 | foreach (Scene s in m_Scenes) |
712 | { | 714 | { |
713 | StampRegionStatusFile(s.RegionInfo.RegionID); | 715 | StampRegionStatusFile(s.RegionInfo.RegionID); |
714 | 716 | ||
715 | s.ForEachSOG(delegate(SceneObjectGroup e) | 717 | s.ForEachSOG(delegate(SceneObjectGroup e) |
716 | { | 718 | { |
717 | gatherer.GatherAssetUuids(e, assets); | 719 | gatherer.GatherAssetUuids(e, assets); |
718 | }); | ||
719 | } | ||
720 | 720 | ||
721 | foreach (UUID assetID in assets.Keys) | 721 | foreach (UUID assetID in assets.Keys) |
722 | { | 722 | { |
723 | string filename = GetFileName(assetID.ToString()); | 723 | uniqueUuids.Add(assetID); |
724 | 724 | ||
725 | if (File.Exists(filename)) | 725 | string filename = GetFileName(assetID.ToString()); |
726 | { | 726 | |
727 | File.SetLastAccessTime(filename, DateTime.Now); | 727 | if (File.Exists(filename)) |
728 | } | 728 | { |
729 | else if (storeUncached) | 729 | File.SetLastAccessTime(filename, DateTime.Now); |
730 | { | 730 | } |
731 | m_AssetService.Get(assetID.ToString()); | 731 | else if (storeUncached) |
732 | } | 732 | { |
733 | AssetBase cachedAsset = m_AssetService.Get(assetID.ToString()); | ||
734 | if (cachedAsset == null && assets[assetID] != AssetType.Unknown) | ||
735 | m_log.DebugFormat( | ||
736 | "[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", | ||
737 | assetID, assets[assetID], e.Name, e.AbsolutePosition, s.Name); | ||
738 | } | ||
739 | } | ||
740 | |||
741 | assets.Clear(); | ||
742 | }); | ||
733 | } | 743 | } |
734 | 744 | ||
735 | return assets.Keys.Count; | 745 | |
746 | return uniqueUuids.Count; | ||
736 | } | 747 | } |
737 | 748 | ||
738 | /// <summary> | 749 | /// <summary> |
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 | |||
131 | /// within this object). | 131 | /// within this object). |
132 | /// </remarks> | 132 | /// </remarks> |
133 | /// <param name="sceneObject">The scene object for which to gather assets</param> | 133 | /// <param name="sceneObject">The scene object for which to gather assets</param> |
134 | /// <param name="assetUuids">The assets gathered</param> | 134 | /// <param name="assetUuids"> |
135 | /// A dictionary which is populated with the asset UUIDs gathered and the type of that asset. | ||
136 | /// For assets where the type is not clear (e.g. UUIDs extracted from LSL and notecards), the type is Unknown. | ||
137 | /// </param> | ||
135 | public void GatherAssetUuids(SceneObjectGroup sceneObject, IDictionary<UUID, AssetType> assetUuids) | 138 | public void GatherAssetUuids(SceneObjectGroup sceneObject, IDictionary<UUID, AssetType> assetUuids) |
136 | { | 139 | { |
137 | // m_log.DebugFormat( | 140 | // m_log.DebugFormat( |
@@ -262,7 +265,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
262 | // m_log.DebugFormat("[ARCHIVER]: Recording {0} in text", uuid); | 265 | // m_log.DebugFormat("[ARCHIVER]: Recording {0} in text", uuid); |
263 | 266 | ||
264 | // Assume AssetIDs embedded are textures. | 267 | // Assume AssetIDs embedded are textures. |
265 | assetUuids[uuid] = AssetType.Texture; | 268 | assetUuids[uuid] = AssetType.Unknown; |
266 | } | 269 | } |
267 | } | 270 | } |
268 | } | 271 | } |