mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-26 03:59:53 +01:00
Compare commits
23
Commits
e2e9cedefe
...
435c37adc6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
435c37adc6 | ||
|
|
8f67ca7691 | ||
|
|
05572918b1 | ||
|
|
1cc8b26b16 | ||
|
|
a8e8d20cf1 | ||
|
|
55deb30607 | ||
|
|
03b8b89a17 | ||
|
|
3e421c7eb7 | ||
|
|
fc27caabdc | ||
|
|
3d35fae5ce | ||
|
|
f6dfc4f176 | ||
|
|
fdbbe2f356 | ||
|
|
cdf2aee43f | ||
|
|
56933ddfac | ||
|
|
1df2e818be | ||
|
|
1e4d00ea34 | ||
|
|
1bde50e0a3 | ||
|
|
88290ec1ab | ||
|
|
e8325df832 | ||
|
|
394f28e6ed | ||
|
|
f5f170bcca | ||
|
|
2ffe3fc006 | ||
|
|
406d70b5b7 |
No files matched your search
@@ -73,10 +73,14 @@ jobs:
|
||||
with:
|
||||
repo-token: ${{ secrets.GH_TOKEN }}
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
|
||||
- run: bun run setup
|
||||
|
||||
- name: AppArmor hack
|
||||
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
|
||||
run: bun run build:assets --all-targets --source=${{ github.event.inputs.asset_source || 'steam:444200/444202' }}
|
||||
@@ -6,6 +6,7 @@
|
||||
"name": "blitzkit",
|
||||
"dependencies": {
|
||||
"@prisma/client": "^6.18.0",
|
||||
"lz4js": "^0.2.0",
|
||||
"prisma": "^6.18.0",
|
||||
"sharp": "^0.34.5",
|
||||
"typescript": "^5.9.3",
|
||||
@@ -78,7 +79,6 @@
|
||||
"dotenv": "^17.2.2",
|
||||
"fast-xml-parser": "^5.3.2",
|
||||
"lodash-es": "^4.17.21",
|
||||
"lz4js": "^0.2.0",
|
||||
"pickleparser": "^0.2.1",
|
||||
"protobufjs": "^7.5.4",
|
||||
"three": "^0.180.0",
|
||||
@@ -118,7 +118,6 @@
|
||||
"fast-xml-parser": "^5.2.5",
|
||||
"googleapis": "^162.0.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"lz4js": "^0.2.0",
|
||||
"progress": "^2.0.3",
|
||||
"puppeteer": "^24.22.3",
|
||||
"sharp": "^0.34.4",
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# BlitzKit 1.30.3
|
||||
|
||||
## Fixes
|
||||
|
||||
- BlitzKit now correctly implements minor WoTB updates
|
||||
+4
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "blitzkit",
|
||||
"version": "1.30.3",
|
||||
"version": "1.30.4",
|
||||
"license": "BlitzKit License",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@@ -21,7 +21,7 @@
|
||||
"dev": "bun run dev:website",
|
||||
"dev:api": "bun --filter=@blitzkit/api run dev",
|
||||
"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",
|
||||
"host:docs": "vitepress preview docs",
|
||||
"lint": "tsc",
|
||||
@@ -35,7 +35,7 @@
|
||||
"build:reviews": "cd packages/scripts && bun build:reviews",
|
||||
"build:ids": "cd packages/scripts && bun build:ids",
|
||||
"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"
|
||||
},
|
||||
"type": "module",
|
||||
@@ -44,6 +44,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@prisma/client": "^6.18.0",
|
||||
"lz4js": "^0.2.0",
|
||||
"prisma": "^6.18.0",
|
||||
"sharp": "^0.34.5",
|
||||
"typescript": "^5.9.3"
|
||||
|
||||
+1
-1
Submodule packages/closed updated: 5b4a85d503...f89f0e0772.
@@ -19,7 +19,6 @@
|
||||
"dotenv": "^17.2.2",
|
||||
"fast-xml-parser": "^5.3.2",
|
||||
"lodash-es": "^4.17.21",
|
||||
"lz4js": "^0.2.0",
|
||||
"pickleparser": "^0.2.1",
|
||||
"protobufjs": "^7.5.4",
|
||||
"three": "^0.180.0",
|
||||
|
||||
@@ -876,7 +876,7 @@
|
||||
"yaw": "Yaw",
|
||||
"pitch": "Pitch",
|
||||
"min": "Min",
|
||||
"max": "Max"
|
||||
"max": "Макс"
|
||||
}
|
||||
},
|
||||
"sandbox": {
|
||||
@@ -908,7 +908,7 @@
|
||||
"normalization": "Нормалізація",
|
||||
"ricochet": "Рикошет",
|
||||
"explosion_radius": "Радіус розльоту уламків",
|
||||
"exit": "Exit",
|
||||
"exit": "Вийти",
|
||||
"reset": "Reset"
|
||||
},
|
||||
"advanced": "Advanced highlighting",
|
||||
@@ -919,13 +919,13 @@
|
||||
"external": "External",
|
||||
"gap": "Gap",
|
||||
"gun": "Gun",
|
||||
"track": "Tracks"
|
||||
"track": "Гусениці"
|
||||
},
|
||||
"status": {
|
||||
"penetration": "{damage}hp penetration",
|
||||
"blocked": "Blocked",
|
||||
"blocked": "Заблоковано",
|
||||
"ricochet": "Рикошет",
|
||||
"splash": "{damage}hp splash"
|
||||
"splash": "{damage} Од"
|
||||
},
|
||||
"stats": {
|
||||
"thickness_and_angle": "{thickness}mm {angle}°",
|
||||
@@ -1048,7 +1048,7 @@
|
||||
"caliber": "Калібр",
|
||||
"penetration": "Бронепробиття",
|
||||
"damage": "Шкода",
|
||||
"damageWithoutAssault": "Damage without assault shells",
|
||||
"damageWithoutAssault": "Шкода без урахування золотих снарядів",
|
||||
"clipDamage": "Clipping potential",
|
||||
"moduleDamage": "Шкода по модулях",
|
||||
"explosionRadius": "Радіус розльоту уламків",
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
"fast-xml-parser": "^5.2.5",
|
||||
"googleapis": "^162.0.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"lz4js": "^0.2.0",
|
||||
"progress": "^2.0.3",
|
||||
"puppeteer": "^24.22.3",
|
||||
"sharp": "^0.34.4",
|
||||
|
||||
@@ -4,7 +4,7 @@ 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 { vfs } from "./buildAssets/constants";
|
||||
import { PATCHES_ROOT, vfs } from "./buildAssets/constants";
|
||||
import { writeDVPL } from "./core/blitz/writeDVPL";
|
||||
|
||||
const versionTextFile = await vfs.text(`Data/version.txt`);
|
||||
@@ -20,27 +20,30 @@ let patchIndex = 1;
|
||||
while (true) {
|
||||
const response = await fetch(
|
||||
`${assertSecret(
|
||||
import.meta.env.WOTB_DLC_CDN
|
||||
)}/dlc/s${currentVersion}_${patchIndex}.yaml`
|
||||
import.meta.env.WOTB_DLC_CDN,
|
||||
)}/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());
|
||||
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());
|
||||
const dvpd = await fetch(
|
||||
`${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${data.dx11.replace(
|
||||
".dvpm",
|
||||
".dvpd"
|
||||
)}`
|
||||
".dvpd",
|
||||
)}`,
|
||||
).then((response) => response.arrayBuffer());
|
||||
const files = await dvp(dvpm, dvpd);
|
||||
const bar = new ProgressBar(
|
||||
`Patching ${files.length} files :bar`,
|
||||
files.length
|
||||
files.length,
|
||||
);
|
||||
|
||||
for (const { path, data } of files) {
|
||||
@@ -49,43 +52,55 @@ while (true) {
|
||||
const { dir } = parsePath(path);
|
||||
|
||||
try {
|
||||
await mkdir(`Data/${dir}`, { recursive: true });
|
||||
await mkdir(`${PATCHES_ROOT}/Data/${dir}`, { recursive: true });
|
||||
} catch (error) {
|
||||
console.warn(`Failed to make directory "${dir}"`);
|
||||
}
|
||||
|
||||
const isDvpl = path.endsWith(".dvpl");
|
||||
const buffer = Buffer.from(data);
|
||||
|
||||
await writeFile(
|
||||
`Data/${path}${isDvpl ? "" : ".dvpl"}`,
|
||||
new Uint8Array(isDvpl ? buffer : writeDVPL(buffer))
|
||||
`${PATCHES_ROOT}/Data/${path}`,
|
||||
new Uint8Array(buffer),
|
||||
);
|
||||
|
||||
bar.tick();
|
||||
}
|
||||
|
||||
if ("dynamicContentLocalizationsDir" in data) {
|
||||
console.log("Found dynamic content localizations; patching...");
|
||||
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`
|
||||
}/en.yaml`,
|
||||
);
|
||||
console.log('fetched')
|
||||
const newStrings = parseYaml(await localizationsResponse.text());
|
||||
const oldStrings = await vfs.yaml<Record<string, string>>(
|
||||
`Data/Strings/en.yaml`
|
||||
);
|
||||
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(
|
||||
`Data/Strings/en.yaml`,
|
||||
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);
|
||||
@@ -3,6 +3,9 @@ import { AbstractVFS } from "../core/vfs/abstract";
|
||||
import { LocalVFS } from "../core/vfs/local";
|
||||
import { SteamVFS } from "../core/vfs/steam";
|
||||
import { ZipVFS } from "../core/vfs/zip";
|
||||
import { MixedVFS } from "../core/vfs/mixed";
|
||||
|
||||
export const PATCHES_ROOT = "../../temp/patches";
|
||||
|
||||
const steamPattern = /steam:(\d+)\/(\d+)/;
|
||||
const zipPattern = /zip:(.+)/;
|
||||
@@ -35,4 +38,6 @@ if (!source) {
|
||||
throw new Error("No valid source specified");
|
||||
}
|
||||
|
||||
resolved = new MixedVFS([new LocalVFS(PATCHES_ROOT), resolved]);
|
||||
|
||||
export const vfs = resolved;
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user