Skip to content
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

Handle in-progress replay length correctly #46

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

NickCondron
Copy link
Contributor

Fixes #26 by preventing a negative length from being passed to _parse_events

A separate question is to decide what it means if the user passes skip_frames = True for in-progress replays. Some finished replays can have the raw length equal to 0 too. I think it makes sense to handle these cases gracefully and skip over frame events one-by-one.

@IAmAbszol
Copy link
Contributor

IAmAbszol commented Mar 3, 2023

In-game streaming was something that I helped implement in the past, funny how these things tend to pop back up.

I have a file that you'll want to test against that runs into a EOF error when parsing, as it's missing its metadata originally which differs from yours and any others I've tested. I wrote a simple Python script that finds the metadata string inside the slippi binary data.

Metadata

EOFError

ZIP file containing console replay that'll fail on EOF with your implementation.
console_bad.zip

Next time I have free time I'll poke around the driving while loop. If anything, I don't see why the Game class couldn't just be released half-baked and allow the user to discern the Game class if that makes any sense.

Cheers,
Abszol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issues with parsing file in-progress
2 participants