From ab928b13e0965186c05df8e94675437cd1e11c4f Mon Sep 17 00:00:00 2001 From: claude-bot Date: Mon, 10 Aug 2026 23:43:54 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20config=20=ED=8C=8C=EC=9D=BC(.zip)=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5/=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=20?= =?UTF-8?q?=EC=A7=80=EC=9B=90=20(v0.4.27)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 관리자 편집기에서 맵 파일과 서버 파일 사이에 "config 파일 (.zip)" 필드를 추가하고, 간편설치기가 /file/configs/ zip 을 받아 게임 폴더(.mc_custom) 루트에 그대로 풀도록 했다(zip 안의 config/ 가 .mc_custom/config/ 로 배치). - PackDefinition.configPath 추가 + store 정규화/기본값 - 설치기 downloadConfigZip 헬퍼 + client:install 흐름 반영 - 편집기 필드, op 저장 파싱, 로케일 키(server/installer) - docs/installer.md 다운로드 단계 갱신, file/configs/ 폴더 생성 Co-Authored-By: Claude Opus 4.7 --- docs/installer.md | 2 +- file/configs/.gitkeep | 0 locales/installer/ko-kr.json | 2 ++ locales/server/ko-kr.json | 2 ++ package.json | 2 +- src/installer/main.ts | 17 +++++++++++++++++ src/server/routes/op.ts | 1 + src/shared/store.ts | 2 ++ src/shared/types.ts | 5 +++++ views/op/editor.ejs | 5 +++++ 10 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 file/configs/.gitkeep diff --git a/docs/installer.md b/docs/installer.md index 6c9c835..5099b20 100644 --- a/docs/installer.md +++ b/docs/installer.md @@ -80,7 +80,7 @@ - `vanilla` → 건너뜀. - `fabric` → fabric-installer(자바 필요) 를 돌리지 않고, fabric meta 에서 버전 프로필 JSON 을 직접 받아 `.minecraft\versions\fabric-loader-Y-X\fabric-loader-Y-X.json` 으로 저장한다(`https://meta.fabricmc.net/v2/versions/loader///profile/json`). 자바가 없어도 되므로 "spawn java ENOENT" 나 바닐라 선행 실행이 필요 없다. 라이브러리는 프로필 JSON 에 적힌 maven url 을 보고 런처가 실행 시 자동으로 받는다. (fabric 버전/라이브러리는 런처 폴더 `.minecraft` 에 있어야 런처가 찾으며, `.mc_custom` 에 두면 "Unable to prepare assets for download" 로 실패한다.) - `forge` / `neoforge` → `platform.downloadUrl` 의 설치 jar 다운로드(사용자가 직접 실행하거나 마인크래프트 런처가 인식). -4. `modsFolder` 의 모든 `.jar` 와 `resourcepackPath` zip, `mapPath` zip 을 자동 다운로드. +4. `modsFolder` 의 모든 `.jar` 와 `resourcepackPath` zip, `mapPath` zip, `configPath` zip 을 자동 다운로드. (`configPath` zip 은 `.mc_custom` 루트에 그대로 풀려 `config/` 등이 배치됨) 5. `.minecraft\{assets,libraries,versions}` 를 `.mc_custom\{assets,libraries,versions}` 로 junction 링크. (없으면 "Unable to prepare assets for download" 오류로 마인크래프트가 실패하기 때문) 6. `.minecraft\launcher_profiles.json` 에 해당 음악퀴즈 이름의 프로필을 추가/갱신: - `gameDir` = `%APPDATA%\.mc_custom` diff --git a/file/configs/.gitkeep b/file/configs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/locales/installer/ko-kr.json b/locales/installer/ko-kr.json index f839ba6..94f6e0f 100644 --- a/locales/installer/ko-kr.json +++ b/locales/installer/ko-kr.json @@ -233,8 +233,10 @@ "labelExtract": "{{label}} 압축 해제: {{dir}}", "labelServerFile": "서버 파일", "labelMap": "맵", + "labelConfigFile": "config 파일", "skipServerZip": "서버 파일(serverPath)이 비어 있어 서버 zip 다운로드를 건너뜁니다.", "skipMapZip": "맵 다운로드를 건너뜁니다 (mapPath 비어 있음 또는 참가자 모드).", + "skipConfigZip": "config 파일(configPath)이 비어 있어 config zip 다운로드를 건너뜁니다.", "cleanupInstallerMap": "이전 설치에서 풀어둔 맵 {{count}}개를 정리합니다.", "mapInstalledAs": "맵을 saves/{{name}} 으로 설치했습니다.", "clearMods": "기존 mods 폴더({{dir}})를 비우고 새로 받습니다.", diff --git a/locales/server/ko-kr.json b/locales/server/ko-kr.json index 3945384..c67f1fc 100644 --- a/locales/server/ko-kr.json +++ b/locales/server/ko-kr.json @@ -134,6 +134,8 @@ "jdkLtsSuffix": " (LTS)", "mapPath": "맵 파일 (.zip)", "mapPathHint": "/file/maps/ 아래 zip 파일 이름.", + "configPath": "config 파일 (.zip)", + "configPathHint": "/file/configs/ 아래 zip 파일 이름. 게임 폴더 루트에 그대로 풀립니다(보통 zip 안에 config/ 폴더).", "serverPath": "서버 파일 (.zip)", "serverPathHint": "/file/servers/ 아래 zip 파일 이름. 멀티 모드 전용.", "modsFolder": "모드 폴더 이름", diff --git a/package.json b/package.json index 339cc7e..454e0c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minecraft-music-quiz-installer", - "version": "0.4.26", + "version": "0.4.27", "description": "마인크래프트 음악퀴즈 간편설치기 + 관리 사이트", "main": "dist/installer/main.js", "scripts": { diff --git a/src/installer/main.ts b/src/installer/main.ts index f737301..ee61338 100644 --- a/src/installer/main.ts +++ b/src/installer/main.ts @@ -765,6 +765,20 @@ async function downloadServerZip(pack: PackDefinition, targetDir: string): Promi await downloadAndExtractZip(url, t('log.labelServerFile'), targetDir) } +/** + * config zip 을 게임 폴더(.mc_custom) 루트에 그대로 풀어 넣는다. + * zip 안에 `config/` 폴더가 들어 있으면 `.mc_custom/config/` 로 배치된다. + * configPath 가 비어 있으면 건너뛴다. + */ +async function downloadConfigZip(pack: PackDefinition, customRoot: string): Promise { + if (!pack.configPath) { + sendLog(t('log.skipConfigZip')) + return + } + const url = resolveManifestRelative(pack.configPath, 'configs') + await downloadAndExtractZip(url, t('log.labelConfigFile'), customRoot) +} + /** * 설치러가 saves/ 에 풀어놓은 최상위 폴더(또는 파일) 목록을 기록하는 마커 파일. * 재설치 시 잔여물을 안전하게 정리하고, 싱글→참가자 전환 시에도 @@ -1432,6 +1446,9 @@ ipcMain.handle('client:install', async (_event, payload: ClientInstallPayload) = await downloadMapZip(pack.pack, customRoot) } + // config zip 은 게임 폴더(.mc_custom) 루트에 그대로 풀어 config/ 등을 배치한다. + await downloadConfigZip(pack.pack, customRoot) + // 런처가 .mc_custom 을 gameDir 로 잡아도 assets/libraries/versions 를 // 찾을 수 있도록 .minecraft 의 해당 폴더로 junction 링크. await linkMinecraftRuntimeDirs(customRoot) diff --git a/src/server/routes/op.ts b/src/server/routes/op.ts index 2f6b79e..4517f9f 100644 --- a/src/server/routes/op.ts +++ b/src/server/routes/op.ts @@ -604,6 +604,7 @@ opRouter.post('/op/dashboard/:packName', requireAuth, async (req, res, next) => clientRecommendedRam: Number(pickFirstValue(req.body.clientRecommendedRam)), recommendedJdk: Number(pickFirstValue(req.body.recommendedJdk)), mapPath: pickFirstValue(req.body.mapPath), + configPath: pickFirstValue(req.body.configPath), serverPath: pickFirstValue(req.body.serverPath) } diff --git a/src/shared/store.ts b/src/shared/store.ts index b92537b..7d856cf 100644 --- a/src/shared/store.ts +++ b/src/shared/store.ts @@ -55,6 +55,7 @@ export function defaultPackDefinition(name: string): PackDefinition { clientRecommendedRam: 4096, recommendedJdk: DEFAULT_JDK_MAJOR, mapPath: '', + configPath: '', serverPath: '' } } @@ -142,6 +143,7 @@ export function normalizePackDefinition(input: Partial & Record< clientRecommendedRam: clampNumber(input.clientRecommendedRam, fallback.clientRecommendedRam), recommendedJdk: normalizeRecommendedJdk(input.recommendedJdk), mapPath: sanitizeZipFileName(input.mapPath), + configPath: sanitizeZipFileName(input.configPath), serverPath: sanitizeZipFileName(input.serverPath) } } diff --git a/src/shared/types.ts b/src/shared/types.ts index d0d6726..ef8ce92 100644 --- a/src/shared/types.ts +++ b/src/shared/types.ts @@ -41,6 +41,11 @@ export interface PackDefinition { recommendedJdk: number /** /file/maps/ 에서 받아 .mc_custom/saves 로 풀 zip 파일 이름. */ mapPath: string + /** + * /file/configs/ 에서 받아 게임 폴더(.mc_custom) 루트에 그대로 푸는 zip + * 파일 이름. 보통 zip 안에 `config/` 폴더를 담는다. 빈 문자열이면 받지 않는다. + */ + configPath: string /** /file/servers/ 에서 받아 서버 설치 경로로 풀 zip 파일 이름. */ serverPath: string } diff --git a/views/op/editor.ejs b/views/op/editor.ejs index ebc7622..99d78c4 100644 --- a/views/op/editor.ejs +++ b/views/op/editor.ejs @@ -96,6 +96,11 @@ <%= t('editor.mapPathHint') %> +