aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-09-24 22:52:33 +0100
committerJustin Clark-Casey (justincc)2012-09-24 22:52:33 +0100
commitac02cadbdb817f0a8ab913bfd67f2f8919cdd69f (patch)
treef0fca1b7c047760a0927441840e7709ff91e7fb5 /OpenSim/Region/Framework
parentDocumenting LSL script-related events (diff)
parentHG Rez object: warn the user if the item or asset cannot be found. (diff)
downloadopensim-SC_OLD-ac02cadbdb817f0a8ab913bfd67f2f8919cdd69f.zip
opensim-SC_OLD-ac02cadbdb817f0a8ab913bfd67f2f8919cdd69f.tar.gz
opensim-SC_OLD-ac02cadbdb817f0a8ab913bfd67f2f8919cdd69f.tar.bz2
opensim-SC_OLD-ac02cadbdb817f0a8ab913bfd67f2f8919cdd69f.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/UuidGatherer.cs27
1 files changed, 17 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
index 383604d..28cd09f 100644
--- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
+++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
@@ -377,6 +377,8 @@ namespace OpenSim.Region.Framework.Scenes
377 : base(assetService) 377 : base(assetService)
378 { 378 {
379 m_assetServerURL = assetServerURL; 379 m_assetServerURL = assetServerURL;
380 if (!m_assetServerURL.EndsWith("/") && !m_assetServerURL.EndsWith("="))
381 m_assetServerURL = m_assetServerURL + "/";
380 } 382 }
381 383
382 protected override AssetBase GetAsset(UUID uuid) 384 protected override AssetBase GetAsset(UUID uuid)
@@ -384,22 +386,27 @@ namespace OpenSim.Region.Framework.Scenes
384 if (string.Empty == m_assetServerURL) 386 if (string.Empty == m_assetServerURL)
385 return base.GetAsset(uuid); 387 return base.GetAsset(uuid);
386 else 388 else
387 return FetchAsset(m_assetServerURL, uuid); 389 return FetchAsset(uuid);
388 } 390 }
389 391
390 public AssetBase FetchAsset(string url, UUID assetID) 392 public AssetBase FetchAsset(UUID assetID)
391 { 393 {
392 if (!url.EndsWith("/") && !url.EndsWith("="))
393 url = url + "/";
394 394
395 AssetBase asset = m_assetService.Get(url + assetID.ToString()); 395 // Test if it's already here
396 396 AssetBase asset = m_assetService.Get(assetID.ToString());
397 if (asset != null) 397 if (asset == null)
398 { 398 {
399 m_log.DebugFormat("[HGUUIDGatherer]: Copied asset {0} from {1} to local asset server. ", asset.ID, url); 399 // It's not, so fetch it from abroad
400 return asset; 400 asset = m_assetService.Get(m_assetServerURL + assetID.ToString());
401 if (asset != null)
402 m_log.DebugFormat("[HGUUIDGatherer]: Copied asset {0} from {1} to local asset server", assetID, m_assetServerURL);
403 else
404 m_log.DebugFormat("[HGUUIDGatherer]: Failed to fetch asset {0} from {1}", assetID, m_assetServerURL);
401 } 405 }
402 return null; 406 //else
407 // m_log.DebugFormat("[HGUUIDGatherer]: Asset {0} from {1} was already here", assetID, m_assetServerURL);
408
409 return asset;
403 } 410 }
404 } 411 }
405} 412}