Skip to content

Commit b23ce78

Browse files
committed
Add support for decoding replays from 75689
New field called `trophy_id` was added to `initdata`. Besides that, nothing else was changed in `s2protocol`. https://github.com/Blizzard/s2protocol/blob/3ba4fcbef627b952e183eccd07e51f8184aa7a31/s2protocol/versions/protocol75689.py#L96
1 parent 9619c53 commit b23ce78

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

sc2reader/objects.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ def __init__(self, pid, slot_data, detail_data, attribute_data):
217217
#: >0 or None
218218
self.commander_mastery_level = slot_data["commander_mastery_talents"]
219219

220+
#: Trophy ID
221+
#: >0 or None
222+
self.trophy_id = slot_data["trophy_id"]
223+
220224
#: The mastery talents picked for the co-op commander
221225
#: list of longs of length 6, each between 0 and 30
222226
self.commander_mastery_talents = slot_data["commander_mastery_talents"]

sc2reader/readers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ def __call__(self, data, replay):
238238
]
239239
if replay.base_build >= 42932
240240
else None,
241+
trophy_id=data.read_uint32()
242+
if replay.base_build >= 75689
243+
else None,
241244
reward_overrides=[
242245
[
243246
data.read_uint32(),
47.2 KB
Binary file not shown.

test_replays/test_replays.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,12 @@ def test_70154(self):
695695
factory = sc2reader.factories.SC2Factory()
696696
replay = factory.load_replay(replayfilename)
697697

698+
def test_75689(self):
699+
for replayfilename in ["test_replays/4.10.0.75689/trophy_id_13.SC2Replay"]:
700+
factory = sc2reader.factories.SC2Factory()
701+
replay = factory.load_replay(replayfilename)
702+
self.assertEqual(replay.players[0].trophy_id, 13)
703+
698704
def test_anonymous_replay(self):
699705
replayfilename = "test_replays/4.1.2.60604/1.SC2Replay"
700706
factory = sc2reader.factories.SC2Factory()

0 commit comments

Comments
 (0)