Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

user_profiles
BlueWall 2013-02-01 22:07:08 -05:00
commit 840f72f8a8
2 changed files with 33 additions and 18 deletions

View File

@ -707,7 +707,9 @@ namespace OpenSim.Region.CoreModules.Asset
{ {
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);
@ -715,11 +717,11 @@ namespace OpenSim.Region.CoreModules.Asset
s.ForEachSOG(delegate(SceneObjectGroup e) s.ForEachSOG(delegate(SceneObjectGroup e)
{ {
gatherer.GatherAssetUuids(e, assets); gatherer.GatherAssetUuids(e, assets);
});
}
foreach (UUID assetID in assets.Keys) foreach (UUID assetID in assets.Keys)
{ {
uniqueUuids.Add(assetID);
string filename = GetFileName(assetID.ToString()); string filename = GetFileName(assetID.ToString());
if (File.Exists(filename)) if (File.Exists(filename))
@ -728,11 +730,20 @@ namespace OpenSim.Region.CoreModules.Asset
} }
else if (storeUncached) else if (storeUncached)
{ {
m_AssetService.Get(assetID.ToString()); 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);
} }
} }
return assets.Keys.Count; assets.Clear();
});
}
return uniqueUuids.Count;
} }
/// <summary> /// <summary>

View File

@ -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(
@ -261,8 +264,9 @@ namespace OpenSim.Region.Framework.Scenes
UUID uuid = new UUID(uuidMatch.Value); UUID uuid = new UUID(uuidMatch.Value);
// m_log.DebugFormat("[ARCHIVER]: Recording {0} in text", uuid); // 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
assetUuids[uuid] = AssetType.Texture; // label these as unknown.
assetUuids[uuid] = AssetType.Unknown;
} }
} }
} }