mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-28 21:19:52 +01:00
Compare commits
7
Commits
3d35fae5ce
...
05572918b1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05572918b1 | ||
|
|
1cc8b26b16 | ||
|
|
a8e8d20cf1 | ||
|
|
55deb30607 | ||
|
|
03b8b89a17 | ||
|
|
3e421c7eb7 | ||
|
|
fc27caabdc |
@@ -24,7 +24,10 @@ while (true) {
|
|||||||
)}/dlc/s${currentVersion}_${patchIndex}.yaml`,
|
)}/dlc/s${currentVersion}_${patchIndex}.yaml`,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.status === 200) {
|
console.log(patchIndex, response.status)
|
||||||
|
|
||||||
|
if (!response.ok) break;
|
||||||
|
|
||||||
console.log(`Applying patch ${patchIndex}...`);
|
console.log(`Applying patch ${patchIndex}...`);
|
||||||
|
|
||||||
const data = parseYaml(await response.text());
|
const data = parseYaml(await response.text());
|
||||||
@@ -54,36 +57,50 @@ while (true) {
|
|||||||
console.warn(`Failed to make directory "${dir}"`);
|
console.warn(`Failed to make directory "${dir}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const isDvpl = path.endsWith(".dvpl");
|
|
||||||
const buffer = Buffer.from(data);
|
const buffer = Buffer.from(data);
|
||||||
|
|
||||||
await writeFile(
|
await writeFile(
|
||||||
`${PATCHES_ROOT}/Data/${path}${isDvpl ? "" : ".dvpl"}`,
|
`${PATCHES_ROOT}/Data/${path}`,
|
||||||
new Uint8Array(isDvpl ? buffer : writeDVPL(buffer)),
|
new Uint8Array(buffer),
|
||||||
);
|
);
|
||||||
|
|
||||||
bar.tick();
|
bar.tick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('patches done for patch')
|
||||||
|
|
||||||
if ("dynamicContentLocalizationsDir" in data) {
|
if ("dynamicContentLocalizationsDir" in data) {
|
||||||
|
console.log(
|
||||||
|
`${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${
|
||||||
|
data.dynamicContentLocalizationsDir
|
||||||
|
}/en.yaml`,
|
||||||
|
);
|
||||||
const localizationsResponse = await fetch(
|
const localizationsResponse = await fetch(
|
||||||
`${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${
|
`${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${
|
||||||
data.dynamicContentLocalizationsDir
|
data.dynamicContentLocalizationsDir
|
||||||
}/en.yaml`,
|
}/en.yaml`,
|
||||||
);
|
);
|
||||||
|
console.log('fetched')
|
||||||
const newStrings = parseYaml(await localizationsResponse.text());
|
const newStrings = parseYaml(await localizationsResponse.text());
|
||||||
|
console.log('got new strings')
|
||||||
const oldStrings =
|
const oldStrings =
|
||||||
await vfs.yaml<Record<string, string>>(`Data/Strings/en.yaml`);
|
await vfs.yaml<Record<string, string>>(`Data/Strings/en.yaml`);
|
||||||
|
console.log('got old strings')
|
||||||
const patchedStrings = { ...oldStrings, ...newStrings };
|
const patchedStrings = { ...oldStrings, ...newStrings };
|
||||||
const patchedContent = stringifyYaml(patchedStrings);
|
const patchedContent = stringifyYaml(patchedStrings);
|
||||||
|
console.log('stringified')
|
||||||
|
|
||||||
await mkdir(`${PATCHES_ROOT}/Data/Strings`, { recursive: true });
|
await mkdir(`${PATCHES_ROOT}/Data/Strings`, { recursive: true });
|
||||||
|
console.log('mkdir')
|
||||||
await writeFile(
|
await writeFile(
|
||||||
`${PATCHES_ROOT}/Data/Strings/en.yaml.dvpl`,
|
`${PATCHES_ROOT}/Data/Strings/en.yaml`,
|
||||||
new Uint8Array(writeDVPL(Buffer.from(patchedContent))),
|
new Uint8Array((Buffer.from(patchedContent))),
|
||||||
);
|
);
|
||||||
|
console.log('file')
|
||||||
}
|
}
|
||||||
|
|
||||||
patchIndex++;
|
patchIndex++;
|
||||||
} else break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vfs.dispose()
|
||||||
|
process.exit(0);
|
||||||
Reference in new issue
Block a user