From a9cc76e0efba7496909d613c75b81de6a9c5d979 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 30 Apr 2008 16:08:24 +0000 Subject: * Long awaited patch from A_Biondi Mantis 923. Kept alive by Melanie. Thanks A_Biondi and Melanie! * This builds but might not work. JustinCC will examine.. it may work out of the box. --- .../Communications/Cache/CachedUserInfo.cs | 2 +- .../Framework/Communications/IInventoryServices.cs | 7 ++ .../Communications/InventoryServiceBase.cs | 11 ++ OpenSim/Framework/IClientAPI.cs | 9 +- OpenSim/Framework/InventoryItemBase.cs | 118 +++++++++++++++++++-- 5 files changed, 134 insertions(+), 13 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 9749366..847909a 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -325,7 +325,7 @@ namespace OpenSim.Framework.Communications.Cache { if ((userID == UserProfile.ID) && HasInventory) { - m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); + m_commsManager.InventoryService.UpdateInventoryItem(userID, itemInfo); } } diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs index 5690f89..c82c946 100644 --- a/OpenSim/Framework/Communications/IInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInventoryServices.cs @@ -78,6 +78,13 @@ namespace OpenSim.Framework.Communications void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); /// + /// Update an item in the given user's inventory + /// + /// + /// + void UpdateInventoryItem(LLUUID userID, InventoryItemBase item); + + /// /// Delete an item from the given user's inventory /// /// diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index 0528b91..dab6a16 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -172,6 +172,9 @@ namespace OpenSim.Framework.Communications // See IInventoryServices public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); + + // See IInventoryServices + public abstract void UpdateInventoryItem(LLUUID userID, InventoryItemBase item); // See IInventoryServices public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); @@ -230,6 +233,14 @@ namespace OpenSim.Framework.Communications } } + protected void UpdateItem(InventoryItemBase item) + { + foreach (KeyValuePair plugin in m_plugins) + { + plugin.Value.updateInventoryItem(item); + } + } + protected void DeleteItem(InventoryItemBase item) { foreach (KeyValuePair plugin in m_plugins) diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 20d4e62..9bcd65f 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -393,9 +393,12 @@ namespace OpenSim.Framework public delegate void RequestTaskInventory(IClientAPI remoteClient, uint localID); - public delegate void UpdateInventoryItem( +/* public delegate void UpdateInventoryItem( IClientAPI remoteClient, LLUUID transactionID, LLUUID itemID, string name, string description, - uint nextOwnerMask); + uint nextOwnerMask);*/ + + public delegate void UpdateInventoryItem( + IClientAPI remoteClient, LLUUID transactionID, LLUUID itemID, InventoryItemBase itemUpd); public delegate void CopyInventoryItem( IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID, LLUUID newFolderID, @@ -756,4 +759,4 @@ namespace OpenSim.Framework public byte[] usecircuit; public EndPoint userEP; } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index 3d75a8a..dbf2085 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs @@ -54,6 +54,10 @@ namespace OpenSim.Framework /// private LLUUID _creator; + private LLUUID _owner; + + private uint _nextPermissions; + /// /// A mask containing permissions for the current owner (cannot be enforced) /// @@ -89,20 +93,44 @@ namespace OpenSim.Framework /// private string _name; + /// - /// A mask containing the permissions for the next owner (cannot be enforced) + /// /// - private uint _nextPermissions; + private LLUUID _groupID; /// - /// The owner of this inventory item + /// /// - private LLUUID _owner; + private bool _groupOwned; - public LLUUID ID - { - get { return _id; } - set { _id = value; } + /// + /// + /// + private int _salePrice; + + /// + /// + /// + private byte _saleType; + + /// + /// + /// + private uint _flags; + + /// + /// + /// + public int _creationDate; + + public LLUUID ID { + get { + return _id; + } + set { + _id = value; + } } public int InvType @@ -176,5 +204,77 @@ namespace OpenSim.Framework get { return _assetID; } set { _assetID = value; } } + + public LLUUID GroupID + { + get + { + return _groupID; + } + set + { + _groupID = value; + } + } + + public bool GroupOwned + { + get + { + return _groupOwned; + } + set + { + _groupOwned = value; + } + } + + public int SalePrice + { + get + { + return _salePrice; + } + set + { + _salePrice = value; + } + } + + public byte SaleType + { + get + { + return _saleType; + } + set + { + _saleType = value; + } + } + + public uint Flags + { + get + { + return _flags; + } + set + { + _flags = value; + } + } + + public int CreationDate + { + get + { + return _creationDate; + } + set + { + _creationDate = value; + } + } } -} \ No newline at end of file +} -- cgit v1.1