aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers
diff options
context:
space:
mode:
authorDiva Canto2015-05-08 20:53:28 -0700
committerDiva Canto2015-05-08 20:53:28 -0700
commit0bf1209f908bb9a384ddb3a4255a75bf2317c478 (patch)
tree3ebc80806ecfe884352f6628132421d2edcdab04 /OpenSim/Server/Handlers
parentRestore handling of bad folders. I'm not entirely sure this is part of the pr... (diff)
downloadopensim-SC_OLD-0bf1209f908bb9a384ddb3a4255a75bf2317c478.zip
opensim-SC_OLD-0bf1209f908bb9a384ddb3a4255a75bf2317c478.tar.gz
opensim-SC_OLD-0bf1209f908bb9a384ddb3a4255a75bf2317c478.tar.bz2
opensim-SC_OLD-0bf1209f908bb9a384ddb3a4255a75bf2317c478.tar.xz
Another major overhaul of inventory downloading, this time pertaining to inventory links. Added yet another function to IInventoryService to get multiple items at once, so that fetching collections of linked items is done once per folder instead of once per item.
Diffstat (limited to 'OpenSim/Server/Handlers')
-rw-r--r--OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index 4f01e36..cf0762b 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -149,6 +149,8 @@ namespace OpenSim.Server.Handlers.Inventory
149 return HandleDeleteItems(request); 149 return HandleDeleteItems(request);
150 case "GETITEM": 150 case "GETITEM":
151 return HandleGetItem(request); 151 return HandleGetItem(request);
152 case "GETMULTIPLEITEMS":
153 return HandleGetMultipleItems(request);
152 case "GETFOLDER": 154 case "GETFOLDER":
153 return HandleGetFolder(request); 155 return HandleGetFolder(request);
154 case "GETACTIVEGESTURES": 156 case "GETACTIVEGESTURES":
@@ -576,6 +578,40 @@ namespace OpenSim.Server.Handlers.Inventory
576 return Util.UTF8NoBomEncoding.GetBytes(xmlString); 578 return Util.UTF8NoBomEncoding.GetBytes(xmlString);
577 } 579 }
578 580
581 byte[] HandleGetMultipleItems(Dictionary<string, object> request)
582 {
583 Dictionary<string, object> resultSet = new Dictionary<string, object>();
584 UUID principal = UUID.Zero;
585 UUID.TryParse(request["PRINCIPAL"].ToString(), out principal);
586 string itemIDstr = request["ITEMS"].ToString();
587 int count = 0;
588 Int32.TryParse(request["COUNT"].ToString(), out count);
589
590 UUID[] fids = new UUID[count];
591 string[] uuids = itemIDstr.Split(',');
592 int i = 0;
593 foreach (string id in uuids)
594 {
595 UUID fid = UUID.Zero;
596 if (UUID.TryParse(id, out fid))
597 fids[i] = fid;
598 i += 1;
599 }
600
601 InventoryItemBase[] itemsList = m_InventoryService.GetMultipleItems(principal, fids);
602 if (itemsList != null && itemsList.Length > 0)
603 {
604 count = 0;
605 foreach (InventoryItemBase item in itemsList)
606 resultSet["item_" + count++] = (item == null) ? (object)"NULL" : EncodeItem(item);
607 }
608
609 string xmlString = ServerUtils.BuildXmlResponse(resultSet);
610
611 //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
612 return Util.UTF8NoBomEncoding.GetBytes(xmlString);
613 }
614
579 byte[] HandleGetFolder(Dictionary<string,object> request) 615 byte[] HandleGetFolder(Dictionary<string,object> request)
580 { 616 {
581 Dictionary<string, object> result = new Dictionary<string, object>(); 617 Dictionary<string, object> result = new Dictionary<string, object>();