aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
diff options
context:
space:
mode:
authordiva2009-04-18 22:46:48 +0000
committerdiva2009-04-18 22:46:48 +0000
commit06f0515d144bc80ce6c502942a5f549d5a9c0ed6 (patch)
treed8795796b1f680e52f6a0a24f92ca15c9f878510 /OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
parentLittle bug fix on the Groups module to get over an exception upon login. (diff)
downloadopensim-SC_OLD-06f0515d144bc80ce6c502942a5f549d5a9c0ed6.zip
opensim-SC_OLD-06f0515d144bc80ce6c502942a5f549d5a9c0ed6.tar.gz
opensim-SC_OLD-06f0515d144bc80ce6c502942a5f549d5a9c0ed6.tar.bz2
opensim-SC_OLD-06f0515d144bc80ce6c502942a5f549d5a9c0ed6.tar.xz
Bug fix in HG asset posts. Get the inner assets not just from mem cache but from asset service, because the inner ones may not be in mem cache.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs42
1 files changed, 24 insertions, 18 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
index 48ea519..5242285 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
@@ -153,10 +153,11 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
153 return false; 153 return false;
154 } 154 }
155 155
156 private bool PostAsset(GridAssetClient asscli, UUID assetID) 156 private bool PostAsset(GridAssetClient asscli, UUID assetID, bool isTexture)
157 { 157 {
158 AssetBase asset1; 158 AssetBase asset1;
159 m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out asset1); 159 //m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out asset1);
160 asset1 = m_scene.CommsManager.AssetCache.GetAsset(assetID, isTexture);
160 161
161 if (asset1 != null) 162 if (asset1 != null)
162 { 163 {
@@ -377,25 +378,30 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
377 m_assetServers.Add(userAssetURL, asscli); 378 m_assetServers.Add(userAssetURL, asscli);
378 } 379 }
379 m_log.Debug("[HGScene]: Posting object " + assetID + " to asset server " + userAssetURL); 380 m_log.Debug("[HGScene]: Posting object " + assetID + " to asset server " + userAssetURL);
380 bool success = PostAsset(asscli, assetID); 381 AssetBase ass1 = null;
381 382 m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out ass1);
382 // Now the inside 383 if (ass1 != null)
383 Dictionary<UUID, bool> ids = SniffUUIDs(assetID);
384 Dump(ids);
385 foreach (KeyValuePair<UUID, bool> kvp in ids)
386 PostAsset(asscli, kvp.Key);
387
388 if (success)
389 { 384 {
390 m_log.Debug("[HGScene]: Successfully posted item to remote asset server " + userAssetURL); 385 bool success = PostAsset(asscli, assetID, (ass1.Type == (sbyte)AssetType.Texture));
391 if (!m_assetMap.ContainsKey(assetID)) 386
392 m_assetMap.Add(assetID, asscli); 387 // Now the inside
388 Dictionary<UUID, bool> ids = SniffUUIDs(assetID);
389 Dump(ids);
390 foreach (KeyValuePair<UUID, bool> kvp in ids)
391 PostAsset(asscli, kvp.Key, kvp.Value);
392
393 if (success)
394 {
395 m_log.Debug("[HGScene]: Successfully posted item to remote asset server " + userAssetURL);
396 if (!m_assetMap.ContainsKey(assetID))
397 m_assetMap.Add(assetID, asscli);
398 }
399 else
400 m_log.Warn("[HGScene]: Could not post asset to remote asset server " + userAssetURL);
401
393 } 402 }
394 else 403 else
395 m_log.Warn("[HGScene]: Could not post asset to remote asset server " + userAssetURL); 404 m_log.Debug("[HGScene]: Something wrong with asset");
396
397 //if (!m_assetMap.ContainsKey(itemID))
398 // m_assetMap.Add(itemID, asscli);
399 } 405 }
400 else 406 else
401 m_log.Warn("[HGScene]: Unable to locate foreign user's asset server"); 407 m_log.Warn("[HGScene]: Unable to locate foreign user's asset server");