From 32428941d7efd23af313fc6aa86b9783fe0814e5 Mon Sep 17 00:00:00 2001 From: Salad Dais Date: Mon, 18 Aug 2025 21:28:26 +0000 Subject: [PATCH] Fix up inventory handlers a little --- hippolyzer/lib/client/inventory_manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hippolyzer/lib/client/inventory_manager.py b/hippolyzer/lib/client/inventory_manager.py index a5fa368..f69327b 100644 --- a/hippolyzer/lib/client/inventory_manager.py +++ b/hippolyzer/lib/client/inventory_manager.py @@ -120,6 +120,7 @@ class InventoryManager: # Line-delimited LLSD notation! for line in f.readlines(): # TODO: Parsing of invcache is dominated by `parse_notation()`. It's stupidly inefficient. + # TODO: sniff out binary LLSD invcaches node_llsd = llsd.parse_notation(line) if first_line: # First line is the file header @@ -140,7 +141,7 @@ class InventoryManager: def _handle_bulk_update_inventory(self, msg: Message): any_cats = False - for folder_block in msg["FolderData"]: + for folder_block in msg.get_blocks("FolderData", ()): if folder_block["FolderID"] == UUID.ZERO: continue any_cats = True @@ -150,7 +151,7 @@ class InventoryManager: # and hasn't just moved. update_fields={"parent_id", "name", "pref_type"}, ) - for item_block in msg["ItemData"]: + for item_block in msg.get_blocks("ItemData", ()): if item_block["ItemID"] == UUID.ZERO: continue self.model.upsert(InventoryItem.from_inventory_data(item_block))