feat: config 파일(.zip) 입력/다운로드 지원 (v0.4.27)
관리자 편집기에서 맵 파일과 서버 파일 사이에 "config 파일 (.zip)" 필드를 추가하고, 간편설치기가 /file/configs/<name> 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 <noreply@anthropic.com>
This commit is contained in:
@@ -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<void> {
|
||||
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)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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<PackDefinition> & Record<
|
||||
clientRecommendedRam: clampNumber(input.clientRecommendedRam, fallback.clientRecommendedRam),
|
||||
recommendedJdk: normalizeRecommendedJdk(input.recommendedJdk),
|
||||
mapPath: sanitizeZipFileName(input.mapPath),
|
||||
configPath: sanitizeZipFileName(input.configPath),
|
||||
serverPath: sanitizeZipFileName(input.serverPath)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,11 @@ export interface PackDefinition {
|
||||
recommendedJdk: number
|
||||
/** /file/maps/<mapPath> 에서 받아 .mc_custom/saves 로 풀 zip 파일 이름. */
|
||||
mapPath: string
|
||||
/**
|
||||
* /file/configs/<configPath> 에서 받아 게임 폴더(.mc_custom) 루트에 그대로 푸는 zip
|
||||
* 파일 이름. 보통 zip 안에 `config/` 폴더를 담는다. 빈 문자열이면 받지 않는다.
|
||||
*/
|
||||
configPath: string
|
||||
/** /file/servers/<serverPath> 에서 받아 서버 설치 경로로 풀 zip 파일 이름. */
|
||||
serverPath: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user