28 using System.Reflection;
30 using OpenMetaverse.StructuredData;
31 using OpenSim.Framework;
32 using OpenSim.Framework.Capabilities;
33 using OpenSim.Framework.Servers.HttpServer;
34 using OpenSim.Services.Interfaces;
40 namespace OpenSim.Capabilities.Handlers
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 private UUID m_agentID;
51 m_inventoryService = invService;
59 OSDMap requestmap = (
OSDMap)OSDParser.DeserializeLLSDXml(
Utils.StringToBytes(request));
65 UUID[] itemIDs =
new UUID[itemsRequested.Count];
68 foreach (
OSDMap osdItemId
in itemsRequested)
70 itemIDs[i++] = osdItemId[
"item_id"].AsUUID();
75 if (m_agentID != UUID.Zero)
77 items = m_inventoryService.GetMultipleItems(m_agentID, itemIDs);
82 m_log.WarnFormat(
"[FETCH INVENTORY HANDLER]: GetMultipleItems failed. Falling back to fetching inventory items one by one.");
85 item.Owner = m_agentID;
86 foreach (UUID
id in itemIDs)
89 items[i++] = m_inventoryService.GetItem(item);
97 foreach (UUID
id in itemIDs)
100 items[i++] = m_inventoryService.GetItem(item);
110 llsdReply.agent_id = item.Owner;
111 llsdReply.items.Array.Add(ConvertInventoryItem(item));
115 reply = LLSDHelpers.SerialiseLLSDReply(llsdReply);
128 llsdItem.asset_id = invItem.AssetID;
129 llsdItem.created_at = invItem.CreationDate;
130 llsdItem.desc = invItem.Description;
131 llsdItem.flags = ((int)invItem.
Flags) & 0xff;
132 llsdItem.item_id = invItem.ID;
133 llsdItem.name = invItem.Name;
134 llsdItem.parent_id = invItem.Folder;
135 llsdItem.type = invItem.AssetType;
136 llsdItem.inv_type = invItem.InvType;
139 llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid;
142 llsdItem.permissions.group_id = invItem.GroupID;
146 llsdItem.permissions.owner_id = invItem.Owner;
149 llsdItem.sale_info.sale_price = invItem.SalePrice;
150 llsdItem.sale_info.sale_type = invItem.SaleType;
FetchInventory2Handler(IInventoryService invService, UUID agentId)
OpenMetaverse.StructuredData.OSDArray OSDArray
OpenSim.Server.Handlers.Simulation.Utils Utils
OpenMetaverse.StructuredData.OSDMap OSDMap
string FetchInventoryRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
LLSDPermissions permissions
Inventory Item - contains all the properties associated with an individual inventory piece...