aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Capabilities/Handlers/FetchInventory/FetchLib2Handler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Capabilities/Handlers/FetchInventory/FetchLib2Handler.cs')
-rw-r--r--OpenSim/Capabilities/Handlers/FetchInventory/FetchLib2Handler.cs45
1 files changed, 4 insertions, 41 deletions
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchLib2Handler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchLib2Handler.cs
index a43158b..264c41d 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchLib2Handler.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchLib2Handler.cs
@@ -50,7 +50,6 @@ namespace OpenSim.Capabilities.Handlers
50 private UUID libOwner; 50 private UUID libOwner;
51 51
52 public FetchLib2Handler(IInventoryService invService, ILibraryService libraryService, UUID agentId) 52 public FetchLib2Handler(IInventoryService invService, ILibraryService libraryService, UUID agentId)
53
54 { 53 {
55 m_inventoryService = invService; 54 m_inventoryService = invService;
56 m_agentID = agentId; 55 m_agentID = agentId;
@@ -63,15 +62,12 @@ namespace OpenSim.Capabilities.Handlers
63 { 62 {
64 //m_log.DebugFormat("[FETCH INVENTORY HANDLER]: Received FetchInventory capability request {0}", request); 63 //m_log.DebugFormat("[FETCH INVENTORY HANDLER]: Received FetchInventory capability request {0}", request);
65 64
66 if (m_LibraryService == null) 65 if (m_LibraryService == null || m_agentID == UUID.Zero)
67 return "<llsd><map><key><agent_id></key><uuid /><key>items</key><array /></map></llsd>"; 66 return "<llsd><map><key><agent_id></key><uuid /><key>items</key><array /></map></llsd>";
68 67
69 OSDMap requestmap = (OSDMap)OSDParser.DeserializeLLSDXml(Utils.StringToBytes(request)); 68 OSDMap requestmap = (OSDMap)OSDParser.DeserializeLLSDXml(Utils.StringToBytes(request));
70 OSDArray itemsRequested = (OSDArray)requestmap["items"]; 69 OSDArray itemsRequested = (OSDArray)requestmap["items"];
71 70
72 if (m_agentID == UUID.Zero)
73 return "<llsd><map><key><agent_id></key><uuid /><key>items</key><array /></map></llsd>";
74
75 UUID[] itemIDs = new UUID[itemsRequested.Count]; 71 UUID[] itemIDs = new UUID[itemsRequested.Count];
76 int i = 0; 72 int i = 0;
77 73
@@ -88,48 +84,15 @@ namespace OpenSim.Capabilities.Handlers
88 LLSDxmlEncode.AddElem("agent_id", m_agentID, lsl); 84 LLSDxmlEncode.AddElem("agent_id", m_agentID, lsl);
89 if(items == null || items.Length == 0) 85 if(items == null || items.Length == 0)
90 { 86 {
91 LLSDxmlEncode.AddEmptyArray("items",lsl); 87 LLSDxmlEncode.AddEmptyArray("items", lsl);
92 } 88 }
93 else 89 else
94 { 90 {
95 LLSDxmlEncode.AddArray("items",lsl); 91 LLSDxmlEncode.AddArray("items", lsl);
96 foreach (InventoryItemBase item in items) 92 foreach (InventoryItemBase item in items)
97 { 93 {
98 if (item != null) 94 if (item != null)
99 { 95 item.ToLLSDxml(lsl);
100 LLSDxmlEncode.AddMap(lsl);
101 LLSDxmlEncode.AddElem("parent_id", item.Folder, lsl);
102 LLSDxmlEncode.AddElem("asset_id", item.AssetID, lsl);
103 LLSDxmlEncode.AddElem("item_id", item.ID, lsl);
104
105 LLSDxmlEncode.AddMap("permissions",lsl);
106 LLSDxmlEncode.AddElem("creator_id", item.CreatorIdAsUuid, lsl);
107 LLSDxmlEncode.AddElem("owner_id", item.Owner, lsl);
108 LLSDxmlEncode.AddElem("group_id", item.GroupID, lsl);
109 LLSDxmlEncode.AddElem("base_mask", (int)item.CurrentPermissions, lsl);
110 LLSDxmlEncode.AddElem("owner_mask", (int)item.CurrentPermissions, lsl);
111 LLSDxmlEncode.AddElem("group_mask", (int)item.GroupPermissions, lsl);
112 LLSDxmlEncode.AddElem("everyone_mask", (int)item.EveryOnePermissions, lsl);
113 LLSDxmlEncode.AddElem("next_owner_mask", (int)item.NextPermissions, lsl);
114 LLSDxmlEncode.AddElem("is_owner_group", item.GroupOwned, lsl);
115 LLSDxmlEncode.AddEndMap(lsl);
116
117 LLSDxmlEncode.AddElem("type", item.AssetType, lsl);
118 LLSDxmlEncode.AddElem("inv_type", item.InvType, lsl);
119 LLSDxmlEncode.AddElem("flags", ((int)item.Flags) & 0xff, lsl);
120 LLSDxmlEncode.AddElem("flags", ((int)item.Flags) & 0xff, lsl);
121
122 LLSDxmlEncode.AddMap("sale_info",lsl);
123 LLSDxmlEncode.AddElem("sale_price", item.SalePrice, lsl);
124 LLSDxmlEncode.AddElem("sale_type", item.SaleType, lsl);
125 LLSDxmlEncode.AddEndMap(lsl);
126
127 LLSDxmlEncode.AddElem("name", item.Name, lsl);
128 LLSDxmlEncode.AddElem("desc", item.Description, lsl);
129 LLSDxmlEncode.AddElem("created_at", item.CreationDate, lsl);
130
131 LLSDxmlEncode.AddEndMap(lsl);
132 }
133 } 96 }
134 LLSDxmlEncode.AddEndArray(lsl); 97 LLSDxmlEncode.AddEndArray(lsl);
135 } 98 }