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

added save version 61.5 compatibility #104

Closed

Conversation

Skazu
Copy link
Contributor

@Skazu Skazu commented Mar 19, 2024

I've added Save-Version 61.5 compatibility for the fast header+body parser.

This patch is running since a few hours for us now, we could parse hundreds of games with it.

But i have to mention two things which i'm not happy with for now:

Finding Marker at scenario parsing
Although this works i couldn't find a way to do it without this marker (as it was before). I think there might be better ways to do it.

Unit tests
The different parser implementations support different versions, the fast header parser doesn't seem to support DE save-versions <=13 (at least it didn't at my tests, and i couldn't find the conditional parsings for versions like 13.17 as in the full parser, for example).
And since i've now added unit tests for the fast header parser i had to add some ugly guard checks to skip some savegames in some conditions.
Maybe it would be better to group the savegames in different folders or smth. like that.

If you already work on your own implementation just skip this pr and we will fetch your upstream changes as soon as they are available.

@Skazu Skazu force-pushed the feature/61.5-compatibility branch from 3f04203 to 67e5e39 Compare March 19, 2024 12:09
@happyleavesaoc
Copy link
Owner

Just a note that I am at a similar place. There are some tough changes in the full object parsing that I have not had time to address yet.

The marker in parse_scenario is failing because the points structure following the players is improperly parsed. This is because the version number for that structure has changed.

-    points_version = header.read().find(b'\x00\x00\x00@')
+    pv = b'\x00\x00\x00@'
+    if save >= 61.5:
+        pv = b'\x66\x66\x06\x40'
+    points_version = header.read().find(pv)

@happyleavesaoc
Copy link
Owner

happyleavesaoc commented Jul 20, 2024

See deea5c4

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.

None yet

2 participants