aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2015-01-08 20:36:03 +0000
committerJustin Clark-Casey (justincc)2015-01-08 20:36:03 +0000
commit801a86ca035b5c8bbd1f99082fd80f2471d6345c (patch)
treee8c4394969cb081a0292c96a77d8374ca4f4af84 /OpenSim
parentMake the IteratingUuidGatherer the only UuidGatherer. (diff)
downloadopensim-SC-801a86ca035b5c8bbd1f99082fd80f2471d6345c.zip
opensim-SC-801a86ca035b5c8bbd1f99082fd80f2471d6345c.tar.gz
opensim-SC-801a86ca035b5c8bbd1f99082fd80f2471d6345c.tar.bz2
opensim-SC-801a86ca035b5c8bbd1f99082fd80f2471d6345c.tar.xz
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
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/UuidGatherer.cs2
2 files changed, 11 insertions, 5 deletions
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
88 public void TestNotecardAsset() 88 public void TestNotecardAsset()
89 { 89 {
90 TestHelpers.InMethod(); 90 TestHelpers.InMethod();
91 TestHelpers.EnableLogging(); 91// TestHelpers.EnableLogging();
92 92
93 UUID ownerId = TestHelpers.ParseTail(0x10); 93 UUID ownerId = TestHelpers.ParseTail(0x10);
94 UUID embeddedId = TestHelpers.ParseTail(0x20); 94 UUID embeddedId = TestHelpers.ParseTail(0x20);
95 UUID missingEmbeddedId = TestHelpers.ParseTail(0x21); 95 UUID secondLevelEmbeddedId = TestHelpers.ParseTail(0x21);
96 UUID missingEmbeddedId = TestHelpers.ParseTail(0x22);
96 UUID ncAssetId = TestHelpers.ParseTail(0x30); 97 UUID ncAssetId = TestHelpers.ParseTail(0x30);
97 98
98 AssetBase ncAsset 99 AssetBase ncAsset
@@ -100,9 +101,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests
100 ncAssetId, string.Format("Hello{0}World{1}", embeddedId, missingEmbeddedId)); 101 ncAssetId, string.Format("Hello{0}World{1}", embeddedId, missingEmbeddedId));
101 m_assetService.Store(ncAsset); 102 m_assetService.Store(ncAsset);
102 103
103 AssetBase embeddedAsset = AssetHelpers.CreateNotecardAsset(embeddedId, "We'll meet again."); 104 AssetBase embeddedAsset
105 = AssetHelpers.CreateNotecardAsset(embeddedId, string.Format("{0} We'll meet again.", secondLevelEmbeddedId));
104 m_assetService.Store(embeddedAsset); 106 m_assetService.Store(embeddedAsset);
105 107
108 AssetBase secondLevelEmbeddedAsset
109 = AssetHelpers.CreateNotecardAsset(secondLevelEmbeddedId, "Don't know where, don't know when.");
110 m_assetService.Store(secondLevelEmbeddedAsset);
111
106 m_uuidGatherer.AddForInspection(ncAssetId); 112 m_uuidGatherer.AddForInspection(ncAssetId);
107 m_uuidGatherer.GatherAll(); 113 m_uuidGatherer.GatherAll();
108 114
@@ -112,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
112 Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(3)); 118 Assert.That(m_uuidGatherer.GatheredUuids.Count, Is.EqualTo(3));
113 Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(ncAssetId)); 119 Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(ncAssetId));
114 Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(embeddedId)); 120 Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(embeddedId));
115 Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(missingEmbeddedId)); 121 Assert.That(m_uuidGatherer.GatheredUuids.ContainsKey(secondLevelEmbeddedId));
116 } 122 }
117 } 123 }
118} \ No newline at end of file 124} \ 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
451 UUID uuid = new UUID(uuidMatch.Value); 451 UUID uuid = new UUID(uuidMatch.Value);
452// m_log.DebugFormat("[UUID GATHERER]: Recording {0} in text", uuid); 452// m_log.DebugFormat("[UUID GATHERER]: Recording {0} in text", uuid);
453 453
454 GatheredUuids[uuid] = (sbyte)AssetType.Unknown; 454 AddForInspection(uuid);
455 } 455 }
456 } 456 }
457 457