Compare commits

...
7 Commits
Author SHA1 Message Date
TrèsAbhi 05572918b1 exit 2026-06-23 10:35:27 -05:00
TrèsAbhi 1cc8b26b16 dispose 2026-06-23 10:30:56 -05:00
TrèsAbhi a8e8d20cf1 break 2026-06-23 10:26:05 -05:00
TrèsAbhi 55deb30607 logs 2026-06-23 10:20:22 -05:00
TrèsAbhi 03b8b89a17 log 2026-06-23 10:14:37 -05:00
TrèsAbhi 3e421c7eb7 done 2026-06-23 10:11:18 -05:00
TrèsAbhi fc27caabdc dvpl 2026-06-23 10:07:54 -05:00
+24 -7
View File
@@ -24,7 +24,10 @@ while (true) {
)}/dlc/s${currentVersion}_${patchIndex}.yaml`,
);
if (response.status === 200) {
console.log(patchIndex, response.status)
if (!response.ok) break;
console.log(`Applying patch ${patchIndex}...`);
const data = parseYaml(await response.text());
@@ -54,36 +57,50 @@ while (true) {
console.warn(`Failed to make directory "${dir}"`);
}
const isDvpl = path.endsWith(".dvpl");
const buffer = Buffer.from(data);
await writeFile(
`${PATCHES_ROOT}/Data/${path}${isDvpl ? "" : ".dvpl"}`,
new Uint8Array(isDvpl ? buffer : writeDVPL(buffer)),
`${PATCHES_ROOT}/Data/${path}`,
new Uint8Array(buffer),
);
bar.tick();
}
console.log('patches done for patch')
if ("dynamicContentLocalizationsDir" in data) {
console.log(
`${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${
data.dynamicContentLocalizationsDir
}/en.yaml`,
);
const localizationsResponse = await fetch(
`${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${
data.dynamicContentLocalizationsDir
}/en.yaml`,
);
console.log('fetched')
const newStrings = parseYaml(await localizationsResponse.text());
console.log('got new strings')
const oldStrings =
await vfs.yaml<Record<string, string>>(`Data/Strings/en.yaml`);
console.log('got old strings')
const patchedStrings = { ...oldStrings, ...newStrings };
const patchedContent = stringifyYaml(patchedStrings);
console.log('stringified')
await mkdir(`${PATCHES_ROOT}/Data/Strings`, { recursive: true });
console.log('mkdir')
await writeFile(
`${PATCHES_ROOT}/Data/Strings/en.yaml.dvpl`,
new Uint8Array(writeDVPL(Buffer.from(patchedContent))),
`${PATCHES_ROOT}/Data/Strings/en.yaml`,
new Uint8Array((Buffer.from(patchedContent))),
);
console.log('file')
}
patchIndex++;
} else break;
}
vfs.dispose()
process.exit(0);