aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorDiva Canto2012-09-21 16:45:16 -0700
committerDiva Canto2012-09-21 16:45:16 -0700
commitcfa022700d3d099eee7cd25d18da875639506ea8 (patch)
tree2c193bfed4ba508fe67914620b80a55f3a4b973a /OpenSim/Region/Framework/Scenes
parentRemoved redundant asset fetches on HGAssetMapper. The UuidGatherer already do... (diff)
downloadopensim-SC-cfa022700d3d099eee7cd25d18da875639506ea8.zip
opensim-SC-cfa022700d3d099eee7cd25d18da875639506ea8.tar.gz
opensim-SC-cfa022700d3d099eee7cd25d18da875639506ea8.tar.bz2
opensim-SC-cfa022700d3d099eee7cd25d18da875639506ea8.tar.xz
Moved the small HGUuidGatherer class to the file where its parent class is. No need to keep 2 separate files.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/UuidGatherer.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
index dc4a082..383604d 100644
--- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
+++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
@@ -366,4 +366,40 @@ namespace OpenSim.Region.Framework.Scenes
366 } 366 }
367 } 367 }
368 } 368 }
369
370 public class HGUuidGatherer : UuidGatherer
371 {
372 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
373
374 protected string m_assetServerURL;
375
376 public HGUuidGatherer(IAssetService assetService, string assetServerURL)
377 : base(assetService)
378 {
379 m_assetServerURL = assetServerURL;
380 }
381
382 protected override AssetBase GetAsset(UUID uuid)
383 {
384 if (string.Empty == m_assetServerURL)
385 return base.GetAsset(uuid);
386 else
387 return FetchAsset(m_assetServerURL, uuid);
388 }
389
390 public AssetBase FetchAsset(string url, UUID assetID)
391 {
392 if (!url.EndsWith("/") && !url.EndsWith("="))
393 url = url + "/";
394
395 AssetBase asset = m_assetService.Get(url + assetID.ToString());
396
397 if (asset != null)
398 {
399 m_log.DebugFormat("[HGUUIDGatherer]: Copied asset {0} from {1} to local asset server. ", asset.ID, url);
400 return asset;
401 }
402 return null;
403 }
404 }
369} 405}