Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sc2reader/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ def __init__(self, pid, slot_data, detail_data, attribute_data):
#: >0 or None
self.commander_mastery_level = slot_data["commander_mastery_talents"]

#: Trophy ID
#: >0 or None
self.trophy_id = slot_data["trophy_id"]

#: The mastery talents picked for the co-op commander
#: list of longs of length 6, each between 0 and 30
self.commander_mastery_talents = slot_data["commander_mastery_talents"]
Expand Down
3 changes: 3 additions & 0 deletions sc2reader/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ def __call__(self, data, replay):
]
if replay.base_build >= 42932
else None,
trophy_id=data.read_uint32()
if replay.base_build >= 75689
else None,
reward_overrides=[
[
data.read_uint32(),
Expand Down
Binary file added test_replays/4.10.0.75689/trophy_id_13.SC2Replay
Binary file not shown.
6 changes: 6 additions & 0 deletions test_replays/test_replays.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,12 @@ def test_70154(self):
factory = sc2reader.factories.SC2Factory()
replay = factory.load_replay(replayfilename)

def test_75689(self):
for replayfilename in ["test_replays/4.10.0.75689/trophy_id_13.SC2Replay"]:
factory = sc2reader.factories.SC2Factory()
replay = factory.load_replay(replayfilename)
self.assertEqual(replay.players[0].trophy_id, 13)

def test_anonymous_replay(self):
replayfilename = "test_replays/4.1.2.60604/1.SC2Replay"
factory = sc2reader.factories.SC2Factory()
Expand Down