Skip to content

Add auto-updating support for Steam Workshop mods - #290

Open
JnCaoxia wants to merge 1 commit into
Osiris-Team:masterfrom
JnCaoxia:steam-workshop-mod-updates
Open

Add auto-updating support for Steam Workshop mods#290
JnCaoxia wants to merge 1 commit into
Osiris-Team:masterfrom
JnCaoxia:steam-workshop-mod-updates

Conversation

@JnCaoxia

@JnCaoxia JnCaoxia commented Aug 1, 2026

Copy link
Copy Markdown

Closes #215 — adds auto-updating support for Steam Workshop mods (e.g. DayZ server mods).

Note: This PR builds upon the earlier work in #280 (derived PR as described in BOUNTY_TERMS §6). The original PR was closed by its author; this implementation addresses all remaining review feedback on top of the current master.

What changed

  • Discovery: SteamWorkshopMod scans the mods folder for directories containing meta.cpp and reads publishedid, name and timestamp.

  • Update check: New SteamWorkshopUpdateFinder (same per-task usage pattern as ResourceFinder) queries the Steam Web API (GetPublishedFileDetails) and only reports UPDATE_AVAILABLE when time_updated is newer than the version cached in mods.yml — mods are not re-downloaded on every run.

  • Download: New TaskSteamWorkshopModDownload (mirrors TaskModDownload) downloads the item via SteamCMD workshop_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-id is cached in mods.yml; mods-updater.path and the mods.yml header comments document the feature. The existing server-updater.software setting is reused as the Steam app-id (e.g. 221100 for DayZ) — no new config key needed.

Review feedback from #280 addressed

  • Update-check logic extracted into its own class (SteamWorkshopUpdateFinder), used like ResourceFinder, 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.cpp timestamp when present, otherwise empty, so the first update check always runs.

  • Update check only marks UPDATE_AVAILABLE when the item actually changed (compares time_updated against the cached version).

  • Download logic integrated into doDownloadLogic via TaskSteamWorkshopModDownload, following the TaskModDownload pattern; both share the new ModDownloadTask interface.

  • A test showing the actual update process: see end-to-end tests below.

Note on the Steam Web API call

GetPublishedFileDetails only accepts POST form requests — GET returns an error (verified against the live API). Since jlib's Json.get(url) performs a GET, it cannot be used here. The implementation uses a plain HttpURLConnection POST 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' test5/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).

- 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 JnCaoxia mentioned this pull request Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-Update DayZ mods

1 participant