-
Notifications
You must be signed in to change notification settings - Fork 703
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
Core: prepare worlds.Files for APWorldContainer #4331
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looked at code and tested generate and patch a game
Co-authored-by: Doug Hoskisson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not test, but changes appear fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, and successfully generated a Factorio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APContainers is not a system I know very well, but code LGTM.
@@ -135,31 +126,61 @@ def read(self, file: Optional[Union[str, BinaryIO]] = None) -> None: | |||
message = f"{arg0} - " | |||
raise InvalidDataError(f"{message}This might be the incorrect world version for this file") from e | |||
|
|||
def read_contents(self, opened_zipfile: zipfile.ZipFile) -> None: | |||
def read_contents(self, opened_zipfile: zipfile.ZipFile) -> Dict[str, Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking: Now that the minimal python version is 3.10, using Dict
from typing is no longer required. The return type could be replaced with dict[str, Any]
.
Same for the return type of get_manifest
and the various Optional[str]
that could be replaced with str | None
.
# minimum version of patch system expected for patching to be successful | ||
"compatible_version": 5, | ||
"version": container_version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to keep the compatible_version
and version
here? They are already added to the manifest in APContainer
.
What is this fixing or adding?
Not much on its own.
APContainer is now just any AP related zip file containing an archipelago.json
APPlayerContainer is the old one, aimed at files for a particular slot/player
Follow up PR(s) can then cleanly introduce APWorldContainer(APContainer) with the meta data we desire inside the archipelago.json.
How was this tested?
I ran Factorio gen once and it didn't break