Skip to content

Commit

Permalink
Add notes about inventory compatibility issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SaladDais committed Dec 21, 2023
1 parent 0f2e933 commit 3efeb46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion hippolyzer/lib/base/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,14 @@ class InventoryPermissions(InventoryBase):
group_id: UUID = schema_field(SchemaUUID)
# Nothing actually cares about this, but it could be there.
# It's kind of redundant since it just means owner_id == NULL_KEY && group_id != NULL_KEY.
is_owner_group: int = schema_field(SchemaInt, default=0, llsd_only=True)
is_owner_group: Optional[int] = schema_field(SchemaInt, default=None, llsd_only=True)


@dataclasses.dataclass
class InventorySaleInfo(InventoryBase):
SCHEMA_NAME: ClassVar[str] = "sale_info"

# TODO: Not a string in AIS
sale_type: str = schema_field(SchemaStr)
sale_price: int = schema_field(SchemaInt)

Expand Down Expand Up @@ -358,6 +359,7 @@ def __contains__(self, item) -> bool:

@dataclasses.dataclass
class InventoryContainerBase(InventoryNodeBase):
# TODO: Not a string in AIS
type: str = schema_field(SchemaStr)

@property
Expand Down Expand Up @@ -436,7 +438,9 @@ class InventoryItem(InventoryNodeBase):
permissions: InventoryPermissions = schema_field(InventoryPermissions)
asset_id: Optional[UUID] = schema_field(SchemaUUID, default=None)
shadow_id: Optional[UUID] = schema_field(SchemaUUID, default=None)
# TODO: Not a string in AIS
type: Optional[str] = schema_field(SchemaStr, default=None)
# TODO: Not a string in AIS
inv_type: Optional[str] = schema_field(SchemaStr, default=None)
flags: Optional[int] = schema_field(SchemaFlagField, default=None)
sale_info: Optional[InventorySaleInfo] = schema_field(InventorySaleInfo, default=None)
Expand Down
1 change: 0 additions & 1 deletion tests/base/test_legacy_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def test_llsd_serialization(self):
'next_owner_mask': 581632,
'owner_id': UUID('a2e76fcd-9360-4f6d-a924-000000000003'),
'owner_mask': 2147483647,
'is_owner_group': 0,
},
'sale_info': {
'sale_price': 10,
Expand Down

0 comments on commit 3efeb46

Please sign in to comment.