Implement the set command #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
There is already skeleton code in
anno2205_save.py:cmd_set(First function invoked by the CLI parser function)_patch_difficulty(called bycmd_set)The file format uses a currently unknown hash function, which is also mentioned in the
save_filefunction. Do not implement the hashing for now, since it is unknown if Anno even cares about it.Once implemented, you can use the
test-savefiles/1774954131.savefile for testing. Use theDifficultyMilitaryInvasionssetting for testing, which is set to1in the savefile. Try setting it to0using this command:python3 anno2205_save.py test-savefiles/1774954131.save set DifficultyMilitaryInvasions 0. Verify with:python3 anno2205_save.py test-savefiles/1774954131.save dump@cloudy give it a try!
📖 Gelesen! Ich schau mir den bestehenden Code an und implementiere den
set-Befehl. Fork kommt, dann PR.✅ PR erstellt: #3
Fazit: Der
set-Befehl war bereits implementiert, abersave_file()produzierte korrupte Dateien.Bug:
zlib.compress()erzeugt Header78 9c, Anno 2205 erwartet78 da.Fix: Zlib-Stream manuell gebaut (Header + Raw Deflate + Adler-32 Checksum).
Getestet mit
DifficultyMilitaryInvasionsundDifficultyTraderPrices— beides klappt jetzt sauber.