From 5e20e32b6993a79f8f31cb12882b9c4499140275 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Fri, 14 Nov 2008 10:55:14 +0000 Subject: From: Christopher Yeoh This patch makes llAllowInventoryDrop work with the permissions module enabled. Changes include: - Enabled PropagatePermissions when permissions module serverside perms is on - change ownership of item when item is dropped into an object. Ownership changes to the owner of the object the item is dropped into - propagation of permissions if the permissions module enabled (eg next-owner mask applied) - CHANGED_ALLOWED_DROP is now passed to the change script event if an item was allowed to be dropped into the object only because llAllowInventoryDrop is enabled (instead of CHANGED_INVENTORY being passed). - Sets object flags correctly when llAllowInventoryDrop is called so clients are notified immediately of the change in state. Am not sure that calling aggregateScriptEvents is the right way to do it, but it works and seems to be the only way without making further changes to update LocalFlags --- .../Environment/Scenes/SceneObjectPart.Inventory.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 501f199..fa66515 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -289,16 +289,16 @@ namespace OpenSim.Region.Environment.Scenes /// name is chosen. /// /// - public void AddInventoryItem(TaskInventoryItem item) + public void AddInventoryItem(TaskInventoryItem item, bool allowedDrop) { - AddInventoryItem(item.Name, item); + AddInventoryItem(item.Name, item, allowedDrop); } /// /// Add an item to this prim's inventory. If an item with the same name already exists, it is replaced. /// /// - public void AddInventoryItemExclusive(TaskInventoryItem item) + public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop) { List il = new List(m_taskInventory.Values); foreach (TaskInventoryItem i in il) @@ -313,7 +313,7 @@ namespace OpenSim.Region.Environment.Scenes } } - AddInventoryItem(item.Name, item); + AddInventoryItem(item.Name, item, allowedDrop); } /// @@ -324,7 +324,10 @@ namespace OpenSim.Region.Environment.Scenes /// The item itself. The name within this structure is ignored in favour of the name /// given in this method's arguments /// - protected void AddInventoryItem(string name, TaskInventoryItem item) + /// + // Item was only added to inventory because AllowedDrop is set + /// + protected void AddInventoryItem(string name, TaskInventoryItem item, bool allowedDrop) { name = FindAvailableInventoryName(name); if (name == String.Empty) @@ -337,7 +340,10 @@ namespace OpenSim.Region.Environment.Scenes lock (m_taskInventory) { m_taskInventory.Add(item.ItemID, item); - TriggerScriptChangedEvent(Changed.INVENTORY); + if (allowedDrop) + TriggerScriptChangedEvent(Changed.ALLOWED_DROP); + else + TriggerScriptChangedEvent(Changed.INVENTORY); } m_inventorySerial++; -- cgit v1.1