From 191661b51d31254419e9b442ec12953772821ac3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 24 Jun 2017 02:01:48 +0100 Subject: a few more changes to iar/oar assets save error/warning to show problems known to be asset errors --- OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 52 +++++++++++++++++++++---- 1 file changed, 44 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 8ee7dbc..80d3f62 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -66,6 +66,8 @@ namespace OpenSim.Region.Framework.Scenes /// The gathered uuids. public IDictionary GatheredUuids { get; private set; } public HashSet FailedUUIDs { get; private set; } + public HashSet UncertainAssetsUUIDs { get; private set; } + public int possibleNotAssetCount { get; set; } public int ErrorCount { get; private set; } /// /// Gets the next UUID to inspect. @@ -93,8 +95,10 @@ namespace OpenSim.Region.Framework.Scenes /// /// Asset service. /// - public UuidGatherer(IAssetService assetService) : this(assetService, new Dictionary(), new HashSet ()) {} - public UuidGatherer(IAssetService assetService, IDictionary collector) : this(assetService, collector, new HashSet ()) {} + public UuidGatherer(IAssetService assetService) : this(assetService, new Dictionary(), + new HashSet (),new HashSet ()) {} + public UuidGatherer(IAssetService assetService, IDictionary collector) : this(assetService, collector, + new HashSet (), new HashSet ()) {} /// /// Initializes a new instance of the class. @@ -106,7 +110,7 @@ namespace OpenSim.Region.Framework.Scenes /// Gathered UUIDs will be collected in this dictionary. /// It can be pre-populated if you want to stop the gatherer from analyzing assets that have already been fetched and inspected. /// - public UuidGatherer(IAssetService assetService, IDictionary collector, HashSet failedIDs) + public UuidGatherer(IAssetService assetService, IDictionary collector, HashSet failedIDs, HashSet uncertainAssetsUUIDs) { m_assetService = assetService; GatheredUuids = collector; @@ -114,7 +118,9 @@ namespace OpenSim.Region.Framework.Scenes // FIXME: Not efficient for searching, can improve. m_assetUuidsToInspect = new Queue(); FailedUUIDs = failedIDs; + UncertainAssetsUUIDs = uncertainAssetsUUIDs; ErrorCount = 0; + possibleNotAssetCount = 0; } /// @@ -124,8 +130,17 @@ namespace OpenSim.Region.Framework.Scenes /// UUID. public bool AddForInspection(UUID uuid) { + if(uuid == UUID.Zero) + return false; + if(FailedUUIDs.Contains(uuid)) - return false; + { + if(UncertainAssetsUUIDs.Contains(uuid)) + possibleNotAssetCount++; + else + ErrorCount++; + return false; + } if(GatheredUuids.ContainsKey(uuid)) return false; if (m_assetUuidsToInspect.Contains(uuid)) @@ -283,9 +298,15 @@ namespace OpenSim.Region.Framework.Scenes /// The uuid of the asset for which to gather referenced assets private void GetAssetUuids(UUID assetUuid) { + if(assetUuid == UUID.Zero) + return; + if(FailedUUIDs.Contains(assetUuid)) { - ErrorCount++; + if(UncertainAssetsUUIDs.Contains(assetUuid)) + possibleNotAssetCount++; + else + ErrorCount++; return; } @@ -309,11 +330,17 @@ namespace OpenSim.Region.Framework.Scenes if(assetBase == null) { // m_log.ErrorFormat("[UUID GATHERER]: asset {0} not found", assetUuid); - ErrorCount++; FailedUUIDs.Add(assetUuid); + if(UncertainAssetsUUIDs.Contains(assetUuid)) + possibleNotAssetCount++; + else + ErrorCount++; return; } + if(UncertainAssetsUUIDs.Contains(assetUuid)) + UncertainAssetsUUIDs.Remove(assetUuid); + sbyte assetType = assetBase.Type; if(assetBase.Data == null || assetBase.Data.Length == 0) @@ -363,10 +390,16 @@ namespace OpenSim.Region.Framework.Scenes private void AddForInspection(UUID assetUuid, sbyte assetType) { + if(assetUuid == UUID.Zero) + return; + // Here, we want to collect uuids which require further asset fetches but mark the others as gathered if(FailedUUIDs.Contains(assetUuid)) { - ErrorCount++; + if(UncertainAssetsUUIDs.Contains(assetUuid)) + possibleNotAssetCount++; + else + ErrorCount++; return; } if(GatheredUuids.ContainsKey(assetUuid)) @@ -502,8 +535,11 @@ namespace OpenSim.Region.Framework.Scenes foreach (Match uuidMatch in uuidMatches) { UUID uuid = new UUID(uuidMatch.Value); + if(uuid == UUID.Zero) + continue; // m_log.DebugFormat("[UUID GATHERER]: Recording {0} in text", uuid); - + if(!UncertainAssetsUUIDs.Contains(uuid)) + UncertainAssetsUUIDs.Add(uuid); AddForInspection(uuid); } } -- cgit v1.1