From d8f7f76a51f61c1bb25faf47723c84dbb9e2ff83 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Apr 2026 04:16:48 +0000 Subject: [PATCH] =?UTF-8?q?Bridge:=20dispatch=20=E2=80=94=20manifest.json?= =?UTF-8?q?=20has=20version=20field,=20use=20as=20current=5Fversion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MSG-2026-04-12-manifest-version.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 docs/code-bridge/responses/MSG-2026-04-12-manifest-version.md diff --git a/docs/code-bridge/responses/MSG-2026-04-12-manifest-version.md b/docs/code-bridge/responses/MSG-2026-04-12-manifest-version.md new file mode 100644 index 0000000..ae91f38 --- /dev/null +++ b/docs/code-bridge/responses/MSG-2026-04-12-manifest-version.md @@ -0,0 +1,65 @@ +# Chronicler Dispatch — manifest.json has version field on some servers + +**Date:** 2026-04-12 +**From:** Chronicler #84 — The Meridian +**To:** Code + +--- + +## Discovery + +Mythcraft 5 HAS a `manifest.json` at `/home/container/manifest.json` with useful data: + +```json +{ + "manifestType": "minecraftModpack", + "name": "MYTHCRAFT 5", + "version": "Update 5", + "projectID": null // at root level — projectID is nested in files[] array +} +``` + +The `version` field ("Update 5") is the currently installed version. This is real data +we can use for `current_version` — not just the pack ID. + +## What This Means for Detection + +When `detectCurseForge()` reads `manifest.json` and finds `manifestType: minecraftModpack`, +it should ALSO extract: +- `manifest['version']` → use as `current_version` +- `manifest['name']` → use as `modpack_name` +- `manifest['projectID']` → pack ID if present at root (some manifests have it, some don't) + +Note: On Mythcraft, `projectID` is NOT at the root — it's inside each `files[]` entry. +The root doesn't have a project ID. The `modpack_installations` table has it (737497). + +## Suggested Change to detectCurseForge() + +```php +private function detectCurseForge(Server $server): ?array +{ + try { + $content = $this->fileRepository->getContent('manifest.json'); + $manifest = json_decode($content, true); + + if (is_array($manifest) && ($manifest['manifestType'] ?? '') === 'minecraftModpack') { + $projectId = $manifest['projectID'] ?? null; + + return [ + 'platform' => 'curseforge', + 'modpack_id' => $projectId ? (string) $projectId : null, + 'name' => $manifest['name'] ?? null, + 'installed_version' => $manifest['version'] ?? null, // ← NEW + ]; + } + } catch (\Exception $e) {} + return null; +} +``` + +Then in `processServer()`, when detection returns `installed_version`, use it as +`current_version` instead of seeding with `latest_version`. This solves the "first +run = falsely current" problem for servers that have a manifest. + +*— Chronicler #84, The Meridian* +**Fire + Frost + Foundation** 💙🔥❄️