diff options
author | Melanie | 2009-08-29 03:26:44 +0100 |
---|---|---|
committer | Melanie | 2009-08-29 03:26:44 +0100 |
commit | 976cf4284bdbef14553c2e164cb67d25bd2b9076 (patch) | |
tree | 20004db93f70bc5116df39986d0da4119c7891e0 /OpenSim/Framework/Capabilities | |
parent | Modify CAPS inventory code. Currently this is not executed (diff) | |
download | opensim-SC_OLD-976cf4284bdbef14553c2e164cb67d25bd2b9076.zip opensim-SC_OLD-976cf4284bdbef14553c2e164cb67d25bd2b9076.tar.gz opensim-SC_OLD-976cf4284bdbef14553c2e164cb67d25bd2b9076.tar.bz2 opensim-SC_OLD-976cf4284bdbef14553c2e164cb67d25bd2b9076.tar.xz |
Fix up WebFetchInventoryDescendents to really return all data needed,
especially the folder version and the subfolders. Fixes inventory search
hang and folders not loading.
Diffstat (limited to 'OpenSim/Framework/Capabilities')
-rw-r--r-- | OpenSim/Framework/Capabilities/Caps.cs | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs index 5ae33d6..c5560b8 100644 --- a/OpenSim/Framework/Capabilities/Caps.cs +++ b/OpenSim/Framework/Capabilities/Caps.cs | |||
@@ -58,7 +58,7 @@ namespace OpenSim.Framework.Capabilities | |||
58 | bool isScriptRunning, byte[] data); | 58 | bool isScriptRunning, byte[] data); |
59 | 59 | ||
60 | public delegate InventoryCollection 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, out int version); |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// XXX Probably not a particularly nice way of allow us to get the scene presence from the scene (chiefly so that | 64 | /// XXX Probably not a particularly nice way of allow us to get the scene presence from the scene (chiefly so that |
@@ -89,7 +89,7 @@ namespace OpenSim.Framework.Capabilities | |||
89 | //private static readonly string m_requestTexture = "0003/"; | 89 | //private static readonly string m_requestTexture = "0003/"; |
90 | private static readonly string m_notecardUpdatePath = "0004/"; | 90 | private static readonly string m_notecardUpdatePath = "0004/"; |
91 | private static readonly string m_notecardTaskUpdatePath = "0005/"; | 91 | private static readonly string m_notecardTaskUpdatePath = "0005/"; |
92 | // private static readonly string m_fetchInventoryPath = "0006/"; | 92 | private static readonly string m_fetchInventoryPath = "0006/"; |
93 | 93 | ||
94 | // The following entries are in a module, however, they are also here so that we don't re-assign | 94 | // The following entries are in a module, however, they are also here so that we don't re-assign |
95 | // the path to another cap by mistake. | 95 | // the path to another cap by mistake. |
@@ -207,7 +207,7 @@ namespace OpenSim.Framework.Capabilities | |||
207 | // As of RC 1.22.9 of the Linden client this is | 207 | // As of RC 1.22.9 of the Linden client this is |
208 | // supported | 208 | // supported |
209 | 209 | ||
210 | // m_capsHandlers["WebFetchInventoryDescendents"] =new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryDescendentsRequest); | 210 | m_capsHandlers["WebFetchInventoryDescendents"] =new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryDescendentsRequest); |
211 | 211 | ||
212 | // justincc: I've disabled the CAPS service for now to fix problems with selecting textures, and | 212 | // justincc: I've disabled the CAPS service for now to fix problems with selecting textures, and |
213 | // subsequent inventory breakage, in the edit object pane (such as mantis 1085). This requires | 213 | // subsequent inventory breakage, in the edit object pane (such as mantis 1085). This requires |
@@ -449,23 +449,14 @@ namespace OpenSim.Framework.Capabilities | |||
449 | contents.owner_id = invFetch.owner_id; | 449 | contents.owner_id = invFetch.owner_id; |
450 | contents.folder_id = invFetch.folder_id; | 450 | contents.folder_id = invFetch.folder_id; |
451 | 451 | ||
452 | // The version number being sent back was originally 1. | ||
453 | // Unfortunately, on 1.19.1.4, this means that we see a problem where on subsequent logins | ||
454 | // without clearing client cache, objects in the root folder disappear until the cache is cleared, | ||
455 | // at which point they reappear. | ||
456 | // | ||
457 | // Seeing the version to something other than 0 may be the right thing to do, but there is | ||
458 | // a greater subtlety of the second life protocol that needs to be understood first. | ||
459 | contents.version = 0; | ||
460 | |||
461 | contents.descendents = 0; | ||
462 | reply.folders.Array.Add(contents); | 452 | reply.folders.Array.Add(contents); |
463 | InventoryCollection inv = new InventoryCollection(); | 453 | InventoryCollection inv = new InventoryCollection(); |
464 | inv.Folders = new List<InventoryFolderBase>(); | 454 | inv.Folders = new List<InventoryFolderBase>(); |
465 | inv.Items = new List<InventoryItemBase>(); | 455 | inv.Items = new List<InventoryItemBase>(); |
456 | int version = 0; | ||
466 | if (CAPSFetchInventoryDescendents != null) | 457 | if (CAPSFetchInventoryDescendents != null) |
467 | { | 458 | { |
468 | inv = CAPSFetchInventoryDescendents(m_agentID, invFetch.folder_id, invFetch.owner_id, invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order); | 459 | inv = CAPSFetchInventoryDescendents(m_agentID, invFetch.folder_id, invFetch.owner_id, invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order, out version); |
469 | } | 460 | } |
470 | 461 | ||
471 | if (inv.Folders != null) | 462 | if (inv.Folders != null) |
@@ -484,7 +475,9 @@ namespace OpenSim.Framework.Capabilities | |||
484 | } | 475 | } |
485 | } | 476 | } |
486 | 477 | ||
487 | contents.descendents = contents.items.Array.Count; | 478 | contents.descendents = contents.items.Array.Count + contents.categories.Array.Count; |
479 | contents.version = version; | ||
480 | |||
488 | return reply; | 481 | return reply; |
489 | } | 482 | } |
490 | 483 | ||
@@ -499,7 +492,10 @@ namespace OpenSim.Framework.Capabilities | |||
499 | llsdFolder.folder_id = invFolder.ID; | 492 | llsdFolder.folder_id = invFolder.ID; |
500 | llsdFolder.parent_id = invFolder.ParentID; | 493 | llsdFolder.parent_id = invFolder.ParentID; |
501 | llsdFolder.name = invFolder.Name; | 494 | llsdFolder.name = invFolder.Name; |
502 | llsdFolder.type = TaskInventoryItem.InvTypes[invFolder.Type]; | 495 | if (invFolder.Type == -1) |
496 | llsdFolder.type = "-1"; | ||
497 | else | ||
498 | llsdFolder.type = TaskInventoryItem.Types[invFolder.Type]; | ||
503 | llsdFolder.preferred_type = "-1"; | 499 | llsdFolder.preferred_type = "-1"; |
504 | 500 | ||
505 | return llsdFolder; | 501 | return llsdFolder; |