From 801a86ca035b5c8bbd1f99082fd80f2471d6345c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 8 Jan 2015 20:36:03 +0000 Subject: When inspecting a script or notecard, also try to look up any assets embedded therein. This is primarily to fix an issue where inventory items for NPC attachments would not be saved in archives as the assets referenced in the appearance notecard were not checked in this manner. Relates to http://opensimulator.org/mantis/view.php?id=7376 --- OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs | 14 ++++++++++---- OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs index 1fe0e79..4ae27d7 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs @@ -88,11 +88,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void TestNotecardAsset() { TestHelpers.InMethod(); - TestHelpers.EnableLogging(); +// TestHelpers.EnableLogging(); UUID ownerId = TestHelpers.ParseTail(0x10); UUID embeddedId = TestHelpers.ParseTail(0x20); - UUID missingEmbeddedId = TestHelpers.ParseTail(0x21); + UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21); + UUID missingEmbeddedId = TestHelpers.ParseTail(0x22); UUID ncAssetId = TestHelpers.ParseTail(0x30); AssetBase ncAsset @@ -100,9 +101,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests ncAssetId, string.Format("Hello{0}World{1}", embeddedId, missingEmbeddedId)); m_assetService.Store(ncAsset); - AssetBase embeddedAsset = AssetHelpers.CreateNotecardAsset(embeddedId, "We'll meet again."); + AssetBase embeddedAsset + = AssetHelpers.CreateNotecardAsset(embeddedId, string.Format("{0} We'll meet again.", secondLevelEmbeddedId)); m_assetService.Store(embeddedAsset); + AssetBase secondLevelEmbeddedAsset + = AssetHelpers.CreateNotecardAsset(secondLevelEmbeddedId, "Don't know where, don't know when."); + m_assetService.Store(secondLevelEmbeddedAsset); + m_uuidGatherer.AddForInspection(ncAssetId); m_uuidGatherer.GatherAll(); @@ -112,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(3)); Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(ncAssetId)); Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(embeddedId)); - Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(missingEmbeddedId)); + Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(secondLevelEmbeddedId)); } } } \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 28653c6..69dc133 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -451,7 +451,7 @@ namespace OpenSim.Region.Framework.Scenes UUID uuid = new UUID(uuidMatch.Value); // m_log.DebugFormat("[UUID GATHERER]: Recording {0} in text", uuid); - GatheredUuids[uuid] = (sbyte)AssetType.Unknown; + AddForInspection(uuid); } } -- cgit v1.1