aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-09-22 00:26:32 +0100
committerJustin Clark-Casey (justincc)2012-09-22 00:26:32 +0100
commit9ab5c5040d5d75d65ae3696e985ae3db77caeedf (patch)
tree7470bee984c07ef11aba127d9d0794733cecd5f0 /OpenSim/Region
parentFix llListFindList() returning no match when there is a match with a script c... (diff)
parentRemoved redundant asset fetches on HGAssetMapper. The UuidGatherer already do... (diff)
downloadopensim-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')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs42
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs2
2 files changed, 25 insertions, 19 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
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
index 0456852..1e1c7d0 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
@@ -131,7 +131,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
131 m_LocalAssetServiceURI = m_LocalAssetServiceURI.Trim('/'); 131 m_LocalAssetServiceURI = m_LocalAssetServiceURI.Trim('/');
132 132
133 IConfig hgConfig = source.Configs["HGAssetService"]; 133 IConfig hgConfig = source.Configs["HGAssetService"];
134 m_AssetPerms = new AssetPermissions(hgConfig); 134 m_AssetPerms = new AssetPermissions(hgConfig); // it's ok if arg is null
135 135
136 m_Enabled = true; 136 m_Enabled = true;
137 m_log.Info("[HG ASSET CONNECTOR]: HG asset broker enabled"); 137 m_log.Info("[HG ASSET CONNECTOR]: HG asset broker enabled");