diff options
author | BlueWall | 2013-02-01 22:07:08 -0500 |
---|---|---|
committer | BlueWall | 2013-02-01 22:07:08 -0500 |
commit | 840f72f8a851292646379a8df9bb79e868e08ceb (patch) | |
tree | bab08299dcddff8bc916c77d6d96682f45df4bc8 /OpenSim/Region | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
parent | minor: change comment about assuming script references are textures in UuidGa... (diff) | |
download | opensim-SC_OLD-840f72f8a851292646379a8df9bb79e868e08ceb.zip opensim-SC_OLD-840f72f8a851292646379a8df9bb79e868e08ceb.tar.gz opensim-SC_OLD-840f72f8a851292646379a8df9bb79e868e08ceb.tar.bz2 opensim-SC_OLD-840f72f8a851292646379a8df9bb79e868e08ceb.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 41 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 10 |
2 files changed, 33 insertions, 18 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..ad33607 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( |
@@ -261,8 +264,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
261 | UUID uuid = new UUID(uuidMatch.Value); | 264 | UUID uuid = new UUID(uuidMatch.Value); |
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 | // Embedded asset references (if not false positives) could be for many types of asset, so we will |
265 | assetUuids[uuid] = AssetType.Texture; | 268 | // label these as unknown. |
269 | assetUuids[uuid] = AssetType.Unknown; | ||
266 | } | 270 | } |
267 | } | 271 | } |
268 | } | 272 | } |