diff --git a/hippolyzer/lib/base/inventory.py b/hippolyzer/lib/base/inventory.py index f9e8667..f3e3bdb 100644 --- a/hippolyzer/lib/base/inventory.py +++ b/hippolyzer/lib/base/inventory.py @@ -49,11 +49,15 @@ class SchemaFlagField(SchemaHexInt): """Like a hex int, but must be serialized as bytes in LLSD due to being a U32""" @classmethod def from_llsd(cls, val: Any, flavor: str) -> int: - return struct.unpack("!I", val)[0] + if flavor == "legacy": + return struct.unpack("!I", val)[0] + return val @classmethod def to_llsd(cls, val: int, flavor: str) -> Any: - return struct.pack("!I", val) + if flavor == "legacy": + return struct.pack("!I", val) + return val class SchemaEnumField(SchemaStr, Generic[_T]): diff --git a/hippolyzer/lib/proxy/asset_uploader.py b/hippolyzer/lib/proxy/asset_uploader.py index 2546428..5852373 100644 --- a/hippolyzer/lib/proxy/asset_uploader.py +++ b/hippolyzer/lib/proxy/asset_uploader.py @@ -22,7 +22,7 @@ class ProxyAssetUploader(AssetUploader): ] } async with self._region.caps_client.post('FetchInventory2', llsd=ais_req_data) as resp: - ais_item = InventoryItem.from_llsd((await resp.read_llsd())["items"][0]) + ais_item = InventoryItem.from_llsd((await resp.read_llsd())["items"][0], flavor="ais") # Got it, ship it off to the viewer message = Message(