diff options
author | Justin Clark-Casey (justincc) | 2012-09-22 01:05:33 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-09-22 01:05:33 +0100 |
commit | b36ef60aca798c0d5eaaa864668369a7ae68d404 (patch) | |
tree | ae236c4298eac9e9e0349dc5cbf8fefef70dd7dd /OpenSim/Region/Framework/Scenes/UuidGatherer.cs | |
parent | Documenting non-LSL script-related events (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-b36ef60aca798c0d5eaaa864668369a7ae68d404.zip opensim-SC_OLD-b36ef60aca798c0d5eaaa864668369a7ae68d404.tar.gz opensim-SC_OLD-b36ef60aca798c0d5eaaa864668369a7ae68d404.tar.bz2 opensim-SC_OLD-b36ef60aca798c0d5eaaa864668369a7ae68d404.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/UuidGatherer.cs')
-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 | } |