Reapplying a revised version of Christopher Yeoh's (IBM) patch for allow

inventory drop. Also adds a new flags, "propagate_permissions" to
OpenSim.ini to control that feature.
This commit is contained in:
Melanie Thielker
2008-11-14 17:24:56 +00:00
parent 165fcd1aac
commit edee11ff87
7 changed files with 68 additions and 23 deletions

View File

@@ -289,16 +289,16 @@ namespace OpenSim.Region.Environment.Scenes
/// name is chosen.
/// </summary>
/// <param name="item"></param>
public void AddInventoryItem(TaskInventoryItem item)
public void AddInventoryItem(TaskInventoryItem item, bool allowedDrop)
{
AddInventoryItem(item.Name, item);
AddInventoryItem(item.Name, item, allowedDrop);
}
/// <summary>
/// Add an item to this prim's inventory. If an item with the same name already exists, it is replaced.
/// </summary>
/// <param name="item"></param>
public void AddInventoryItemExclusive(TaskInventoryItem item)
public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop)
{
List<TaskInventoryItem> il = new List<TaskInventoryItem>(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);
}
/// <summary>
@@ -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
/// </param>
protected void AddInventoryItem(string name, TaskInventoryItem item)
/// <param name="allowedDrop">
/// Item was only added to inventory because AllowedDrop is set
/// </param>
protected void AddInventoryItem(string name, TaskInventoryItem item, bool allowedDrop)
{
name = FindAvailableInventoryName(name);
if (name == String.Empty)
@@ -337,7 +340,11 @@ 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++;