arkparser 0.5.3__tar.gz → 0.5.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {arkparser-0.5.3 → arkparser-0.5.4}/PKG-INFO +1 -1
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/__init__.py +1 -1
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/data_models.py +25 -2
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser.egg-info/PKG-INFO +1 -1
- {arkparser-0.5.3 → arkparser-0.5.4}/pyproject.toml +1 -1
- {arkparser-0.5.3 → arkparser-0.5.4}/LICENSE +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/README.md +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/common/__init__.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/common/binary_reader.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/common/exceptions.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/common/map_config.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/common/normalization.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/common/types.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/common/version_detection.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/export.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/files/__init__.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/files/base.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/files/cloud_inventory.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/files/profile.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/files/tribe.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/files/world_save.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/game_objects/__init__.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/game_objects/container.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/game_objects/game_object.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/game_objects/location.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/properties/__init__.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/properties/base.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/properties/byte_property.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/properties/compound.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/properties/primitives.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/properties/registry.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/structs/__init__.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/structs/base.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/structs/colors.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/structs/misc.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/structs/property_list.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/structs/registry.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/structs/vectors.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser.egg-info/SOURCES.txt +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser.egg-info/dependency_links.txt +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser.egg-info/requires.txt +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/arkparser.egg-info/top_level.txt +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/setup.cfg +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_asa_header_position.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_asa_name_table.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_ase_cluster_drift.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_binary_reader.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_binary_reader_layouts.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_cloud_export.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_cloud_inventory.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_cryopod_export.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_current_stats.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_data_models.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_export.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_game_objects.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_profile.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_review_fixes.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_tribe.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_v13_property_layouts.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_version_detection.py +0 -0
- {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_world_save.py +0 -0
|
@@ -9,6 +9,7 @@ from __future__ import annotations
|
|
|
9
9
|
|
|
10
10
|
import logging
|
|
11
11
|
import math
|
|
12
|
+
import re
|
|
12
13
|
import typing as t
|
|
13
14
|
from dataclasses import dataclass, field
|
|
14
15
|
|
|
@@ -18,6 +19,26 @@ from .properties.registry import read_properties
|
|
|
18
19
|
|
|
19
20
|
logger = logging.getLogger(__name__)
|
|
20
21
|
|
|
22
|
+
# Trailing UE actor spawn-instance suffix on cryopod class names, e.g.
|
|
23
|
+
# "Raptor_Character_BP_C_2145673735". ARK stores the full instance name in the
|
|
24
|
+
# cryopod CustomDataStrings/SoftClasses blob; the worldsave name-table path
|
|
25
|
+
# discards this instance int32, so non-cryo tames never carry it. Strip it to
|
|
26
|
+
# match the canonical class name ("Raptor_Character_BP_C") and legacy parity.
|
|
27
|
+
_INSTANCE_SUFFIX_RE = re.compile(r"_\d+$")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _strip_instance_suffix(class_name: str) -> str:
|
|
31
|
+
"""Drop a trailing ``_<digits>`` actor-instance suffix from a class name.
|
|
32
|
+
|
|
33
|
+
Pre: ``class_name`` is a str. Post: returns the same string with at most one
|
|
34
|
+
trailing ``_<digits>`` group removed. Legit variant suffixes (``_Aberrant_C``,
|
|
35
|
+
``_Fire_C``) end in a letter, so they are never touched.
|
|
36
|
+
"""
|
|
37
|
+
assert isinstance(class_name, str), "class_name must be str"
|
|
38
|
+
stripped = _INSTANCE_SUFFIX_RE.sub("", class_name)
|
|
39
|
+
assert len(stripped) <= len(class_name), "strip must not grow the string"
|
|
40
|
+
return stripped
|
|
41
|
+
|
|
21
42
|
|
|
22
43
|
def _finite(value: t.Any, default: float) -> float:
|
|
23
44
|
"""Coerce to a finite float; NaN / inf / non-numeric collapse to ``default``.
|
|
@@ -514,7 +535,7 @@ class CryopodCreature:
|
|
|
514
535
|
# Parse strings - need at least 3 for basic info
|
|
515
536
|
strings = normalize_indexed_list(custom_data.get("CustomDataStrings"))
|
|
516
537
|
if len(strings) >= 3:
|
|
517
|
-
cryo.class_name = strings[0] #
|
|
538
|
+
cryo.class_name = _strip_instance_suffix(strings[0]) # raw: "Raptor_Character_BP_C_2145673735"
|
|
518
539
|
display_name = strings[1] # e.g., "bluey - Lvl 228 (Raptor)"
|
|
519
540
|
colors_str = strings[2] # e.g., "2,2,2,2,2,2,"
|
|
520
541
|
|
|
@@ -602,7 +623,9 @@ class CryopodCreature:
|
|
|
602
623
|
if soft_classes:
|
|
603
624
|
first_class = soft_classes[0]
|
|
604
625
|
if isinstance(first_class, dict):
|
|
605
|
-
cryo.class_name =
|
|
626
|
+
cryo.class_name = _strip_instance_suffix(
|
|
627
|
+
first_class.get("name", cryo.class_name)
|
|
628
|
+
)
|
|
606
629
|
|
|
607
630
|
# Populate raw creature_props / status_props so the export
|
|
608
631
|
# pipeline's _SyntheticGameObject adapter (which calls
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|