New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DE version 25.22 fails on header parse #73
Comments
Hi @Namek fast reader does not yet support 25.22 |
but does something? I try with |
The recording comes from another player. I just created a single player recordings on my machine and the I tried single player both on English and Polish but I still have a slight suspicion on the language. |
JUST FYI: from mgz.model import parse_match
from mgz.summary import Summary
def get_match_info(data):
try:
# some files seems broken for this library when using the `Summary`.
m = parse_match(data)
players = [dict(name=p.name, user_id=p.profile_id, number=p.number,
civilization=p.civilization) for p in m.players]
return dict(
map_name=m.map.name,
game_version=f"{m.version.name} {m.version.value}",
game_map_type=m.type,
players=players,
teams=m.teams,
completed=False,
start_time_seconds=int(m.actions[0].timestamp.seconds),
duration_seconds=m.duration.seconds,
)
except RuntimeError:
# the `parse_match` method doesn't work for restored recordings, thus, let's try with the `Summary`.
data.seek(0)
s = Summary(data)
return dict(
map_name=s.get_map()['name'],
game_version=" ".join(str(x) for x in s.get_version()),
game_map_type=s.get_settings()['type'][1],
players=s.get_players(),
teams=s.get_teams(),
completed=s.get_completed(),
start_time_seconds=int(s.get_start_time()/1000),
duration_seconds=int(s.get_duration()/1000),
) This is what I need from recordings. It's basically header information. |
Ok, I confirmed it's failing to parse the DE header (in both |
Tested a few custom maps, that was not the issue. Were any unusual settings used for that match? |
the map from the recording is supposed to be "ANT - Arabia" from the mod |
of anything special: players are supposed to use the "hidden civ" setting when hosting |
I am testing a fix for this. |
Please try the latest commit on
|
@happyleavesaoc Somehow I have the same issue in the exact same place. EDIT: OK, I got an error on my side. This finally reads the file with the |
Fast reader crashes at this line:
aoc-mgz/mgz/fast/header.py
Line 323 in 77216bc
MP_Replay_v101.101.58259.0_2022.02.01_214243_2.zip
The text was updated successfully, but these errors were encountered: