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.0.7.4-extended
parent
69ca1498ef
commit
744ed1b313
|
@ -709,7 +709,9 @@ namespace Flotsam.RegionModules.AssetCache
|
||||||
{
|
{
|
||||||
UuidGatherer gatherer = new UuidGatherer(m_AssetService);
|
UuidGatherer gatherer = new UuidGatherer(m_AssetService);
|
||||||
|
|
||||||
|
HashSet<UUID> uniqueUuids = new HashSet<UUID>();
|
||||||
Dictionary<UUID, AssetType> assets = new Dictionary<UUID, AssetType>();
|
Dictionary<UUID, AssetType> assets = new Dictionary<UUID, AssetType>();
|
||||||
|
|
||||||
foreach (Scene s in m_Scenes)
|
foreach (Scene s in m_Scenes)
|
||||||
{
|
{
|
||||||
StampRegionStatusFile(s.RegionInfo.RegionID);
|
StampRegionStatusFile(s.RegionInfo.RegionID);
|
||||||
|
@ -717,24 +719,33 @@ namespace Flotsam.RegionModules.AssetCache
|
||||||
s.ForEachSOG(delegate(SceneObjectGroup e)
|
s.ForEachSOG(delegate(SceneObjectGroup e)
|
||||||
{
|
{
|
||||||
gatherer.GatherAssetUuids(e, assets);
|
gatherer.GatherAssetUuids(e, assets);
|
||||||
|
|
||||||
|
foreach (UUID assetID in assets.Keys)
|
||||||
|
{
|
||||||
|
uniqueUuids.Add(assetID);
|
||||||
|
|
||||||
|
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();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (UUID assetID in assets.Keys)
|
|
||||||
{
|
|
||||||
string filename = GetFileName(assetID.ToString());
|
|
||||||
|
|
||||||
if (File.Exists(filename))
|
return uniqueUuids.Count;
|
||||||
{
|
|
||||||
File.SetLastAccessTime(filename, DateTime.Now);
|
|
||||||
}
|
|
||||||
else if (storeUncached)
|
|
||||||
{
|
|
||||||
m_AssetService.Get(assetID.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return assets.Keys.Count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -131,7 +131,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// within this object).
|
/// within this object).
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="sceneObject">The scene object for which to gather assets</param>
|
/// <param name="sceneObject">The scene object for which to gather assets</param>
|
||||||
/// <param name="assetUuids">The assets gathered</param>
|
/// <param name="assetUuids">
|
||||||
|
/// 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.
|
||||||
|
/// </param>
|
||||||
public void GatherAssetUuids(SceneObjectGroup sceneObject, IDictionary<UUID, AssetType> assetUuids)
|
public void GatherAssetUuids(SceneObjectGroup sceneObject, IDictionary<UUID, AssetType> assetUuids)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
|
@ -262,7 +265,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// m_log.DebugFormat("[ARCHIVER]: Recording {0} in text", uuid);
|
// m_log.DebugFormat("[ARCHIVER]: Recording {0} in text", uuid);
|
||||||
|
|
||||||
// Assume AssetIDs embedded are textures.
|
// Assume AssetIDs embedded are textures.
|
||||||
assetUuids[uuid] = AssetType.Texture;
|
assetUuids[uuid] = AssetType.Unknown;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue