aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorDiva Canto2012-09-21 17:58:44 -0700
committerDiva Canto2012-09-21 17:58:44 -0700
commit21a6ef5bb63e56612b8e03002dbee9ff1fcdc4c0 (patch)
treed2d6c2e55e7894e5d129621d7f0145768bd8dadb /OpenSim/Region/Framework
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-21a6ef5bb63e56612b8e03002dbee9ff1fcdc4c0.zip
opensim-SC-21a6ef5bb63e56612b8e03002dbee9ff1fcdc4c0.tar.gz
opensim-SC-21a6ef5bb63e56612b8e03002dbee9ff1fcdc4c0.tar.bz2
opensim-SC-21a6ef5bb63e56612b8e03002dbee9ff1fcdc4c0.tar.xz
This fixes HG attachments' missing assets (textures, etc).
Also, further improvements on HGUuidGatherer: if the assets are already in this grid don't fetch them again.
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}