mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
From: Christopher Yeoh <cyeoh@au1.ibm.com>
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
This commit is contained in:
@@ -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,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++;
|
||||
|
||||
Reference in New Issue
Block a user