diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 36 |
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 | } |