aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Hypergrid/HGUuidGatherer.cs
blob: e83478d847e52b3f94e36f509afbe0a94a5a6a41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;

using OpenSim.Framework;
using OpenSim.Services.Interfaces;
using OpenMetaverse;

namespace OpenSim.Region.Framework.Scenes.Hypergrid
{
    public class HGUuidGatherer : UuidGatherer
    {
        protected string m_assetServerURL;
        protected HGAssetMapper m_assetMapper;

        public HGUuidGatherer(HGAssetMapper assMap, IAssetService assetCache, string assetServerURL) : base(assetCache)
        {
            m_assetMapper = assMap;
            m_assetServerURL = assetServerURL;
        }

        protected override AssetBase GetAsset(UUID uuid)
        {
            if (string.Empty == m_assetServerURL)
                return m_assetCache.Get(uuid.ToString());
            else
                return m_assetMapper.FetchAsset(m_assetServerURL, uuid);
        }
    }
}