diff options
author | Diva Canto | 2009-08-10 20:31:51 -0700 |
---|---|---|
committer | Diva Canto | 2009-08-10 20:31:51 -0700 |
commit | cdcbc48534f19afe7cbdeb6c690e6b7d9f2ff099 (patch) | |
tree | 4d42dff30b4ca8d9f770209c257484c1a2295ddf /OpenSim/Services/InventoryService | |
parent | Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-cdcbc48534f19afe7cbdeb6c690e6b7d9f2ff099.zip opensim-SC_OLD-cdcbc48534f19afe7cbdeb6c690e6b7d9f2ff099.tar.gz opensim-SC_OLD-cdcbc48534f19afe7cbdeb6c690e6b7d9f2ff099.tar.bz2 opensim-SC_OLD-cdcbc48534f19afe7cbdeb6c690e6b7d9f2ff099.tar.xz |
Added two new methods to IIventoryService -- GetFolderForType and GetFolderContent. Some meat to it, but not completed. None of this code is called anywhere yet.
Diffstat (limited to 'OpenSim/Services/InventoryService')
-rw-r--r-- | OpenSim/Services/InventoryService/InventoryService.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs index 2b8ee0f..dd435c9 100644 --- a/OpenSim/Services/InventoryService/InventoryService.cs +++ b/OpenSim/Services/InventoryService/InventoryService.cs | |||
@@ -233,6 +233,46 @@ namespace OpenSim.Services.InventoryService | |||
233 | callback.BeginInvoke(folders, items, null, null); | 233 | callback.BeginInvoke(folders, items, null, null); |
234 | } | 234 | } |
235 | 235 | ||
236 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) | ||
237 | { | ||
238 | m_log.Info("[INVENTORY SERVICE]: Processing request for folder " + folderID); | ||
239 | |||
240 | // Uncomment me to simulate a slow responding inventory server | ||
241 | //Thread.Sleep(16000); | ||
242 | |||
243 | InventoryCollection invCollection = new InventoryCollection(); | ||
244 | |||
245 | List<InventoryItemBase> items = GetFolderItems(userID, folderID); | ||
246 | List<InventoryFolderBase> folders = RequestSubFolders(folderID); | ||
247 | |||
248 | invCollection.UserID = userID; | ||
249 | invCollection.Folders = folders; | ||
250 | invCollection.Items = items; | ||
251 | |||
252 | m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders", items.Count, folders.Count); | ||
253 | |||
254 | return invCollection; | ||
255 | } | ||
256 | |||
257 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | ||
258 | { | ||
259 | InventoryFolderBase root = m_Database.getUserRootFolder(userID); | ||
260 | if (root != null) | ||
261 | { | ||
262 | List<InventoryFolderBase> folders = RequestSubFolders(root.ID); | ||
263 | |||
264 | foreach (InventoryFolderBase folder in folders) | ||
265 | { | ||
266 | if (folder.Type == (short)type) | ||
267 | return folder; | ||
268 | } | ||
269 | } | ||
270 | |||
271 | // we didn't find any folder of that type. Return the root folder | ||
272 | // hopefully the root folder is not null. If it is, too bad | ||
273 | return root; | ||
274 | } | ||
275 | |||
236 | public List<InventoryItemBase> GetActiveGestures(UUID userId) | 276 | public List<InventoryItemBase> GetActiveGestures(UUID userId) |
237 | { | 277 | { |
238 | List<InventoryItemBase> activeGestures = new List<InventoryItemBase>(); | 278 | List<InventoryItemBase> activeGestures = new List<InventoryItemBase>(); |