diff options
author | Melanie Thielker | 2009-03-23 00:11:34 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-03-23 00:11:34 +0000 |
commit | 412112acbafa6e1f111b12007fd3a81728d0b2f5 (patch) | |
tree | e7c8b2d89c8c01d95049c3b57b925d9f31cb61e8 /OpenSim/Framework/Communications/Cache | |
parent | Send proper creation date on item gives, so objects will appear at the top of (diff) | |
download | opensim-SC-412112acbafa6e1f111b12007fd3a81728d0b2f5.zip opensim-SC-412112acbafa6e1f111b12007fd3a81728d0b2f5.tar.gz opensim-SC-412112acbafa6e1f111b12007fd3a81728d0b2f5.tar.bz2 opensim-SC-412112acbafa6e1f111b12007fd3a81728d0b2f5.tar.xz |
Committing partial work on passing folders across instances. This may crash.
Diffstat (limited to 'OpenSim/Framework/Communications/Cache')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index e590b9d..8d36623 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -37,6 +37,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
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 | internal delegate void QueryItemDelegate(UUID itemID); |
40 | internal delegate void QueryFolderDelegate(UUID folderID); | ||
40 | 41 | ||
41 | internal delegate void CreateFolderDelegate(string folderName, UUID folderID, ushort folderType, UUID parentID); | 42 | internal delegate void CreateFolderDelegate(string folderName, UUID folderID, ushort folderType, UUID parentID); |
42 | internal delegate void MoveFolderDelegate(UUID folderID, UUID parentID); | 43 | internal delegate void MoveFolderDelegate(UUID folderID, UUID parentID); |
@@ -819,6 +820,56 @@ namespace OpenSim.Framework.Communications.Cache | |||
819 | return false; | 820 | return false; |
820 | } | 821 | } |
821 | 822 | ||
823 | public bool QueryFolder(InventoryFolderBase folder) | ||
824 | { | ||
825 | if (m_hasReceivedInventory) | ||
826 | { | ||
827 | InventoryFolderBase invFolder = RootFolder.FindFolder(folder.ID); | ||
828 | |||
829 | if (invFolder != null) | ||
830 | { | ||
831 | // Folder is in local cache, just update client | ||
832 | // | ||
833 | return true; | ||
834 | } | ||
835 | |||
836 | InventoryFolderBase folderInfo = null; | ||
837 | |||
838 | if (m_commsManager.SecureInventoryService != null) | ||
839 | { | ||
840 | folderInfo = m_commsManager.SecureInventoryService.QueryFolder(folder, m_session_id); | ||
841 | } | ||
842 | else | ||
843 | { | ||
844 | folderInfo = m_commsManager.InventoryService.QueryFolder(folder); | ||
845 | } | ||
846 | |||
847 | if (folderInfo != null) | ||
848 | { | ||
849 | InventoryFolderImpl createdFolder = RootFolder.CreateChildFolder(folderInfo.ID, folderInfo.Name, (ushort)folderInfo.Type); | ||
850 | |||
851 | createdFolder.Version = folderInfo.Version; | ||
852 | createdFolder.Owner = folderInfo.Owner; | ||
853 | createdFolder.ParentID = folderInfo.ParentID; | ||
854 | |||
855 | return true; | ||
856 | } | ||
857 | |||
858 | return false; | ||
859 | } | ||
860 | else | ||
861 | { | ||
862 | AddRequest( | ||
863 | new InventoryRequest( | ||
864 | Delegate.CreateDelegate(typeof(QueryFolderDelegate), this, "QueryFolder"), | ||
865 | new object[] { folder.ID })); | ||
866 | |||
867 | return true; | ||
868 | } | ||
869 | |||
870 | return false; | ||
871 | } | ||
872 | |||
822 | } | 873 | } |
823 | 874 | ||
824 | /// <summary> | 875 | /// <summary> |