Add full PaperMC auto-update support#359
Add full PaperMC auto-update support#359SuperChewie wants to merge 17 commits intoMinecraftServerControl:mainfrom
Conversation
|
Should be merged along with this documentation update. MinecraftServerControl/MinecraftServerControl.github.io#18 |
|
@sandain this new feature is ready for review. I have tested the upgrade via |
|
Hi @SuperChewie. Thanks for your work on this, it is something that I have thought about doing in the past but never got around to. I'll need to spend some more time reviewing the changes before I accept the PR and I'm rather busy at the moment, but I will get around to it. If anyone else has the chance to test these changes in the meantime, please give us a report on your thoughts. |
|
@sandain Its a lot of code changes so I get needing time to review. My goal was to setup a framework for auto updates so that additional server types could be supported in future features. In fact I'm using this to build one for Forge. As a contributor, what would be helpful to comment as far as test results? I get doing QA yourself, just trying to make it easier. Hopefully the unit tests for the additional functions will help improve confidence in future code work. |
Add full PaperMC auto-update support
Summary
This PR adds full lifecycle support for PaperMC. This allows worlds configured with
mscs-server-type=papermcto automatically track, download, and verify PaperMC builds via the PaperMC v3 Downloads API. It also reorganizes the version JSON cache into a dedicatedversions/subdirectory and ships five new unit test files.Note: Claude was used to support the development of these changes.
Motivation
PaperMC is one of the most widely used Minecraft server implementations, offering significant performance improvements over vanilla. Previously, MSCS users who wanted PaperMC had to manually manage JAR downloads and set
mscs-server-urlby hand — losing out on the automatic update flow that vanilla worlds enjoy. This change closes that gap by wiring PaperMC into the samemscs update/mscs force-updatelifecycle used by vanilla, with no extra steps required after initial configuration.Additionally, the version manifest JSON was previously stored directly in
/opt/mscs/, alongside world directories and defaults files. Collecting all cached version JSON into aversions/subfolder makes the layout cleaner and provides a natural home for the new PaperMC cache files.Before
mscs-server-type=papermcwas not a recognised value; users had to manually setmscs-server-url,mscs-server-jar, and re-set them on every PaperMC release.mscs update/mscs force-updateonly knew how to handle vanilla Minecraft; running either on a PaperMC world did nothing useful.version_manifest.jsonwas stored directly in/opt/mscs/.After
mscs-server-type=papermcinmscs.propertiesfully enables the automatic update flow:mscs updatefetchespaper_project.json(list of available MC versions and builds) and the per-versionpaper_builds_VERSION.json, then compares the SHA256 of the installed JAR against the latest build. If a newer build is available the JAR is replaced automatically — noforce-updaterequired for build bumps within the same MC version.mscs force-updatewipes all PaperMC cache files (paper_project.jsonandpaper_builds_*.json) and re-downloads everything from scratch.mscs-server-urlormscs-server-jarconfiguration is needed.mscs-paper-channelproperty (per-world) andmscs-default-paper-channel(global default) control which build channel is targeted:STABLE(default),BETA, orALPHA.getCurrentPaperVersionskips MC versions that have no build in the configured channel.getServerCurrentVersion, a new dispatch function, replaces direct calls togetCurrentMinecraftVersioningetServerVersion,getServerJar,getServerLocation, andgetServerURL, so all server-type-specific logic flows through a single case-based switch./opt/mscs/versions/. A migration script (update.d/20-versions-subfolder) moves any existingversion_manifest.json(and its.bak) into the new location onmake update.getCurrentPaperVersion,getPaperServerURL,getPaperServerChecksum), and thegetServerVersiondispatch path — all using file fixtures with no network access.