diff options
author | Justin Clark-Casey (justincc) | 2012-09-22 00:26:32 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-09-22 00:26:32 +0100 |
commit | 9ab5c5040d5d75d65ae3696e985ae3db77caeedf (patch) | |
tree | 7470bee984c07ef11aba127d9d0794733cecd5f0 /OpenSim/Region/CoreModules/Framework | |
parent | Fix llListFindList() returning no match when there is a match with a script c... (diff) | |
parent | Removed redundant asset fetches on HGAssetMapper. The UuidGatherer already do... (diff) | |
download | opensim-SC_OLD-9ab5c5040d5d75d65ae3696e985ae3db77caeedf.zip opensim-SC_OLD-9ab5c5040d5d75d65ae3696e985ae3db77caeedf.tar.gz opensim-SC_OLD-9ab5c5040d5d75d65ae3696e985ae3db77caeedf.tar.bz2 opensim-SC_OLD-9ab5c5040d5d75d65ae3696e985ae3db77caeedf.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index 144cc87..dd0ea1c 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | |||
@@ -71,6 +71,21 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
71 | 71 | ||
72 | #region Internal functions | 72 | #region Internal functions |
73 | 73 | ||
74 | public AssetMetadata FetchMetadata(string url, UUID assetID) | ||
75 | { | ||
76 | if (!url.EndsWith("/") && !url.EndsWith("=")) | ||
77 | url = url + "/"; | ||
78 | |||
79 | AssetMetadata meta = m_scene.AssetService.GetMetadata(url + assetID.ToString()); | ||
80 | |||
81 | if (meta != null) | ||
82 | m_log.DebugFormat("[HG ASSET MAPPER]: Fetched metadata for asset {0} of type {1} from {2} ", assetID, meta.Type, url); | ||
83 | else | ||
84 | m_log.DebugFormat("[HG ASSET MAPPER]: Unable to fetched metadata for asset {0} from {1} ", assetID, url); | ||
85 | |||
86 | return meta; | ||
87 | } | ||
88 | |||
74 | public AssetBase FetchAsset(string url, UUID assetID) | 89 | public AssetBase FetchAsset(string url, UUID assetID) |
75 | { | 90 | { |
76 | if (!url.EndsWith("/") && !url.EndsWith("=")) | 91 | if (!url.EndsWith("/") && !url.EndsWith("=")) |
@@ -222,28 +237,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
222 | 237 | ||
223 | public void Get(UUID assetID, UUID ownerID, string userAssetURL) | 238 | public void Get(UUID assetID, UUID ownerID, string userAssetURL) |
224 | { | 239 | { |
225 | // Get the item from the remote asset server onto the local AssetCache | 240 | // Get the item from the remote asset server onto the local AssetService |
226 | // and place an entry in m_assetMap | ||
227 | 241 | ||
228 | m_log.Debug("[HG ASSET MAPPER]: Fetching object " + assetID + " from asset server " + userAssetURL); | 242 | AssetMetadata meta = FetchMetadata(userAssetURL, assetID); |
229 | AssetBase asset = FetchAsset(userAssetURL, assetID); | 243 | if (meta == null) |
244 | return; | ||
230 | 245 | ||
231 | if (asset != null) | 246 | // The act of gathering UUIDs downloads the assets from the remote server |
232 | { | 247 | Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>(); |
233 | // OK, now fetch the inside. | 248 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL); |
234 | Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>(); | 249 | uuidGatherer.GatherAssetUuids(assetID, (AssetType)meta.Type, ids); |
235 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL); | ||
236 | uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); | ||
237 | if (ids.ContainsKey(assetID)) | ||
238 | ids.Remove(assetID); | ||
239 | foreach (UUID uuid in ids.Keys) | ||
240 | FetchAsset(userAssetURL, uuid); | ||
241 | 250 | ||
242 | m_log.DebugFormat("[HG ASSET MAPPER]: Successfully fetched asset {0} from asset server {1}", asset.ID, userAssetURL); | 251 | m_log.DebugFormat("[HG ASSET MAPPER]: Successfully fetched asset {0} from asset server {1}", assetID, userAssetURL); |
243 | 252 | ||
244 | } | ||
245 | else | ||
246 | m_log.Warn("[HG ASSET MAPPER]: Could not fetch asset from remote asset server " + userAssetURL); | ||
247 | } | 253 | } |
248 | 254 | ||
249 | 255 | ||