From 7d7bbd4caea7639ada5da1d2b0d984deca01123e Mon Sep 17 00:00:00 2001 From: cinder Date: Thu, 13 Feb 2025 09:08:56 -0600 Subject: [PATCH] Some useful comments --- LibreMetaverse/InventoryAISClient.cs | 8 ++++++++ LibreMetaverse/InventoryBase.cs | 9 ++++++++- LibreMetaverse/InventoryManager.cs | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/LibreMetaverse/InventoryAISClient.cs b/LibreMetaverse/InventoryAISClient.cs index eac145a2..39b202e7 100644 --- a/LibreMetaverse/InventoryAISClient.cs +++ b/LibreMetaverse/InventoryAISClient.cs @@ -848,6 +848,14 @@ namespace LibreMetaverse foreach (KeyValuePair o in linksOsd) { var link = (OSDMap)o.Value; + /* + * Objects that have been attached in-world prior to being stored on the + * asset server are stored with the InventoryType of 0 (Texture) + * instead of 17 (Attachment) + * + * This corrects that behavior by forcing Object Asset types that have an + * invalid InventoryType with the proper InventoryType of Attachment. + */ InventoryType type = (InventoryType)link["inv_type"].AsInteger(); if (type == InventoryType.Texture && (AssetType)link["type"].AsInteger() == AssetType.Object) { diff --git a/LibreMetaverse/InventoryBase.cs b/LibreMetaverse/InventoryBase.cs index cdc2c829..7c688db3 100644 --- a/LibreMetaverse/InventoryBase.cs +++ b/LibreMetaverse/InventoryBase.cs @@ -333,7 +333,14 @@ namespace OpenMetaverse public static InventoryItem FromOSD(OSD data) { OSDMap descItem = (OSDMap)data; - + /* + * Objects that have been attached in-world prior to being stored on the + * asset server are stored with the InventoryType of 0 (Texture) + * instead of 17 (Attachment) + * + * This corrects that behavior by forcing Object Asset types that have an + * invalid InventoryType with the proper InventoryType of Attachment. + */ InventoryType type = (InventoryType)descItem["inv_type"].AsInteger(); if (type == InventoryType.Texture && (AssetType)descItem["type"].AsInteger() == AssetType.Object) { diff --git a/LibreMetaverse/InventoryManager.cs b/LibreMetaverse/InventoryManager.cs index 19cfeed7..b5976cd0 100644 --- a/LibreMetaverse/InventoryManager.cs +++ b/LibreMetaverse/InventoryManager.cs @@ -3437,7 +3437,7 @@ namespace OpenMetaverse if (uint.TryParse(value, out timestamp)) creationDate = Utils.UnixTimeToDateTime(timestamp); else - Logger.Log("Failed to parse creation_date " + value, Helpers.LogLevel.Warning); + Logger.Log($"Failed to parse creation_date: {value}", Helpers.LogLevel.Warning); } } }