apply smart dlc

This commit is contained in:
tresabhi committed 2026-10-25 12:27:57 -05:00
1 parent 9236c54b4b
commit 41fb822571
6 files changed
+19 -21

No files matched your search

+5 -1
View File
@@ -128,9 +128,13 @@ jobs:
- name: Install dependencies
run: bun install
- name: Download Client
- name: Download client
run: bun run download-client
- name: Download SmartDLC
if: ${{ inputs.client_provider == 'steam' }}
run: bun run download-smart-dlc
- name: Build
run: bun run --bun build
env:
+1
View File
@@ -10,6 +10,7 @@
"build-protos": "cd packages/scripts && bun run build-protos",
"record-performance": "cd packages/scripts && bun run record-performance",
"download-client": "cd packages/scripts && bun run download-client",
"download-smart-dlc": "cd packages/scripts && bun run download-smart-dlc",
"clean-astro": "rm -rf packages/website/.astro packages/website/node_modules/.astro packages/website/node_modules/.vite",
"vfs": "cd packages/scripts && bun run vfs"
},
+1
View File
@@ -6,6 +6,7 @@
"build-protos": "bun src/protos.ts",
"record-performance": "bun src/recordPerformance/index.ts",
"download-client": "bun src/downloadClient/index.ts",
"download-smart-dlc": "bun src/downloadSmartDLC/index.ts",
"vfs": "bun src/vfs/index.ts"
},
"dependencies": {
@@ -2,9 +2,10 @@ import { dvp } from "@blitzkit/closed";
import { assertSecret } from "@blitzkit/core";
import { mkdir, writeFile } from "fs/promises";
import { parse as parsePath } from "path";
import ProgressBar from "progress";
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
import { PATCHES_ROOT, vfs } from "./buildAssets/constants";
import { vfs } from "../vfs/vfs";
const CLIENT_DIR = assertSecret(import.meta.env.CLIENT_DIR);
const versionTextFile = await vfs.text(`Data/version.txt`);
const currentVersion = versionTextFile
@@ -40,27 +41,17 @@ while (true) {
)}`,
).then((response) => response.arrayBuffer());
const files = await dvp(dvpm, dvpd);
const bar = new ProgressBar(
`Patching ${files.length} files :bar`,
files.length,
);
for (const { path, data } of files) {
console.log(`Patching "${path}"...`);
const { dir } = parsePath(path);
try {
await mkdir(`${PATCHES_ROOT}/Data/${dir}`, { recursive: true });
} catch (error) {
console.warn(`Failed to make directory "${dir}"`);
}
await mkdir(`${CLIENT_DIR}/Data/${dir}`, { recursive: true });
const buffer = Buffer.from(data);
await writeFile(`${PATCHES_ROOT}/Data/${path}`, new Uint8Array(buffer));
bar.tick();
await writeFile(`${CLIENT_DIR}/Data/${path}`, new Uint8Array(buffer));
}
console.log("patches done for patch");
@@ -86,10 +77,10 @@ while (true) {
const patchedContent = stringifyYaml(patchedStrings);
console.log("stringified");
await mkdir(`${PATCHES_ROOT}/Data/Strings`, { recursive: true });
await mkdir(`${CLIENT_DIR}/Data/Strings`, { recursive: true });
console.log("mkdir");
await writeFile(
`${PATCHES_ROOT}/Data/Strings/en.yaml`,
`${CLIENT_DIR}/Data/Strings/en.yaml`,
new Uint8Array(Buffer.from(patchedContent)),
);
console.log("file");
+1 -4
View File
@@ -1,7 +1,4 @@
import { assertSecret } from "@blitzkit/core";
import { LocalVFS } from "@blitzkit/core/src/blitzkit/vfs/local";
export const vfs = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR));
import { vfs } from "./vfs";
const command = Bun.argv[2];
const path = Bun.argv[3];
+4
View File
@@ -0,0 +1,4 @@
import { assertSecret } from "@blitzkit/core";
import { LocalVFS } from "@blitzkit/core/src/blitzkit/vfs/local";
export const vfs = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR));