Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

viewer-2-initial-appearance
Justin Clark-Casey (justincc) 2010-09-17 01:01:12 +01:00
commit 5b18f8be25
4 changed files with 42 additions and 1 deletions

View File

@ -57,6 +57,15 @@ namespace OpenSim.Region.Framework.Interfaces
/// <param name="linkNum">Link number for the part</param>
void ResetInventoryIDs();
/// <summary>
/// Reset parent object UUID for all the items in the prim's inventory.
/// </summary>
///
/// If this method is called and there are inventory items, then we regard the inventory as having changed.
///
/// <param name="linkNum">Link number for the part</param>
void ResetObjectID();
/// <summary>
/// Change every item in this inventory to a new owner.
/// </summary>

View File

@ -500,7 +500,7 @@ namespace OpenSim.Region.Framework.Scenes
// This is necessary so that TaskInventoryItem parent ids correctly reference the new uuid of this part
if (Inventory != null)
Inventory.ResetInventoryIDs();
Inventory.ResetObjectID();
}
}
@ -2763,6 +2763,7 @@ namespace OpenSim.Region.Framework.Scenes
UUID = UUID.Random();
LinkNum = linkNum;
LocalId = 0;
Inventory.ResetInventoryIDs();
}
/// <summary>

View File

@ -140,6 +140,34 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public void ResetObjectID()
{
m_items.LockItemsForWrite(true);
if (Items.Count == 0)
{
m_items.LockItemsForWrite(false);
return;
}
HasInventoryChanged = true;
if (m_part.ParentGroup != null)
{
m_part.ParentGroup.HasGroupChanged = true;
}
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
Items.Clear();
foreach (TaskInventoryItem item in items)
{
item.ParentPartID = m_part.UUID;
item.ParentID = m_part.UUID;
Items.Add(item.ItemID, item);
}
m_items.LockItemsForWrite(false);
}
/// <summary>
/// Change every item in this inventory to a new owner.
/// </summary>

View File

@ -1264,3 +1264,6 @@
;; default standalone, overridable in StandaloneCommon.ini
StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
[Modules]
Include-modules = "addon-modules/*/config/*.ini"