aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-09-07 03:41:29 +0100
committerJustin Clark-Casey (justincc)2010-09-07 03:41:29 +0100
commitf7b28dd32155eac2d55ccf0757b059794d6b5f67 (patch)
treedaba1307fa62acc66a74fb15ca621e32ed24c98b /OpenSim
parentminor: comment out some excessive test logging (diff)
downloadopensim-SC_OLD-f7b28dd32155eac2d55ccf0757b059794d6b5f67.zip
opensim-SC_OLD-f7b28dd32155eac2d55ccf0757b059794d6b5f67.tar.gz
opensim-SC_OLD-f7b28dd32155eac2d55ccf0757b059794d6b5f67.tar.bz2
opensim-SC_OLD-f7b28dd32155eac2d55ccf0757b059794d6b5f67.tar.xz
If a scene object part UUID is changed (only possible when not in a scene), then adjust the inventory items to point to the new uuid as well
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/TaskInventoryItem.cs10
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs3
4 files changed, 17 insertions, 8 deletions
diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs
index 2cb7895..df5b936 100644
--- a/OpenSim/Framework/TaskInventoryItem.cs
+++ b/OpenSim/Framework/TaskInventoryItem.cs
@@ -348,15 +348,15 @@ namespace OpenSim.Framework
348 /// <param name="partID">The new part ID to which this item belongs</param> 348 /// <param name="partID">The new part ID to which this item belongs</param>
349 public void ResetIDs(UUID partID) 349 public void ResetIDs(UUID partID)
350 { 350 {
351 _oldID = _itemID; 351 OldItemID = ItemID;
352 _itemID = UUID.Random(); 352 ItemID = UUID.Random();
353 _parentPartID = partID; 353 ParentPartID = partID;
354 _parentID = partID; 354 ParentID = partID;
355 } 355 }
356 356
357 public TaskInventoryItem() 357 public TaskInventoryItem()
358 { 358 {
359 _creationDate = (uint)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; 359 CreationDate = (uint)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
360 } 360 }
361 } 361 }
362} 362}
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index 58698ee..32b3724 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -215,7 +215,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
215 public void TestLoadOarV0_2() 215 public void TestLoadOarV0_2()
216 { 216 {
217 TestHelper.InMethod(); 217 TestHelper.InMethod();
218 //log4net.Config.XmlConfigurator.Configure(); 218// log4net.Config.XmlConfigurator.Configure();
219 219
220 MemoryStream archiveWriteStream = new MemoryStream(); 220 MemoryStream archiveWriteStream = new MemoryStream();
221 TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); 221 TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 3ed74e1..3753dcb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -494,7 +494,14 @@ namespace OpenSim.Region.Framework.Scenes
494 public UUID UUID 494 public UUID UUID
495 { 495 {
496 get { return m_uuid; } 496 get { return m_uuid; }
497 set { m_uuid = value; } 497 set
498 {
499 m_uuid = value;
500
501 // This is necessary so that TaskInventoryItem parent ids correctly reference the new uuid of this part
502 if (Inventory != null)
503 Inventory.ResetInventoryIDs();
504 }
498 } 505 }
499 506
500 public uint LocalId 507 public uint LocalId
@@ -2756,7 +2763,6 @@ namespace OpenSim.Region.Framework.Scenes
2756 UUID = UUID.Random(); 2763 UUID = UUID.Random();
2757 LinkNum = linkNum; 2764 LinkNum = linkNum;
2758 LocalId = 0; 2765 LocalId = 0;
2759 Inventory.ResetInventoryIDs();
2760 } 2766 }
2761 2767
2762 /// <summary> 2768 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index ca089a1..87c4860 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -119,6 +119,9 @@ namespace OpenSim.Region.Framework.Scenes
119 /// <param name="linkNum">Link number for the part</param> 119 /// <param name="linkNum">Link number for the part</param>
120 public void ResetInventoryIDs() 120 public void ResetInventoryIDs()
121 { 121 {
122 if (null == m_part || null == m_part.ParentGroup)
123 return;
124
122 lock (m_items) 125 lock (m_items)
123 { 126 {
124 if (0 == m_items.Count) 127 if (0 == m_items.Count)