From f5ed6357505953a28dd281a2bd9a4e497df7af7b Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 4 Apr 2008 17:43:29 +0000 Subject: [PATCH] * Make objects appear in 1.19.1.4 inventory again * You will probably need to clear your client's cache before this will take effect * The problem was that the underlying libsecondlife.AssetType was returning "primitive" rather than "object". This fix is in lieu of correcting/updating our libsecondlife.dll --- .../Communications/Capabilities/Caps.cs | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 4211c20e64..00de14da2e 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs @@ -29,7 +29,9 @@ using System; using System.Collections; using System.Collections.Generic; using System.IO; + using libsecondlife; + using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Console; @@ -213,20 +215,20 @@ namespace OpenSim.Region.Capabilities public string FetchInventoryRequest(string request, string path, string param) { string unmodifiedRequest = request.ToString(); - + + //m_log.DebugFormat("[AGENT INVENTORY]: Received CAPS fetch inventory request {0}", unmodifiedRequest); Hashtable hash = new Hashtable(); try { - hash = (Hashtable)LLSD.LLSDDeserialize(Helpers.StringToField(request)); } catch (LLSD.LLSDParseException pe) { - m_log.Error("[INVENTORY]: Fetch error: " + pe.Message); - m_log.Error("Request:" + request.ToString()); + m_log.Error("[AGENT INVENTORY]: Fetch error: " + pe.Message); + m_log.Error("Request: " + request.ToString()); } - //LLSDArray llsdFolderRequest = LLSDHelpers. + ArrayList foldersrequested = (ArrayList)hash["folders"]; string response = ""; @@ -258,6 +260,8 @@ namespace OpenSim.Region.Capabilities response = "folders" + response + ""; } + //m_log.DebugFormat("[AGENT INVENTORY]: Replying to CAPS fetch inventory request {0}", response); + return response; } @@ -297,7 +301,16 @@ namespace OpenSim.Region.Capabilities llsdItem.item_id = invItem.inventoryID; llsdItem.name = invItem.inventoryName; llsdItem.parent_id = invItem.parentFolderID; - llsdItem.type = Enum.GetName(typeof(AssetType), invItem.assetType).ToLower(); + llsdItem.type = Enum.GetName(typeof(AssetType), invItem.assetType).ToLower(); + + // XXX Temporary fix for 'objects not appearing in inventory' problem. The asset type from libsecondlife is + // returning "primitive" when it should returning "object"! It looks like this is fixed in the latest libsecondlife, + // but our own libsl1550 doesn't have it either! + if ("primitive".Equals(llsdItem.type)) + { + llsdItem.type = "object"; + } + llsdItem.inv_type = Enum.GetName(typeof(InventoryType), invItem.invType).ToLower(); llsdItem.permissions = new LLSDPermissions(); llsdItem.permissions.creator_id = invItem.creatorsID;