diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 2450cdb..cacacf8 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs | |||
@@ -648,6 +648,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
648 | } | 648 | } |
649 | } | 649 | } |
650 | 650 | ||
651 | /// <summary> | ||
652 | /// Gather uuids for a given entity. | ||
653 | /// </summary> | ||
654 | /// <remarks> | ||
655 | /// This does a deep inspection of the entity to retrieve all the assets it uses (whether as textures, as scripts | ||
656 | /// contained in inventory, as scripts contained in objects contained in another object's inventory, etc. Assets | ||
657 | /// are only retrieved when they are necessary to carry out the inspection (i.e. a serialized object needs to be | ||
658 | /// retrieved to work out which assets it references). | ||
659 | /// </remarks> | ||
651 | public class IteratingUuidGatherer | 660 | public class IteratingUuidGatherer |
652 | { | 661 | { |
653 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 662 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -678,20 +687,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
678 | 687 | ||
679 | protected Queue<UUID> m_assetUuidsToInspect; | 688 | protected Queue<UUID> m_assetUuidsToInspect; |
680 | 689 | ||
681 | public IteratingUuidGatherer(IAssetService assetService) | 690 | /// <summary> |
691 | /// Initializes a new instance of the <see cref="OpenSim.Region.Framework.Scenes.UuidGatherer"/> class. | ||
692 | /// </summary> | ||
693 | /// <param name="assetService"> | ||
694 | /// Asset service. | ||
695 | /// </param> | ||
696 | /// <param name="collector"> | ||
697 | /// Gathered UUIDs will be collected in this dictinaory. | ||
698 | /// It can be pre-populated if you want to stop the gatherer from analyzing assets that have already been fetched and inspected. | ||
699 | /// </param> | ||
700 | public IteratingUuidGatherer(IAssetService assetService, IDictionary<UUID, sbyte> collector) | ||
682 | { | 701 | { |
683 | m_assetService = assetService; | 702 | m_assetService = assetService; |
684 | m_gatheredAssetUuids = new Dictionary<UUID, sbyte>(); | 703 | m_gatheredAssetUuids = collector; |
685 | 704 | ||
686 | // FIXME: Not efficient for searching, can improve. | 705 | // FIXME: Not efficient for searching, can improve. |
687 | m_assetUuidsToInspect = new Queue<UUID>(); | 706 | m_assetUuidsToInspect = new Queue<UUID>(); |
688 | } | 707 | } |
689 | 708 | ||
690 | public IDictionary<UUID, sbyte> GetGatheredUuids() | ||
691 | { | ||
692 | return new Dictionary<UUID, sbyte>(m_gatheredAssetUuids); | ||
693 | } | ||
694 | |||
695 | public bool AddAssetUuidToInspect(UUID uuid) | 709 | public bool AddAssetUuidToInspect(UUID uuid) |
696 | { | 710 | { |
697 | if (m_assetUuidsToInspect.Contains(uuid)) | 711 | if (m_assetUuidsToInspect.Contains(uuid)) |
@@ -1147,8 +1161,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1147 | 1161 | ||
1148 | protected string m_assetServerURL; | 1162 | protected string m_assetServerURL; |
1149 | 1163 | ||
1150 | public IteratingHGUuidGatherer(IAssetService assetService, string assetServerURL) | 1164 | public IteratingHGUuidGatherer(IAssetService assetService, string assetServerURL, IDictionary<UUID, sbyte> collector) |
1151 | : base(assetService) | 1165 | : base(assetService, collector) |
1152 | { | 1166 | { |
1153 | m_assetServerURL = assetServerURL; | 1167 | m_assetServerURL = assetServerURL; |
1154 | if (!m_assetServerURL.EndsWith("/") && !m_assetServerURL.EndsWith("=")) | 1168 | if (!m_assetServerURL.EndsWith("/") && !m_assetServerURL.EndsWith("=")) |