Compare commits

...
13 Commits
Author SHA1 Message Date
tresabhi 3d35fae5ce dont log 2026-06-22 20:52:51 -05:00
tresabhi f6dfc4f176 what 2026-06-22 20:32:14 -05:00
tresabhi fdbbe2f356 Update applyPatches.ts 2026-06-22 20:18:25 -05:00
tresabhi cdf2aee43f debug 2026-06-22 20:13:52 -05:00
tresabhi 56933ddfac debug 2026-06-22 20:07:55 -05:00
tresabhi 1df2e818be dirs 2026-06-22 19:57:41 -05:00
tresabhi 1e4d00ea34 source 2026-06-22 19:55:39 -05:00
tresabhi 1bde50e0a3 garbage code 2026-06-22 19:54:09 -05:00
tresabhi 88290ec1ab garbage code 2026-06-22 19:54:01 -05:00
tresabhi e8325df832 lz4js 2026-06-22 19:44:03 -05:00
tresabhi 394f28e6ed remove proxyclient 2026-06-22 19:33:52 -05:00
tresabhi f5f170bcca switch to clean dava 2026-06-22 19:32:26 -05:00
tresabhi 2ffe3fc006 set up patches 2026-06-22 19:28:02 -05:00
10 changed files with 85 additions and 26 deletions

No files matched your search

+4
View File
@@ -73,10 +73,14 @@ jobs:
with: with:
repo-token: ${{ secrets.GH_TOKEN }} repo-token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v2 - uses: oven-sh/setup-bun@v2
- run: bun run setup - run: bun run setup
- name: AppArmor hack - name: AppArmor hack
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- name: Install patches
run: bun run setup:patches --source=${{ github.event.inputs.asset_source || 'steam:444200/444202' }}
- name: Build assets - name: Build assets
run: bun run build:assets --all-targets --source=${{ github.event.inputs.asset_source || 'steam:444200/444202' }} run: bun run build:assets --all-targets --source=${{ github.event.inputs.asset_source || 'steam:444200/444202' }}
+1 -2
View File
@@ -6,6 +6,7 @@
"name": "blitzkit", "name": "blitzkit",
"dependencies": { "dependencies": {
"@prisma/client": "^6.18.0", "@prisma/client": "^6.18.0",
"lz4js": "^0.2.0",
"prisma": "^6.18.0", "prisma": "^6.18.0",
"sharp": "^0.34.5", "sharp": "^0.34.5",
"typescript": "^5.9.3", "typescript": "^5.9.3",
@@ -78,7 +79,6 @@
"dotenv": "^17.2.2", "dotenv": "^17.2.2",
"fast-xml-parser": "^5.3.2", "fast-xml-parser": "^5.3.2",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"lz4js": "^0.2.0",
"pickleparser": "^0.2.1", "pickleparser": "^0.2.1",
"protobufjs": "^7.5.4", "protobufjs": "^7.5.4",
"three": "^0.180.0", "three": "^0.180.0",
@@ -118,7 +118,6 @@
"fast-xml-parser": "^5.2.5", "fast-xml-parser": "^5.2.5",
"googleapis": "^162.0.0", "googleapis": "^162.0.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"lz4js": "^0.2.0",
"progress": "^2.0.3", "progress": "^2.0.3",
"puppeteer": "^24.22.3", "puppeteer": "^24.22.3",
"sharp": "^0.34.4", "sharp": "^0.34.4",
+5
View File
@@ -0,0 +1,5 @@
# BlitzKit 1.30.3
## Fixes
- BlitzKit now correctly implements minor WoTB updates
+4 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "blitzkit", "name": "blitzkit",
"version": "1.30.3", "version": "1.30.4",
"license": "BlitzKit License", "license": "BlitzKit License",
"private": true, "private": true,
"scripts": { "scripts": {
@@ -21,7 +21,7 @@
"dev": "bun run dev:website", "dev": "bun run dev:website",
"dev:api": "bun --filter=@blitzkit/api run dev", "dev:api": "bun --filter=@blitzkit/api run dev",
"setup:depotdownloader": "bun --filter=@blitzkit/scripts run setup:depotdownloader", "setup:depotdownloader": "bun --filter=@blitzkit/scripts run setup:depotdownloader",
"setup:patches": "bun --filter=@blitzkit/scripts run setup:patches", "setup:patches": "mkdir -p packages/closed/node_modules && ln -sf ../../../node_modules/lz4js packages/closed/node_modules/lz4js && cd packages/scripts && bun run setup:patches",
"start:website": "bun --filter=@blitzkit/website run start", "start:website": "bun --filter=@blitzkit/website run start",
"host:docs": "vitepress preview docs", "host:docs": "vitepress preview docs",
"lint": "tsc", "lint": "tsc",
@@ -35,7 +35,7 @@
"build:reviews": "cd packages/scripts && bun build:reviews", "build:reviews": "cd packages/scripts && bun build:reviews",
"build:ids": "cd packages/scripts && bun build:ids", "build:ids": "cd packages/scripts && bun build:ids",
"prunestrings": "cd packages/scripts && bun prunestrings", "prunestrings": "cd packages/scripts && bun prunestrings",
"setup": "bun install && bun run build:prisma && bun run build:proxyclient", "setup": "bun install && bun run build:prisma",
"patchnotes": "cd packages/scripts && bun run patchnotes" "patchnotes": "cd packages/scripts && bun run patchnotes"
}, },
"type": "module", "type": "module",
@@ -44,6 +44,7 @@
], ],
"dependencies": { "dependencies": {
"@prisma/client": "^6.18.0", "@prisma/client": "^6.18.0",
"lz4js": "^0.2.0",
"prisma": "^6.18.0", "prisma": "^6.18.0",
"sharp": "^0.34.5", "sharp": "^0.34.5",
"typescript": "^5.9.3" "typescript": "^5.9.3"
-1
View File
@@ -19,7 +19,6 @@
"dotenv": "^17.2.2", "dotenv": "^17.2.2",
"fast-xml-parser": "^5.3.2", "fast-xml-parser": "^5.3.2",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"lz4js": "^0.2.0",
"pickleparser": "^0.2.1", "pickleparser": "^0.2.1",
"protobufjs": "^7.5.4", "protobufjs": "^7.5.4",
"three": "^0.180.0", "three": "^0.180.0",
-1
View File
@@ -24,7 +24,6 @@
"fast-xml-parser": "^5.2.5", "fast-xml-parser": "^5.2.5",
"googleapis": "^162.0.0", "googleapis": "^162.0.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"lz4js": "^0.2.0",
"progress": "^2.0.3", "progress": "^2.0.3",
"puppeteer": "^24.22.3", "puppeteer": "^24.22.3",
"sharp": "^0.34.4", "sharp": "^0.34.4",
+16 -18
View File
@@ -4,7 +4,7 @@ import { mkdir, writeFile } from "fs/promises";
import { parse as parsePath } from "path"; import { parse as parsePath } from "path";
import ProgressBar from "progress"; import ProgressBar from "progress";
import { parse as parseYaml, stringify as stringifyYaml } from "yaml"; import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
import { vfs } from "./buildAssets/constants"; import { PATCHES_ROOT, vfs } from "./buildAssets/constants";
import { writeDVPL } from "./core/blitz/writeDVPL"; import { writeDVPL } from "./core/blitz/writeDVPL";
const versionTextFile = await vfs.text(`Data/version.txt`); const versionTextFile = await vfs.text(`Data/version.txt`);
@@ -20,8 +20,8 @@ let patchIndex = 1;
while (true) { while (true) {
const response = await fetch( const response = await fetch(
`${assertSecret( `${assertSecret(
import.meta.env.WOTB_DLC_CDN import.meta.env.WOTB_DLC_CDN,
)}/dlc/s${currentVersion}_${patchIndex}.yaml` )}/dlc/s${currentVersion}_${patchIndex}.yaml`,
); );
if (response.status === 200) { if (response.status === 200) {
@@ -29,18 +29,18 @@ while (true) {
const data = parseYaml(await response.text()); const data = parseYaml(await response.text());
const dvpm = await fetch( const dvpm = await fetch(
`${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${data.dx11}` `${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${data.dx11}`,
).then((response) => response.arrayBuffer()); ).then((response) => response.arrayBuffer());
const dvpd = await fetch( const dvpd = await fetch(
`${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${data.dx11.replace( `${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${data.dx11.replace(
".dvpm", ".dvpm",
".dvpd" ".dvpd",
)}` )}`,
).then((response) => response.arrayBuffer()); ).then((response) => response.arrayBuffer());
const files = await dvp(dvpm, dvpd); const files = await dvp(dvpm, dvpd);
const bar = new ProgressBar( const bar = new ProgressBar(
`Patching ${files.length} files :bar`, `Patching ${files.length} files :bar`,
files.length files.length,
); );
for (const { path, data } of files) { for (const { path, data } of files) {
@@ -49,7 +49,7 @@ while (true) {
const { dir } = parsePath(path); const { dir } = parsePath(path);
try { try {
await mkdir(`Data/${dir}`, { recursive: true }); await mkdir(`${PATCHES_ROOT}/Data/${dir}`, { recursive: true });
} catch (error) { } catch (error) {
console.warn(`Failed to make directory "${dir}"`); console.warn(`Failed to make directory "${dir}"`);
} }
@@ -58,31 +58,29 @@ while (true) {
const buffer = Buffer.from(data); const buffer = Buffer.from(data);
await writeFile( await writeFile(
`Data/${path}${isDvpl ? "" : ".dvpl"}`, `${PATCHES_ROOT}/Data/${path}${isDvpl ? "" : ".dvpl"}`,
new Uint8Array(isDvpl ? buffer : writeDVPL(buffer)) new Uint8Array(isDvpl ? buffer : writeDVPL(buffer)),
); );
bar.tick(); bar.tick();
} }
if ("dynamicContentLocalizationsDir" in data) { if ("dynamicContentLocalizationsDir" in data) {
console.log("Found dynamic content localizations; patching...");
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`,
); );
const newStrings = parseYaml(await localizationsResponse.text()); const newStrings = parseYaml(await localizationsResponse.text());
const oldStrings = await vfs.yaml<Record<string, string>>( const oldStrings =
`Data/Strings/en.yaml` await vfs.yaml<Record<string, string>>(`Data/Strings/en.yaml`);
);
const patchedStrings = { ...oldStrings, ...newStrings }; const patchedStrings = { ...oldStrings, ...newStrings };
const patchedContent = stringifyYaml(patchedStrings); const patchedContent = stringifyYaml(patchedStrings);
await mkdir(`${PATCHES_ROOT}/Data/Strings`, { recursive: true });
await writeFile( await writeFile(
`Data/Strings/en.yaml`, `${PATCHES_ROOT}/Data/Strings/en.yaml.dvpl`,
new Uint8Array(writeDVPL(Buffer.from(patchedContent))) new Uint8Array(writeDVPL(Buffer.from(patchedContent))),
); );
} }
@@ -3,6 +3,9 @@ import { AbstractVFS } from "../core/vfs/abstract";
import { LocalVFS } from "../core/vfs/local"; import { LocalVFS } from "../core/vfs/local";
import { SteamVFS } from "../core/vfs/steam"; import { SteamVFS } from "../core/vfs/steam";
import { ZipVFS } from "../core/vfs/zip"; import { ZipVFS } from "../core/vfs/zip";
import { MixedVFS } from "../core/vfs/mixed";
export const PATCHES_ROOT = "../../temp/patches";
const steamPattern = /steam:(\d+)\/(\d+)/; const steamPattern = /steam:(\d+)\/(\d+)/;
const zipPattern = /zip:(.+)/; const zipPattern = /zip:(.+)/;
@@ -35,4 +38,6 @@ if (!source) {
throw new Error("No valid source specified"); throw new Error("No valid source specified");
} }
resolved = new MixedVFS([new LocalVFS(PATCHES_ROOT), resolved]);
export const vfs = resolved; export const vfs = resolved;
+49
View File
@@ -0,0 +1,49 @@
import { AbstractVFS } from "./abstract";
export class MixedVFS extends AbstractVFS {
constructor(private vfses: AbstractVFS[]) {
super();
}
async init() {
for (const vfs of this.vfses) {
await vfs.init();
}
return this;
}
dispose() {
for (const vfs of this.vfses) {
vfs.dispose();
}
}
async has(path: string) {
for (const vfs of this.vfses) {
if (await vfs.has(path)) return true;
}
return false;
}
async raw(path: string) {
for (const vfs of this.vfses) {
if (await vfs.has(path)) return await vfs.raw(path);
}
throw new Error(`File not found: ${path}`);
}
async dir(path: string) {
const files = new Set<string>();
for (const vfs of this.vfses) {
for (const file of await vfs.dir(path)) {
files.add(file);
}
}
return Array.from(files);
}
}