marcrobledo / RomPatcher.js

An IPS/UPS/APS/BPS/RUP/PPF/xdelta ROM patcher made in HTML5.
https://www.marcrobledo.com/RomPatcher.js/
Other
723 stars 141 forks source link

Favor patch in zip root over patches in a folder #67

Closed gzip closed 1 month ago

gzip commented 5 months ago

As mentioned on romhacking.net: https://www.romhacking.net/forum/index.php?topic=39009.0

Ideally we could pass a specific patch path but using whatever is in the root (maybe alphabetically if there multiple patches) is a good start.

Also if you could explain what the current behavior is for selecting the default patch.

gzip commented 3 months ago

Also if you could explain what the current behavior is for selecting the default patch.

To answer my own question, it turns out that zip files have an internal index based on the order in which files were added to the archive. (You can verify the order of an existing zip file using zipinfo.) Overwriting an existing file does not change the order.

So the first file added to the archive will be the first one to be selected in the UI, basically FIFO.

marcrobledo commented 2 months ago

I saw you edited your Maniac Mansion zip file so they now appear correctly.

Do you keep by any chance the old zip file that showed incorrectly? Or do you know of any other patch that have the same issue by any chance?

marcrobledo commented 2 months ago

I've managed to replicate it with a custom file.

Should be fixed in commit 41174df6c5667fac717b5022e73f77bbc6ecdbf4, can you confirm? I made it so it sorts unzipped files by name and folder, placing first the ones in the root folder.

gzip commented 2 months ago

@marcrobledo I can verify that on master the order of the files in the select box when uploading a zip file has changed to prioritize files in the root in alphabetical order, vs the behavior on your site which doesn't. Not sure how to verify the behavior on romhacking.net though. Do they have some customizations?

marcrobledo commented 1 month ago

@marcrobledo I can verify that on master the order of the files in the select box when uploading a zip file has changed to prioritize files in the root in alphabetical order, vs the behavior on your site which doesn't. Not sure how to verify the behavior on romhacking.net though. Do they have some customizations?

Indeed, I was the responsible of updating Rom Patcher JS in RHDN. It didn't have any customization, but I always uploaded the latest version in my server for testing purposes. Then, I'd upload some days later to RHDN if nothing was broken.

RHDN has now 2.9.1, which is the latest legacy version. Not sure if I'll be updating it there anymore since the site is not accepting new patches (and downloads might be removed sooner or later).