Skip to content

Commit e81febf

Browse files
Merge pull request #72 from AoEInsights/master
support 25.06
2 parents 2eefe2e + 6b7e101 commit e81febf

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

mgz/header/de.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"turbo_enabled"/Flag,
6565
"shared_exploration"/Flag,
6666
"team_positions"/Flag,
67+
If(lambda ctx: find_save_version(ctx) >= 25.06, "unk"/Flag), # maybe handicap
6768
If(lambda ctx: find_save_version(ctx) >= 13.34, Bytes(8)),
6869
separator,
6970
"players"/Array(8, Struct(
@@ -86,7 +87,8 @@
8687
"hd_rm_elo"/Int32ul,
8788
"hd_dm_elo"/Int32ul,
8889
"animated_destruction_enabled"/Flag,
89-
"custom_ai"/Flag
90+
"custom_ai"/Flag,
91+
If(lambda ctx: find_save_version(ctx) >= 25.06, "unk"/Bytes(8)), # maybe handicap related?
9092
)),
9193
"fog_of_war"/Flag,
9294
"cheat_notifications"/Flag,
@@ -98,7 +100,7 @@
98100
"strings"/Array(23,
99101
Struct(
100102
"string"/de_string,
101-
RepeatUntil(lambda x, lst, ctx: lst[-1] not in [3, 21, 23, 42, 44, 45, 46], Int32ul)
103+
RepeatUntil(lambda x, lst, ctx: lst[-1] not in [3, 21, 23, 42, 44, 45, 46, 47], Int32ul)
102104
)
103105
),
104106
"strategic_numbers"/Array(59, Int32sl),
@@ -117,6 +119,7 @@
117119
If(lambda ctx: ctx._.save_version >= 13.17, Bytes(9)),
118120
If(lambda ctx: ctx._.save_version >= 20.06, Bytes(1)),
119121
If(lambda ctx: ctx._.save_version >= 20.16, Bytes(8)),
122+
If(lambda ctx: ctx._.save_version >= 25.06, Bytes(21)),
120123
de_string,
121124
Bytes(5),
122125
If(lambda ctx: ctx._.save_version >= 13.13, Byte),

mgz/header/scenario.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@
127127
If(lambda ctx: find_save_version(ctx) >= 13.34, Padding(132)),
128128
If(lambda ctx: find_save_version(ctx) >= 20.06, Padding(1)),
129129
If(lambda ctx: find_save_version(ctx) >= 20.16, Padding(4)),
130-
If(lambda ctx: find_save_version(ctx) >= 25.02, Padding(4*16))
130+
If(lambda ctx: find_save_version(ctx) >= 25.02, Padding(4*16)),
131+
If(lambda ctx: find_save_version(ctx) >= 25.06, Padding(4)),
131132
)
132133
),
133134
Array(9, "player_info"/Struct(
@@ -139,10 +140,13 @@
139140
Padding(4),
140141
IfThenElse(lambda ctx: ctx._._.version == Version.DE,
141142
IfThenElse(lambda ctx: find_save_version(ctx) >= 13.34,
142-
"end_of_game_settings"/Find(b'\x33\x33\x33\x33\x33\x33\x03\x40', None),
143-
"end_of_game_settings"/Find(b'\x9a\x99\x99\x99\x99\x99\x01\x40', None)
143+
IfThenElse(lambda ctx: find_save_version(ctx) >= 25.06,
144+
"end_of_game_settings"/Find(b'\x00\x00\x00\x00\x00\x00\x04\x40', None), # double: 2.5
145+
"end_of_game_settings"/Find(b'\x33\x33\x33\x33\x33\x33\x03\x40', None) # double: 2.4
146+
),
147+
"end_of_game_settings"/Find(b'\x9a\x99\x99\x99\x99\x99\x01\x40', None) # double: 2.2
144148
),
145-
"end_of_game_settings"/Find(b'\x9a\x99\x99\x99\x99\x99\xf9\\x3f', None)
149+
"end_of_game_settings"/Find(b'\x9a\x99\x99\x99\x99\x99\xf9\\x3f', None) # double: 1.6
146150
)
147151
)
148152

mgz/util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ def _parse(self, stream, context, path):
269269
marker_aok = read_bytes.find(b"\x9a\x99\x99\x3f")
270270
marker_up = read_bytes.find(b"\xf6\x28\x9c\x3f")
271271
marker_hd = read_bytes.find(b"\xae\x47\xa1\x3f")
272-
if save_version >= 25.02:
272+
if save_version >= 25.06:
273+
marker_de = read_bytes.find(b"\x9a\x99\xb9\x3f")
274+
elif save_version >= 25.02:
273275
marker_de = read_bytes.find(b"\xec\x51\xb8\x3f")
274276
elif save_version >= 25.01:
275277
marker_de = read_bytes.find(b"\x3d\x0a\xb7\x3f")

0 commit comments

Comments
 (0)