-
Notifications
You must be signed in to change notification settings - Fork 521
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
[OTR Archive] Store soh version in OTR files and verify on launch/ask to regenerate #3218
[OTR Archive] Store soh version in OTR files and verify on launch/ask to regenerate #3218
Conversation
Need to test the error handling for old/missing soh.otr and old game otr on Switch and Wii U. |
Not that I can think of. The version numbers give us everything we really need from a verification standpoint. The only usefulness would be to "show" the full build string to the user in the error message, but that is not really the critical part. All the user really needs to know is that their otr is old and it needs to be regenerated. |
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.
couple little comments but nothing blocking
@Archez any reason not to merge yet? |
Needs a LUS bump first |
Want to submit it? |
Sure. Also testing on wii u/switch would be nice. The expected behavior is an error message and the application closing/locking up I believe. |
Turns out the version ints like |
This PR adds a new file in otr files to track the soh version that was used to generate them. This is valid for the
oot.otr
,oot-mq.otr
and thesoh.otr
files. This is achieved by modifying the extraction process to pass the soh version as an argument through ZAPD into the OTRExporter. The OTRExporter will saved the soh version into the otr as aportVersion
file. The version is stored as its individual parts (major/minor/patch) as 3 numbers, so reading the version will require reading the 3 numbers separately.The mac and linux scripts were changed to be cmake inject-able files (
.in
) so that the soh version can be supplied by cmake directly and the final file will be generated to be used with in the bundling process. The cmake extract/generate steps will also pass the version through.In the soh launch process we then are checking the soh.otr that it exists, and that it matches the running soh version exactly. If it doesn't an error message is displayed and the process killed. Then we check both the vanilla and mq otrs to see if their major version matches the running soh's major version. If it doesn't a prompt is presented asking the player to regenerate their otr file (re-run the built-in extraction process). For Wii U/Switch, instead an error is displayed and the process is killed/interrupted.
The variable type for the version numbers also needed to be changed to an explicit uint16_t so that they work properly on 32 bit devices.
Depends on Kenix3/libultraship#346 - Merged
Depends on HarbourMasters/OTRExporter#10 - Merged
Build Artifacts