aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs37
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs15
-rw-r--r--OpenSim/Services/Interfaces/IInventoryService.cs9
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs15
4 files changed, 75 insertions, 1 deletions
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
index 56dece3..0cea4a1 100644
--- a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
@@ -316,6 +316,7 @@ namespace OpenSim.Services.Connectors
316 316
317 return inventoryArr; 317 return inventoryArr;
318 } 318 }
319
319 public List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) 320 public List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID)
320 { 321 {
321 Dictionary<string,object> ret = MakeRequest("GETFOLDERITEMS", 322 Dictionary<string,object> ret = MakeRequest("GETFOLDERITEMS",
@@ -526,6 +527,42 @@ namespace OpenSim.Services.Connectors
526 return null; 527 return null;
527 } 528 }
528 529
530 public virtual InventoryItemBase[] GetMultipleItems(UUID principalID, UUID[] itemIDs)
531 {
532 InventoryItemBase[] itemArr = new InventoryItemBase[itemIDs.Length];
533 try
534 {
535 Dictionary<string, object> resultSet = MakeRequest("GETMULTIPLEITEMS",
536 new Dictionary<string, object> {
537 { "PRINCIPAL", principalID.ToString() },
538 { "ITEMS", String.Join(",", itemIDs) },
539 { "COUNT", itemIDs.Length.ToString() }
540 });
541
542 if (!CheckReturn(resultSet))
543 return null;
544
545 int i = 0;
546 foreach (KeyValuePair<string, object> kvp in resultSet)
547 {
548 InventoryCollection inventory = new InventoryCollection();
549 if (kvp.Key.StartsWith("item_"))
550 {
551 if (kvp.Value is Dictionary<string, object>)
552 itemArr[i++] = BuildItem((Dictionary<string, object>)kvp.Value);
553 else
554 itemArr[i++] = null;
555 }
556 }
557 }
558 catch (Exception e)
559 {
560 m_log.WarnFormat("[XINVENTORY SERVICES CONNECTOR]: Exception in GetMultipleItems: {0}", e.Message);
561 }
562
563 return itemArr;
564 }
565
529 public InventoryFolderBase GetFolder(InventoryFolderBase folder) 566 public InventoryFolderBase GetFolder(InventoryFolderBase folder)
530 { 567 {
531 try 568 try
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
index 0331c66..fdeea18 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
@@ -301,6 +301,21 @@ namespace OpenSim.Services.Connectors.SimianGrid
301 return null; 301 return null;
302 } 302 }
303 303
304 public InventoryItemBase[] GetMultipleItems(UUID principalID, UUID[] itemIDs)
305 {
306 InventoryItemBase[] result = new InventoryItemBase[itemIDs.Length];
307 int i = 0;
308 InventoryItemBase item = new InventoryItemBase();
309 item.Owner = principalID;
310 foreach (UUID id in itemIDs)
311 {
312 item.ID = id;
313 result[i++] = GetItem(item);
314 }
315
316 return result;
317 }
318
304 /// <summary> 319 /// <summary>
305 /// Get a folder, given by its UUID 320 /// Get a folder, given by its UUID
306 /// </summary> 321 /// </summary>
diff --git a/OpenSim/Services/Interfaces/IInventoryService.cs b/OpenSim/Services/Interfaces/IInventoryService.cs
index 829f169..1e8652c 100644
--- a/OpenSim/Services/Interfaces/IInventoryService.cs
+++ b/OpenSim/Services/Interfaces/IInventoryService.cs
@@ -82,7 +82,7 @@ namespace OpenSim.Services.Interfaces
82 /// </summary> 82 /// </summary>
83 /// <param name="userId"></param> 83 /// <param name="userId"></param>
84 /// <param name="folderIDs"></param> 84 /// <param name="folderIDs"></param>
85 /// <returns>Inventory content. null if the request failed.</returns> 85 /// <returns>Inventory content.</returns>
86 InventoryCollection[] GetMultipleFoldersContent(UUID userID, UUID[] folderIDs); 86 InventoryCollection[] GetMultipleFoldersContent(UUID userID, UUID[] folderIDs);
87 87
88 /// <summary> 88 /// <summary>
@@ -164,6 +164,13 @@ namespace OpenSim.Services.Interfaces
164 InventoryItemBase GetItem(InventoryItemBase item); 164 InventoryItemBase GetItem(InventoryItemBase item);
165 165
166 /// <summary> 166 /// <summary>
167 /// Get multiple items, given by their UUIDs
168 /// </summary>
169 /// <param name="item"></param>
170 /// <returns>null if no item was found, otherwise the found item</returns>
171 InventoryItemBase[] GetMultipleItems(UUID userID, UUID[] ids);
172
173 /// <summary>
167 /// Get a folder, given by its UUID 174 /// Get a folder, given by its UUID
168 /// </summary> 175 /// </summary>
169 /// <param name="folder"></param> 176 /// <param name="folder"></param>
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index 6582b75..50cadab 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -610,6 +610,21 @@ namespace OpenSim.Services.InventoryService
610 return ConvertToOpenSim(items[0]); 610 return ConvertToOpenSim(items[0]);
611 } 611 }
612 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
613 public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder) 628 public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder)
614 { 629 {
615 XInventoryFolder[] folders = m_Database.GetFolders( 630 XInventoryFolder[] folders = m_Database.GetFolders(