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 | |
parent | Send proper creation date on item gives, so objects will appear at the top of (diff) | |
download | opensim-SC_OLD-412112acbafa6e1f111b12007fd3a81728d0b2f5.zip opensim-SC_OLD-412112acbafa6e1f111b12007fd3a81728d0b2f5.tar.gz opensim-SC_OLD-412112acbafa6e1f111b12007fd3a81728d0b2f5.tar.bz2 opensim-SC_OLD-412112acbafa6e1f111b12007fd3a81728d0b2f5.tar.xz |
Committing partial work on passing folders across instances. This may crash.
Diffstat (limited to 'OpenSim/Framework')
4 files changed, 75 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> |
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs index fc9d8af..e37b188 100644 --- a/OpenSim/Framework/Communications/IInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInventoryServices.cs | |||
@@ -113,6 +113,14 @@ namespace OpenSim.Framework.Communications | |||
113 | InventoryItemBase QueryItem(InventoryItemBase item); | 113 | InventoryItemBase QueryItem(InventoryItemBase item); |
114 | 114 | ||
115 | /// <summary> | 115 | /// <summary> |
116 | /// Query the server for a folder that may have been added by | ||
117 | /// another region | ||
118 | /// </summary> | ||
119 | /// <param name="folder"></param> | ||
120 | /// <returns>true if the folder was found in local cache</returns> | ||
121 | InventoryFolderBase QueryFolder(InventoryFolderBase folder); | ||
122 | |||
123 | /// <summary> | ||
116 | /// Does the given user have an inventory structure? | 124 | /// Does the given user have an inventory structure? |
117 | /// </summary> | 125 | /// </summary> |
118 | /// <param name="userID"></param> | 126 | /// <param name="userID"></param> |
diff --git a/OpenSim/Framework/Communications/ISecureInventoryService.cs b/OpenSim/Framework/Communications/ISecureInventoryService.cs index d70dd0b..a405ee5 100644 --- a/OpenSim/Framework/Communications/ISecureInventoryService.cs +++ b/OpenSim/Framework/Communications/ISecureInventoryService.cs | |||
@@ -98,6 +98,8 @@ namespace OpenSim.Framework.Communications | |||
98 | 98 | ||
99 | InventoryItemBase QueryItem(InventoryItemBase item, UUID session_id); | 99 | InventoryItemBase QueryItem(InventoryItemBase item, UUID session_id); |
100 | 100 | ||
101 | InventoryFolderBase QueryFolder(InventoryFolderBase item, UUID session_id); | ||
102 | |||
101 | /// <summary> | 103 | /// <summary> |
102 | /// Does the given user have an inventory structure? | 104 | /// Does the given user have an inventory structure? |
103 | /// </summary> | 105 | /// </summary> |
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index cad7989..ff66250 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs | |||
@@ -292,6 +292,20 @@ namespace OpenSim.Framework.Communications | |||
292 | return null; | 292 | return null; |
293 | } | 293 | } |
294 | 294 | ||
295 | public virtual InventoryFolderBase QueryFolder(InventoryFolderBase item) | ||
296 | { | ||
297 | foreach (IInventoryDataPlugin plugin in m_plugins) | ||
298 | { | ||
299 | InventoryFolderBase result = plugin.queryInventoryFolder(item.ID); | ||
300 | if (result != null) | ||
301 | { | ||
302 | return result; | ||
303 | } | ||
304 | } | ||
305 | |||
306 | return null; | ||
307 | } | ||
308 | |||
295 | /// <summary> | 309 | /// <summary> |
296 | /// Purge a folder of all items items and subfolders. | 310 | /// Purge a folder of all items items and subfolders. |
297 | /// | 311 | /// |