diff options
author | Melanie Thielker | 2009-03-21 17:46:58 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-03-21 17:46:58 +0000 |
commit | 1121a214b9258487dae0d84dad1a0b495d2f80bd (patch) | |
tree | 10576cab4d44bbe39f4f759f8ffac68530e40055 /OpenSim/Framework/Communications/Cache | |
parent | Move a check for null PhysActor in applyImpulse so that attachments can move ... (diff) | |
download | opensim-SC-1121a214b9258487dae0d84dad1a0b495d2f80bd.zip opensim-SC-1121a214b9258487dae0d84dad1a0b495d2f80bd.tar.gz opensim-SC-1121a214b9258487dae0d84dad1a0b495d2f80bd.tar.bz2 opensim-SC-1121a214b9258487dae0d84dad1a0b495d2f80bd.tar.xz |
Add a QueryItem method to the inventory subsystem. Currently implemented for
MySQL only, stubs for the others. This allows updating the cache with a single
item from the database.
Diffstat (limited to 'OpenSim/Framework/Communications/Cache')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index c5bbd6a..57c3ece 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -36,6 +36,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
36 | internal delegate void AddItemDelegate(InventoryItemBase itemInfo); | 36 | internal delegate void AddItemDelegate(InventoryItemBase itemInfo); |
37 | internal delegate void UpdateItemDelegate(InventoryItemBase itemInfo); | 37 | internal delegate void UpdateItemDelegate(InventoryItemBase itemInfo); |
38 | internal delegate void DeleteItemDelegate(UUID itemID); | 38 | internal delegate void DeleteItemDelegate(UUID itemID); |
39 | internal delegate void QueryItemDelegate(UUID itemID); | ||
39 | 40 | ||
40 | internal delegate void CreateFolderDelegate(string folderName, UUID folderID, ushort folderType, UUID parentID); | 41 | internal delegate void CreateFolderDelegate(string folderName, UUID folderID, ushort folderType, UUID parentID); |
41 | internal delegate void MoveFolderDelegate(UUID folderID, UUID parentID); | 42 | internal delegate void MoveFolderDelegate(UUID folderID, UUID parentID); |
@@ -767,6 +768,47 @@ namespace OpenSim.Framework.Communications.Cache | |||
767 | 768 | ||
768 | return RootFolder.FindFolderForType(type); | 769 | return RootFolder.FindFolderForType(type); |
769 | } | 770 | } |
771 | |||
772 | // Load additional items that other regions have put into the database | ||
773 | // The item will be added tot he local cache. Returns true if the item | ||
774 | // was found and can be sent to the client | ||
775 | // | ||
776 | public bool QueryItem(UUID itemID) | ||
777 | { | ||
778 | if (m_hasReceivedInventory) | ||
779 | { | ||
780 | InventoryItemBase item = RootFolder.FindItem(itemID); | ||
781 | |||
782 | if (item != null) | ||
783 | { | ||
784 | // Item is in local cache, just update client | ||
785 | // | ||
786 | return true; | ||
787 | } | ||
788 | |||
789 | InventoryItemBase itemInfo = m_commsManager.InventoryService.QueryItem(item); | ||
790 | if (itemInfo != null) | ||
791 | { | ||
792 | InventoryFolderImpl folder = RootFolder.FindFolder(itemInfo.Folder); | ||
793 | ItemReceive(itemInfo, folder); | ||
794 | return true; | ||
795 | } | ||
796 | |||
797 | return false; | ||
798 | } | ||
799 | else | ||
800 | { | ||
801 | AddRequest( | ||
802 | new InventoryRequest( | ||
803 | Delegate.CreateDelegate(typeof(QueryItemDelegate), this, "QueryItem"), | ||
804 | new object[] { itemID })); | ||
805 | |||
806 | return true; | ||
807 | } | ||
808 | |||
809 | return false; | ||
810 | } | ||
811 | |||
770 | } | 812 | } |
771 | 813 | ||
772 | /// <summary> | 814 | /// <summary> |