Improved Update Folder behaviour#6575
Conversation
… name rather than the file name. The name of the file after the replacement is the name of the file in the update folder.
|
FYI, Multi line changes start with |
|
oh yeah forgot to do that |
|
Tried to update ViaVersion 3.2.1 to 4.0.1 with this, the server seems to crash. |
|
oh that's odd, I tested it with my plugins and it worked fine. I'll investigate that |
|
Are you sure they had .jar file extensions on the end? |
|
yes |
|
Okay, I managed to update between those two viaversion versions fine on my machine, but I'm wondering if it's an operating system thing as I know file code can break between operating systems and you're on MacOS and I've been testing on Windows. |
|
Did some debugging, seems to be caused by macos file system junk, it was trying to update a .DS_Store file. Probably a good idea to ignore non .jar files. |
|
Worked when ignoring non-java files by changing if (updateFile.isFile()) {to if (updateFile.isFile() && updateFile.getName().toLowerCase().endsWith(".jar")) {(probably not the cleanest solution) EDIT: Definitely not the cleanest solution, solution below is better. |
|
I think a simple if (updatePluginLoader == null) continue; would be better here as the getPluginLoader already returns a plugin loader if the file extension matches and if it doesn't match then it returns null so makes sense. Thanks for debugging that for me! |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
shoo
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: stale[bot] ***@***.***>
Sent: Tuesday, November 16, 2021 7:02:23 PM
To: PaperMC/Paper ***@***.***>
Cc: Xemor ***@***.***>; Author ***@***.***>
Subject: Re: [PaperMC/Paper] Improved Update Folder behaviour (#6575)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#6575 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AHSVCMVQQNQULHYH6LOOKDDUMKTD7ANCNFSM5DTA6DWQ>.
|
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
We know what that means, rebase time 😄 |
|
Yeah I'll get on it in a couple days, it's a bit annoying it didn't get merged in the first place. |
This patch modifies the checkUpdate method to replace based on plugin name instead of file name. This allows you to retain versioning in your plugin's file names and use the update folder. When the plugin is replaced with the one in the update folder, the name of the plugin in the update folder is kept as well.
This closes the feature request I opened #6570
If you have any suggestions on how I can improve this patch, feel free to tell me, I'm open to criticism :)
EDIT: I have now been running this on my servers for a couple of days now, this is a linux machine, so it's tested on Windows, Mac OS & Linux now and it's been working a treat for me.