diff options
author | Melanie | 2009-08-28 23:28:32 +0100 |
---|---|---|
committer | Melanie | 2009-08-28 23:28:32 +0100 |
commit | 22a0dff22624984080bebc03ff63025fc213eeff (patch) | |
tree | f106ca76fca4500198cb697180c5d87afae05292 /OpenSim/Framework/Capabilities/Caps.cs | |
parent | Implements osDrawPolygon, similar to already implemented osDrawFilledPolygon (diff) | |
download | opensim-SC_OLD-22a0dff22624984080bebc03ff63025fc213eeff.zip opensim-SC_OLD-22a0dff22624984080bebc03ff63025fc213eeff.tar.gz opensim-SC_OLD-22a0dff22624984080bebc03ff63025fc213eeff.tar.bz2 opensim-SC_OLD-22a0dff22624984080bebc03ff63025fc213eeff.tar.xz |
Modify CAPS inventory code. Currently this is not executed
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Capabilities/Caps.cs | 81 |
1 files changed, 50 insertions, 31 deletions
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs index df29c4e..5ae33d6 100644 --- a/OpenSim/Framework/Capabilities/Caps.cs +++ b/OpenSim/Framework/Capabilities/Caps.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Framework.Capabilities | |||
57 | public delegate void TaskScriptUpdatedCallback(UUID userID, UUID itemID, UUID primID, | 57 | public delegate void TaskScriptUpdatedCallback(UUID userID, UUID itemID, UUID primID, |
58 | bool isScriptRunning, byte[] data); | 58 | bool isScriptRunning, byte[] data); |
59 | 59 | ||
60 | public delegate List<InventoryItemBase> FetchInventoryDescendentsCAPS(UUID agentID, UUID folderID, UUID ownerID, | 60 | public delegate InventoryCollection FetchInventoryDescendentsCAPS(UUID agentID, UUID folderID, UUID ownerID, |
61 | bool fetchFolders, bool fetchItems, int sortOrder); | 61 | bool fetchFolders, bool fetchItems, int sortOrder); |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
@@ -460,47 +460,52 @@ namespace OpenSim.Framework.Capabilities | |||
460 | 460 | ||
461 | contents.descendents = 0; | 461 | contents.descendents = 0; |
462 | reply.folders.Array.Add(contents); | 462 | reply.folders.Array.Add(contents); |
463 | List<InventoryItemBase> itemList = null; | 463 | InventoryCollection inv = new InventoryCollection(); |
464 | inv.Folders = new List<InventoryFolderBase>(); | ||
465 | inv.Items = new List<InventoryItemBase>(); | ||
464 | if (CAPSFetchInventoryDescendents != null) | 466 | if (CAPSFetchInventoryDescendents != null) |
465 | { | 467 | { |
466 | itemList = CAPSFetchInventoryDescendents(m_agentID, invFetch.folder_id, invFetch.owner_id, invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order); | 468 | inv = CAPSFetchInventoryDescendents(m_agentID, invFetch.folder_id, invFetch.owner_id, invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order); |
467 | } | 469 | } |
468 | 470 | ||
469 | if (itemList != null) | 471 | if (inv.Folders != null) |
470 | { | 472 | { |
471 | foreach (InventoryItemBase invItem in itemList) | 473 | foreach (InventoryFolderBase invFolder in inv.Folders) |
472 | { | 474 | { |
473 | contents.items.Array.Add(ConvertInventoryItem(invItem)); | 475 | contents.categories.Array.Add(ConvertInventoryFolder(invFolder)); |
474 | } | 476 | } |
475 | } | 477 | } |
476 | /* The following block is removed as it ALWAYS sends the error to the client because the RC 1.22.9 client tries to | ||
477 | find items that have become dissasociated with a paret folder and have parent of 00000000-0000-00000.... | ||
478 | else | ||
479 | { | ||
480 | IClientAPI client = GetClient(m_agentID); | ||
481 | 478 | ||
482 | // We're going to both notify the client of inventory service failure and send back a 'no folder contents' response. | 479 | if (inv.Items != null) |
483 | // If we don't send back the response, | 480 | { |
484 | // the client becomes unhappy (see Teravus' comment in FetchInventoryRequest()) | 481 | foreach (InventoryItemBase invItem in inv.Items) |
485 | if (client != null) | ||
486 | { | ||
487 | client.SendAgentAlertMessage( | ||
488 | "AGIN0001E: The inventory service has either failed or is not responding. Your inventory will not function properly for the rest of this session. Please clear your cache and relog.", | ||
489 | true); | ||
490 | } | ||
491 | else | ||
492 | { | 482 | { |
493 | m_log.ErrorFormat( | 483 | contents.items.Array.Add(ConvertInventoryItem(invItem)); |
494 | "[AGENT INVENTORY]: Could not lookup controlling client for {0} in order to notify them of the inventory service failure", | ||
495 | m_agentID); | ||
496 | } | 484 | } |
497 | }*/ | 485 | } |
498 | 486 | ||
499 | contents.descendents = contents.items.Array.Count; | 487 | contents.descendents = contents.items.Array.Count; |
500 | return reply; | 488 | return reply; |
501 | } | 489 | } |
502 | 490 | ||
503 | /// <summary> | 491 | /// <summary> |
492 | /// Convert an internal inventory folder object into an LLSD object. | ||
493 | /// </summary> | ||
494 | /// <param name="invFolder"></param> | ||
495 | /// <returns></returns> | ||
496 | private LLSDInventoryFolder ConvertInventoryFolder(InventoryFolderBase invFolder) | ||
497 | { | ||
498 | LLSDInventoryFolder llsdFolder = new LLSDInventoryFolder(); | ||
499 | llsdFolder.folder_id = invFolder.ID; | ||
500 | llsdFolder.parent_id = invFolder.ParentID; | ||
501 | llsdFolder.name = invFolder.Name; | ||
502 | llsdFolder.type = TaskInventoryItem.InvTypes[invFolder.Type]; | ||
503 | llsdFolder.preferred_type = "-1"; | ||
504 | |||
505 | return llsdFolder; | ||
506 | } | ||
507 | |||
508 | /// <summary> | ||
504 | /// Convert an internal inventory item object into an LLSD object. | 509 | /// Convert an internal inventory item object into an LLSD object. |
505 | /// </summary> | 510 | /// </summary> |
506 | /// <param name="invItem"></param> | 511 | /// <param name="invItem"></param> |
@@ -529,15 +534,29 @@ namespace OpenSim.Framework.Capabilities | |||
529 | llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid; | 534 | llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid; |
530 | llsdItem.permissions.base_mask = (int)invItem.CurrentPermissions; | 535 | llsdItem.permissions.base_mask = (int)invItem.CurrentPermissions; |
531 | llsdItem.permissions.everyone_mask = (int)invItem.EveryOnePermissions; | 536 | llsdItem.permissions.everyone_mask = (int)invItem.EveryOnePermissions; |
532 | llsdItem.permissions.group_id = UUID.Zero; | 537 | llsdItem.permissions.group_id = invItem.GroupID; |
533 | llsdItem.permissions.group_mask = 0; | 538 | llsdItem.permissions.group_mask = (int)invItem.GroupPermissions; |
534 | llsdItem.permissions.is_owner_group = false; | 539 | llsdItem.permissions.is_owner_group = invItem.GroupOwned; |
535 | llsdItem.permissions.next_owner_mask = (int)invItem.NextPermissions; | 540 | llsdItem.permissions.next_owner_mask = (int)invItem.NextPermissions; |
536 | llsdItem.permissions.owner_id = m_agentID; // FixMe | 541 | llsdItem.permissions.owner_id = m_agentID; |
537 | llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions; | 542 | llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions; |
538 | llsdItem.sale_info = new LLSDSaleInfo(); | 543 | llsdItem.sale_info = new LLSDSaleInfo(); |
539 | llsdItem.sale_info.sale_price = 10; | 544 | llsdItem.sale_info.sale_price = invItem.SalePrice; |
540 | llsdItem.sale_info.sale_type = "not"; | 545 | switch (invItem.SaleType) |
546 | { | ||
547 | default: | ||
548 | llsdItem.sale_info.sale_type = "not"; | ||
549 | break; | ||
550 | case 1: | ||
551 | llsdItem.sale_info.sale_type = "original"; | ||
552 | break; | ||
553 | case 2: | ||
554 | llsdItem.sale_info.sale_type = "copy"; | ||
555 | break; | ||
556 | case 3: | ||
557 | llsdItem.sale_info.sale_type = "contents"; | ||
558 | break; | ||
559 | } | ||
541 | 560 | ||
542 | return llsdItem; | 561 | return llsdItem; |
543 | } | 562 | } |