arkparser 0.1.4__tar.gz → 0.1.6__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.1.4 → arkparser-0.1.6}/PKG-INFO +1 -1
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/__init__.py +1 -1
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/files/profile.py +25 -7
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/game_objects/container.py +10 -1
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser.egg-info/PKG-INFO +1 -1
- {arkparser-0.1.4 → arkparser-0.1.6}/pyproject.toml +1 -1
- {arkparser-0.1.4 → arkparser-0.1.6}/LICENSE +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/README.md +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/common/__init__.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/common/binary_reader.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/common/exceptions.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/common/map_config.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/common/normalization.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/common/types.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/common/version_detection.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/data_models.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/export.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/files/__init__.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/files/base.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/files/cloud_inventory.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/files/tribe.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/files/world_save.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/game_objects/__init__.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/game_objects/game_object.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/game_objects/location.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/models/__init__.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/models/character.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/models/creature.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/models/item.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/models/player.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/models/stats.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/models/structure.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/models/tribe.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/properties/__init__.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/properties/base.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/properties/byte_property.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/properties/compound.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/properties/primitives.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/properties/registry.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/structs/__init__.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/structs/base.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/structs/colors.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/structs/misc.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/structs/property_list.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/structs/registry.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser/structs/vectors.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser.egg-info/SOURCES.txt +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser.egg-info/dependency_links.txt +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser.egg-info/requires.txt +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/arkparser.egg-info/top_level.txt +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/setup.cfg +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/tests/test_binary_reader.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/tests/test_cloud_inventory.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/tests/test_data_models.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/tests/test_export.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/tests/test_game_objects.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/tests/test_models.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/tests/test_profile.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/tests/test_tribe.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/tests/test_version_detection.py +0 -0
- {arkparser-0.1.4 → arkparser-0.1.6}/tests/test_world_save.py +0 -0
|
@@ -135,16 +135,34 @@ class Profile(ArkFile):
|
|
|
135
135
|
|
|
136
136
|
@property
|
|
137
137
|
def tribe_id(self) -> int | None:
|
|
138
|
-
"""
|
|
139
|
-
|
|
138
|
+
"""Get the player's tribe ID.
|
|
139
|
+
|
|
140
|
+
Purpose: return the tribe id ARK actually uses for this player.
|
|
141
|
+
Solo players (never joined a non-default tribe) carry only an
|
|
142
|
+
"auto-tribe" whose id equals their ``PlayerDataID``; the profile
|
|
143
|
+
stores ``TribeId=0`` for them. To match the legacy ASVExport / ARK
|
|
144
|
+
engine convention (and to give consumers a unique-per-player tribe
|
|
145
|
+
id they can group by), fall back to ``player_id`` in that case.
|
|
146
|
+
|
|
147
|
+
Preconditions: ``_player_data`` is parsed; ``PlayerDataID`` (used by
|
|
148
|
+
the auto-tribe fallback) may be missing for malformed profiles.
|
|
149
|
+
Postconditions: returns the explicit ``TribeId``/``TribeID`` when
|
|
150
|
+
non-zero, otherwise returns ``player_id``. Returns ``None`` only
|
|
151
|
+
when ``player_id`` is also missing.
|
|
152
|
+
Side effects: none.
|
|
153
|
+
Failure modes: returns ``None`` when neither field is recoverable.
|
|
140
154
|
|
|
141
155
|
Note: ASE uses "TribeId" (lowercase d), ASA uses "TribeID" (uppercase D).
|
|
142
156
|
"""
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
157
|
+
raw = self._player_data.get("TribeId")
|
|
158
|
+
if raw is None:
|
|
159
|
+
raw = self._player_data.get("TribeID")
|
|
160
|
+
if raw: # non-zero, non-None
|
|
161
|
+
return raw
|
|
162
|
+
# Solo player or freshly-left a tribe: ARK's auto-tribe id == player_id.
|
|
163
|
+
# Matches ASVExport behavior (and gives every player a stable, unique
|
|
164
|
+
# tribe id even when they're not in a multi-member tribe).
|
|
165
|
+
return self.player_id
|
|
148
166
|
|
|
149
167
|
@property
|
|
150
168
|
def tribe_name(self) -> str | None:
|
|
@@ -139,10 +139,19 @@ class GameObjectContainer:
|
|
|
139
139
|
return [obj for obj in self.objects if obj.is_item]
|
|
140
140
|
|
|
141
141
|
def get_structures(self) -> list[GameObject]:
|
|
142
|
-
"""Get all tribe-owned placed structures.
|
|
142
|
+
"""Get all tribe-owned placed structures.
|
|
143
|
+
|
|
144
|
+
Component sub-objects (has_parent_names=True) share the same coordinates
|
|
145
|
+
as their parent structure and must be excluded to avoid double-counting.
|
|
146
|
+
Every placed structure actor in ARK's save format is a root-level object
|
|
147
|
+
(one name only); its child inventory/component objects carry additional
|
|
148
|
+
names pointing back to the parent.
|
|
149
|
+
"""
|
|
143
150
|
results: list[GameObject] = []
|
|
144
151
|
for obj in self.objects:
|
|
145
152
|
cn = obj.class_name
|
|
153
|
+
if obj.has_parent_names:
|
|
154
|
+
continue
|
|
146
155
|
if obj.get_property_value("TargetingTeam") is None:
|
|
147
156
|
continue
|
|
148
157
|
if obj.get_property_value("DinoID1") is not None:
|
|
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
|