diff options
Diffstat (limited to 'OpenSim/Services')
-rw-r--r-- | OpenSim/Services/InventoryService/XInventoryService.cs | 58 |
1 files changed, 46 insertions, 12 deletions
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 1e7f206..2c79c77 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -183,7 +183,10 @@ namespace OpenSim.Services.InventoryService | |||
183 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); | 183 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); |
184 | 184 | ||
185 | foreach (XInventoryFolder x in allFolders) | 185 | foreach (XInventoryFolder x in allFolders) |
186 | { | ||
187 | m_log.DebugFormat("[INVENTORY]: Adding folder {0} to skeleton", x.folderName); | ||
186 | folders.Add(ConvertToOpenSim(x)); | 188 | folders.Add(ConvertToOpenSim(x)); |
189 | } | ||
187 | 190 | ||
188 | return folders; | 191 | return folders; |
189 | } | 192 | } |
@@ -214,35 +217,48 @@ namespace OpenSim.Services.InventoryService | |||
214 | 217 | ||
215 | public InventoryCollection GetFolderContent(UUID principalID, UUID folderID) | 218 | public InventoryCollection GetFolderContent(UUID principalID, UUID folderID) |
216 | { | 219 | { |
220 | // This method doesn't receive a valud principal id from the | ||
221 | // connector. So we disregard the principal and look | ||
222 | // by ID. | ||
223 | // | ||
224 | m_log.DebugFormat("[INVENTORY]: Fetch contents for folder {0}", folderID.ToString()); | ||
217 | InventoryCollection inventory = new InventoryCollection(); | 225 | InventoryCollection inventory = new InventoryCollection(); |
218 | inventory.UserID = principalID; | 226 | inventory.UserID = principalID; |
219 | inventory.Folders = new List<InventoryFolderBase>(); | 227 | inventory.Folders = new List<InventoryFolderBase>(); |
220 | inventory.Items = new List<InventoryItemBase>(); | 228 | inventory.Items = new List<InventoryItemBase>(); |
221 | 229 | ||
222 | XInventoryFolder[] folders = m_Database.GetFolders( | 230 | XInventoryFolder[] folders = m_Database.GetFolders( |
223 | new string[] { "agentID", "parentFolderID"}, | 231 | new string[] { "parentFolderID"}, |
224 | new string[] { principalID.ToString(), UUID.Zero.ToString() }); | 232 | new string[] { folderID.ToString() }); |
225 | 233 | ||
226 | foreach (XInventoryFolder x in folders) | 234 | foreach (XInventoryFolder x in folders) |
235 | { | ||
236 | m_log.DebugFormat("[INVENTORY]: Adding folder {0} to response", x.folderName); | ||
227 | inventory.Folders.Add(ConvertToOpenSim(x)); | 237 | inventory.Folders.Add(ConvertToOpenSim(x)); |
238 | } | ||
228 | 239 | ||
229 | XInventoryItem[] items = m_Database.GetItems( | 240 | XInventoryItem[] items = m_Database.GetItems( |
230 | new string[] { "avatarID", "parentFolderID"}, | 241 | new string[] { "parentFolderID"}, |
231 | new string[] { principalID.ToString(), UUID.Zero.ToString() }); | 242 | new string[] { folderID.ToString() }); |
232 | 243 | ||
233 | foreach (XInventoryItem i in items) | 244 | foreach (XInventoryItem i in items) |
245 | { | ||
246 | m_log.DebugFormat("[INVENTORY]: Adding item {0} to response", i.inventoryName); | ||
234 | inventory.Items.Add(ConvertToOpenSim(i)); | 247 | inventory.Items.Add(ConvertToOpenSim(i)); |
248 | } | ||
235 | 249 | ||
236 | return inventory; | 250 | return inventory; |
237 | } | 251 | } |
238 | 252 | ||
239 | public List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) | 253 | public List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) |
240 | { | 254 | { |
255 | // Since we probably don't get a valid principal here, either ... | ||
256 | // | ||
241 | List<InventoryItemBase> invItems = new List<InventoryItemBase>(); | 257 | List<InventoryItemBase> invItems = new List<InventoryItemBase>(); |
242 | 258 | ||
243 | XInventoryItem[] items = m_Database.GetItems( | 259 | XInventoryItem[] items = m_Database.GetItems( |
244 | new string[] { "avatarID", "parentFolderID"}, | 260 | new string[] { "parentFolderID"}, |
245 | new string[] { principalID.ToString(), UUID.Zero.ToString() }); | 261 | new string[] { UUID.Zero.ToString() }); |
246 | 262 | ||
247 | foreach (XInventoryItem i in items) | 263 | foreach (XInventoryItem i in items) |
248 | invItems.Add(ConvertToOpenSim(i)); | 264 | invItems.Add(ConvertToOpenSim(i)); |
@@ -279,6 +295,8 @@ namespace OpenSim.Services.InventoryService | |||
279 | // | 295 | // |
280 | public bool DeleteFolders(UUID principalID, List<UUID> folderIDs) | 296 | public bool DeleteFolders(UUID principalID, List<UUID> folderIDs) |
281 | { | 297 | { |
298 | // Ignore principal ID, it's bogus at connector level | ||
299 | // | ||
282 | foreach (UUID id in folderIDs) | 300 | foreach (UUID id in folderIDs) |
283 | { | 301 | { |
284 | InventoryFolderBase f = new InventoryFolderBase(); | 302 | InventoryFolderBase f = new InventoryFolderBase(); |
@@ -297,7 +315,10 @@ namespace OpenSim.Services.InventoryService | |||
297 | new string[] { folder.ID.ToString() }); | 315 | new string[] { folder.ID.ToString() }); |
298 | 316 | ||
299 | foreach (XInventoryFolder x in subFolders) | 317 | foreach (XInventoryFolder x in subFolders) |
318 | { | ||
300 | PurgeFolder(ConvertToOpenSim(x)); | 319 | PurgeFolder(ConvertToOpenSim(x)); |
320 | m_Database.DeleteFolders("folderID", x.folderID.ToString()); | ||
321 | } | ||
301 | 322 | ||
302 | m_Database.DeleteItems("parentFolderID", folder.ID.ToString()); | 323 | m_Database.DeleteItems("parentFolderID", folder.ID.ToString()); |
303 | 324 | ||
@@ -316,10 +337,11 @@ namespace OpenSim.Services.InventoryService | |||
316 | 337 | ||
317 | public bool MoveItems(UUID principalID, List<InventoryItemBase> items) | 338 | public bool MoveItems(UUID principalID, List<InventoryItemBase> items) |
318 | { | 339 | { |
340 | // Principal is b0rked. *sigh* | ||
341 | // | ||
319 | foreach (InventoryItemBase i in items) | 342 | foreach (InventoryItemBase i in items) |
320 | { | 343 | { |
321 | m_Database.MoveItem(principalID.ToString(), i.ID.ToString(), | 344 | m_Database.MoveItem(i.ID.ToString(), i.Folder.ToString()); |
322 | i.Folder.ToString()); | ||
323 | } | 345 | } |
324 | 346 | ||
325 | return true; | 347 | return true; |
@@ -327,6 +349,8 @@ namespace OpenSim.Services.InventoryService | |||
327 | 349 | ||
328 | public bool DeleteItems(UUID principalID, List<UUID> itemIDs) | 350 | public bool DeleteItems(UUID principalID, List<UUID> itemIDs) |
329 | { | 351 | { |
352 | // Just use the ID... *facepalms* | ||
353 | // | ||
330 | foreach (UUID id in itemIDs) | 354 | foreach (UUID id in itemIDs) |
331 | m_Database.DeleteItems("inventoryID", id.ToString()); | 355 | m_Database.DeleteItems("inventoryID", id.ToString()); |
332 | 356 | ||
@@ -357,14 +381,24 @@ namespace OpenSim.Services.InventoryService | |||
357 | return ConvertToOpenSim(folders[0]); | 381 | return ConvertToOpenSim(folders[0]); |
358 | } | 382 | } |
359 | 383 | ||
360 | public List<InventoryItemBase> GetActiveGestures(UUID userId) | 384 | public List<InventoryItemBase> GetActiveGestures(UUID principalID) |
361 | { | 385 | { |
362 | return null; | 386 | XInventoryItem[] items = m_Database.GetActiveGestures(principalID); |
387 | |||
388 | if (items.Length == 0) | ||
389 | return null; | ||
390 | |||
391 | List<InventoryItemBase> ret = new List<InventoryItemBase>(); | ||
392 | |||
393 | foreach (XInventoryItem x in items) | ||
394 | ret.Add(ConvertToOpenSim(x)); | ||
395 | |||
396 | return ret; | ||
363 | } | 397 | } |
364 | 398 | ||
365 | public int GetAssetPermissions(UUID userID, UUID assetID) | 399 | public int GetAssetPermissions(UUID principalID, UUID assetID) |
366 | { | 400 | { |
367 | return 0; | 401 | return m_Database.GetAssetPermissions(principalID, assetID); |
368 | } | 402 | } |
369 | 403 | ||
370 | // CM never needed those. Left unimplemented. | 404 | // CM never needed those. Left unimplemented. |