Add auto-updating support for Steam Workshop mods - #290
Conversation
- Discover Workshop mods by reading publishedid from meta.cpp - Check for updates via the Steam Web API (GetPublishedFileDetails) and only download when time_updated is newer than the cached version - Download updates through SteamCMD (NOTIFY/MANUAL/AUTOMATIC profiles) - Cache steam-workshop-id and version in mods.yml - Add SteamWorkshopUpdateFinder and TaskSteamWorkshopModDownload - Tests: meta.cpp parsing, mod discovery, end-to-end update flow Builds upon the earlier work in PR Osiris-Team#280.
|
@JnCaoxia okay 2 weeks have passed, thus I'll review the PR. Let me know if you are still available and interested in merging this. |
|
@JnCaoxia let me know when you got time to work on this, so I can start the review. closing this until then |
|
Note: This will be merged on the 15.09 without payment. |
Closes #215 — adds auto-updating support for Steam Workshop mods (e.g. DayZ server mods).
What changed
Discovery:
SteamWorkshopModscans the mods folder for directories containingmeta.cppand readspublishedid,nameandtimestamp.Update check: New
SteamWorkshopUpdateFinder(same per-task usage pattern asResourceFinder) queries the Steam Web API (GetPublishedFileDetails) and only reportsUPDATE_AVAILABLEwhentime_updatedis newer than the version cached inmods.yml— mods are not re-downloaded on every run.Download: New
TaskSteamWorkshopModDownload(mirrorsTaskModDownload) downloads the item via SteamCMDworkshop_download_item, honoring NOTIFY / MANUAL / AUTOMATIC profiles; with AUTOMATIC the content is copied back into the existing mod directory and the cached version is updated.Config:
steam-workshop-idis cached inmods.yml;mods-updater.pathand themods.ymlheader comments document the feature. The existingserver-updater.softwaresetting is reused as the Steam app-id (e.g.221100for DayZ) — no new config key needed.Review feedback from #280 addressed
Update-check logic extracted into its own class (
SteamWorkshopUpdateFinder), used likeResourceFinder, and integrated into the existing parallel executor instead of a separate flow.The version no longer defaults to the publishedId (the confusing line in Add DayZ workshop mod updates #280): a Workshop mod's version is its
meta.cpptimestamp when present, otherwise empty, so the first update check always runs.Update check only marks
UPDATE_AVAILABLEwhen the item actually changed (comparestime_updatedagainst the cached version).Download logic integrated into
doDownloadLogicviaTaskSteamWorkshopModDownload, following theTaskModDownloadpattern; both share the newModDownloadTaskinterface.A test showing the actual update process: see end-to-end tests below.
Note on the Steam Web API call
GetPublishedFileDetailsonly accepts POST form requests — GET returns an error (verified against the live API). Since jlib'sJson.get(url)performs a GET, it cannot be used here. The implementation uses a plainHttpURLConnectionPOST plus the already-present Gson dependency, so no new dependencies are introduced (per BOUNTY_TERMS §5).Testing
mvn -DskipTests compile— clean (OpenJDK 17, release 9 target)mvn -Dtest='SteamWorkshopModTest,SteamCMDTest#buildsWorkshopItemCommand' test— 5/5 green:meta.cpp parsing (id / name / timestamp)
Workshop mod discovery in the mods folder
E2E: metadata current → no download, no warnings, version kept
E2E: newer metadata → SteamCMD download → files copied into the mod dir → new version cached in mods.yml
SteamCMD workshop command building
AI-assisted contribution disclosure
Per BOUNTY_TERMS §4: this contribution was developed with AI assistance. All code has been reviewed line-by-line, compiled, and tested locally by me, and I take full responsibility for its behavior and quality.
Payment: my PayPal email is visible on my public GitHub profile (per BOUNTY_TERMS §2).