diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/InventoryService/XInventoryService.cs | 48 |
1 files changed, 41 insertions, 7 deletions
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 362ff8f..64f727c 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -261,7 +261,7 @@ namespace OpenSim.Services.InventoryService | |||
261 | 261 | ||
262 | private InventoryFolderBase GetSystemFolderForType(InventoryFolderBase rootFolder, AssetType type) | 262 | private InventoryFolderBase GetSystemFolderForType(InventoryFolderBase rootFolder, AssetType type) |
263 | { | 263 | { |
264 | // m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID); | 264 | //m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0}", type); |
265 | 265 | ||
266 | if (type == AssetType.RootFolder) | 266 | if (type == AssetType.RootFolder) |
267 | return rootFolder; | 267 | return rootFolder; |
@@ -272,13 +272,13 @@ namespace OpenSim.Services.InventoryService | |||
272 | 272 | ||
273 | if (folders.Length == 0) | 273 | if (folders.Length == 0) |
274 | { | 274 | { |
275 | // m_log.WarnFormat("[XINVENTORY SERVICE]: Found no folder for type {0} for user {1}", type, principalID); | 275 | //m_log.WarnFormat("[XINVENTORY SERVICE]: Found no folder for type {0} ", type); |
276 | return null; | 276 | return null; |
277 | } | 277 | } |
278 | 278 | ||
279 | // m_log.DebugFormat( | 279 | //m_log.DebugFormat( |
280 | // "[XINVENTORY SERVICE]: Found folder {0} {1} for type {2} for user {3}", | 280 | // "[XINVENTORY SERVICE]: Found folder {0} {1} for type {2}", |
281 | // folders[0].folderName, folders[0].folderID, type, principalID); | 281 | // folders[0].folderName, folders[0].folderID, type); |
282 | 282 | ||
283 | return ConvertToOpenSim(folders[0]); | 283 | return ConvertToOpenSim(folders[0]); |
284 | } | 284 | } |
@@ -291,7 +291,7 @@ namespace OpenSim.Services.InventoryService | |||
291 | // | 291 | // |
292 | //m_log.DebugFormat("[XINVENTORY SERVICE]: Fetch contents for folder {0}", folderID.ToString()); | 292 | //m_log.DebugFormat("[XINVENTORY SERVICE]: Fetch contents for folder {0}", folderID.ToString()); |
293 | InventoryCollection inventory = new InventoryCollection(); | 293 | InventoryCollection inventory = new InventoryCollection(); |
294 | inventory.UserID = principalID; | 294 | inventory.OwnerID = principalID; |
295 | inventory.Folders = new List<InventoryFolderBase>(); | 295 | inventory.Folders = new List<InventoryFolderBase>(); |
296 | inventory.Items = new List<InventoryItemBase>(); | 296 | inventory.Items = new List<InventoryItemBase>(); |
297 | 297 | ||
@@ -315,8 +315,27 @@ namespace OpenSim.Services.InventoryService | |||
315 | inventory.Items.Add(ConvertToOpenSim(i)); | 315 | inventory.Items.Add(ConvertToOpenSim(i)); |
316 | } | 316 | } |
317 | 317 | ||
318 | InventoryFolderBase f = new InventoryFolderBase(folderID, principalID); | ||
319 | f = GetFolder(f); | ||
320 | if (f != null) | ||
321 | { | ||
322 | inventory.Version = f.Version; | ||
323 | inventory.OwnerID = f.Owner; | ||
324 | } | ||
325 | inventory.FolderID = folderID; | ||
326 | |||
318 | return inventory; | 327 | return inventory; |
319 | } | 328 | } |
329 | |||
330 | public virtual InventoryCollection[] GetMultipleFoldersContent(UUID principalID, UUID[] folderIDs) | ||
331 | { | ||
332 | InventoryCollection[] multiple = new InventoryCollection[folderIDs.Length]; | ||
333 | int i = 0; | ||
334 | foreach (UUID fid in folderIDs) | ||
335 | multiple[i++] = GetFolderContent(principalID, fid); | ||
336 | |||
337 | return multiple; | ||
338 | } | ||
320 | 339 | ||
321 | public virtual List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) | 340 | public virtual List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) |
322 | { | 341 | { |
@@ -591,6 +610,21 @@ namespace OpenSim.Services.InventoryService | |||
591 | return ConvertToOpenSim(items[0]); | 610 | return ConvertToOpenSim(items[0]); |
592 | } | 611 | } |
593 | 612 | ||
613 | public virtual InventoryItemBase[] GetMultipleItems(UUID userID, UUID[] ids) | ||
614 | { | ||
615 | InventoryItemBase[] items = new InventoryItemBase[ids.Length]; | ||
616 | int i = 0; | ||
617 | InventoryItemBase item = new InventoryItemBase(); | ||
618 | item.Owner = userID; | ||
619 | foreach (UUID id in ids) | ||
620 | { | ||
621 | item.ID = id; | ||
622 | items[i++] = GetItem(item); | ||
623 | } | ||
624 | |||
625 | return items; | ||
626 | } | ||
627 | |||
594 | public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder) | 628 | public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder) |
595 | { | 629 | { |
596 | XInventoryFolder[] folders = m_Database.GetFolders( | 630 | XInventoryFolder[] folders = m_Database.GetFolders( |