OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
/// <summary>
/// Add an inventory item from a user's inventory to a prim in this scene object.
/// </summary>
/// <param name="agentID">The agent adding the item.</param>
/// <param name="localID">The local ID of the part receiving the add.</param>
/// <param name="item">The user inventory item being added.</param>
/// <param name="copyItemID">The item UUID that should be used by the new item.</param>
/// <returns></returns>
Add an inventory item from a user's inventory to a prim in this scene object.
Add an inventory item from a user ' s inventory to a prim in this scene object .
public bool AddInventoryItem(UUID agentID, uint localID, InventoryItemBase item, UUID copyItemID)
        {
            UUID newItemId = (copyItemID != UUID.Zero) ? copyItemID : item.ID;
            SceneObjectPart part = GetPart(localID);
            if (part != null)
            {
                TaskInventoryItem taskItem = new TaskInventoryItem();
                taskItem.ItemID = newItemId;
                taskItem.AssetID = item.AssetID;
                taskItem.Name = item.Name;
                taskItem.Description = item.Description;
                taskItem.OwnerID = part.OwnerID; 
                taskItem.CreatorID = item.CreatorIdAsUuid;
                taskItem.Type = item.AssetType;
                taskItem.InvType = item.InvType;
                if (agentID != part.OwnerID && m_scene.Permissions.PropagatePermissions())
                {
                    taskItem.BasePermissions = item.BasePermissions &
                            item.NextPermissions;
                    taskItem.CurrentPermissions = item.CurrentPermissions &
                            item.NextPermissions;
                    taskItem.EveryonePermissions = item.EveryOnePermissions &
                            item.NextPermissions;
                    taskItem.GroupPermissions = item.GroupPermissions &
                            item.NextPermissions;
                    taskItem.NextPermissions = item.NextPermissions;
                    taskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
                } 
                else 
                {
                    taskItem.BasePermissions = item.BasePermissions;
                    taskItem.CurrentPermissions = item.CurrentPermissions;
                    taskItem.EveryonePermissions = item.EveryOnePermissions;
                    taskItem.GroupPermissions = item.GroupPermissions;
                    taskItem.NextPermissions = item.NextPermissions;
                }
                taskItem.Flags = item.Flags;
                taskItem.CreationDate = (uint)item.CreationDate;
                bool addFromAllowedDrop = agentID != part.OwnerID;
                part.Inventory.AddInventoryItem(taskItem, addFromAllowedDrop);
                return true;
            }
            else
            {
                m_log.ErrorFormat(
                    "[PRIM INVENTORY]: " +
                    "Couldn't find prim local ID {0} in group {1}, {2} to add inventory item ID {3}",
                    localID, Name, UUID, newItemId);
            }
            return false;
        }
public bool AddInventoryItem ( UUID agentID , uint localID , InventoryItemBase item , UUID copyItemID ) { UUID newItemId = ( copyItemID != UUID . Zero ) ? copyItemID : item . ID ; SceneObjectPart part = GetPart ( localID ) ; if ( part != null ) { TaskInventoryItem taskItem = new TaskInventoryItem ( ) ; taskItem . ItemID = newItemId ; taskItem . AssetID = item . AssetID ; taskItem . Name = item . Name ; taskItem . Description = item . Description ; taskItem . OwnerID = part . OwnerID ; taskItem . CreatorID = item . CreatorIdAsUuid ; taskItem . Type = item . AssetType ; taskItem . InvType = item . InvType ; if ( agentID != part . OwnerID && m_scene . Permissions . PropagatePermissions ( ) ) { taskItem . BasePermissions = item . BasePermissions & item . NextPermissions ; taskItem . CurrentPermissions = item . CurrentPermissions & item . NextPermissions ; taskItem . EveryonePermissions = item . EveryOnePermissions & item . NextPermissions ; taskItem . GroupPermissions = item . GroupPermissions & item . NextPermissions ; taskItem . NextPermissions = item . NextPermissions ; taskItem . Flags |= ( uint ) InventoryItemFlags . ObjectSlamPerm ; } else { taskItem . BasePermissions = item . BasePermissions ; taskItem . CurrentPermissions = item . CurrentPermissions ; taskItem . EveryonePermissions = item . EveryOnePermissions ; taskItem . GroupPermissions = item . GroupPermissions ; taskItem . NextPermissions = item . NextPermissions ; } taskItem . Flags = item . Flags ; taskItem . CreationDate = ( uint ) item . CreationDate ; bool addFromAllowedDrop = agentID != part . OwnerID ; part . Inventory . AddInventoryItem ( taskItem , addFromAllowedDrop ) ; return true ; } else { m_log . ErrorFormat ( " " + " " , localID , Name , UUID , newItemId ) ; } return false ; }
Add an inventory item from a user's inventory to a prim in this scene object.
Add an inventory item from a user ' s inventory to a prim in this scene object .
//            m_log.DebugFormat( //                "[PRIM INVENTORY]: Adding inventory item {0} from {1} to part with local ID {2}",  //                item.Name, remoteClient.Name, localID); // Transfer ownership // We're adding this to a prim we don't own. Force // owner change //                m_log.DebugFormat( //                    "[PRIM INVENTORY]: Flags are 0x{0:X} for item {1} added to part {2} by {3}",  //                    taskItem.Flags, taskItem.Name, localID, remoteClient.Name);                       // TODO: These are pending addition of those fields to TaskInventoryItem //                taskItem.SalePrice = item.SalePrice; //                taskItem.SaleType = item.SaleType;
None
agentID
UUID
The agent adding the item.
The agent adding the item .
localID
uint
The local ID of the part receiving the add.
The local ID of the part receiving the add .
item
InventoryItemBase
The user inventory item being added.
The user inventory item being added .
copyItemID
UUID
The item UUID that should be used by the new item.
The item UUID that should be used by the new item .