diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 2e8f5f7afe..ed04e447d4 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -49,9 +49,6 @@ namespace OpenSim.Region.Environment.Scenes group.StartScripts(); } } - - //split these method into this partial as a lot of these (hopefully) are only temporary and won't be needed once Caps is more complete - // or at least some of they can be moved somewhere else /// /// Add an inventory item to an avatar's inventory. diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs index 1d382fa261..fb099324c1 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs @@ -124,6 +124,14 @@ namespace OpenSim.Region.Environment.Scenes taskItem.type = TaskInventoryItem.Types[item.assetType]; taskItem.inv_type = TaskInventoryItem.Types[item.invType]; part.AddInventoryItem(taskItem); + + // It might seem somewhat crude to update the whole group for a single prim inventory change, + // but it's possible that other prim inventory changes will take place before the region + // persistence thread visits this object. In the future, changes can be signalled at a more + // granular level, or we could let the datastore worry about whether prims have really + // changed since they were last persisted. + HasChanged = true; + return true; } return false; @@ -146,6 +154,14 @@ namespace OpenSim.Region.Environment.Scenes taskItem.type = TaskInventoryItem.Types[item.assetType]; taskItem.inv_type = TaskInventoryItem.InvTypes[item.invType]; part.AddInventoryItem(taskItem); + + // It might seem somewhat crude to update the whole group for a single prim inventory change, + // but it's possible that other prim inventory changes will take place before the region + // persistence thread visits this object. In the future, changes can be signalled at a more + // granular level, or we could let the datastore worry about whether prims have really + // changed since they were last persisted. + HasChanged = true; + return true; } } @@ -160,9 +176,19 @@ namespace OpenSim.Region.Environment.Scenes { SceneObjectPart part = GetChildPart(localID); if (part != null) - { - return part.RemoveInventoryItem(remoteClient, localID, itemID); + { + int type = part.RemoveInventoryItem(remoteClient, localID, itemID); + + // It might seem somewhat crude to update the whole group for a single prim inventory change, + // but it's possible that other prim inventory changes will take place before the region + // persistence thread visits this object. In the future, changes can be signalled at a more + // granular level, or we could let the datastore worry about whether prims have really + // changed since they were last persisted. + HasChanged = true; + + return type; } + return -1; } } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index c28278050c..9e2c256956 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -174,6 +174,13 @@ namespace OpenSim.Region.Environment.Scenes m_inventorySerial++; } + /// + /// Remove an item from this prim's inventory + /// + /// + /// + /// + /// Numeric asset type of the item removed. public int RemoveInventoryItem(IClientAPI remoteClient, uint localID, LLUUID itemID) { if (localID == LocalID) @@ -183,7 +190,7 @@ namespace OpenSim.Region.Environment.Scenes string type = m_taskInventory[itemID].inv_type; m_taskInventory.Remove(itemID); m_inventorySerial++; - if (type == "lsl_text") + if (type == "lsltext") { return 10; }