From 035e0349959fb0b88cccf79a0a453cd0596a9984 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sat, 14 Nov 2026 11:10:41 -0600 Subject: [PATCH 1/6] make cooldown optional --- .../core/src/blitzkit/api/server/6_consumableDefinitions.ts | 2 +- packages/core/src/types/consumablesCommon.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/blitzkit/api/server/6_consumableDefinitions.ts b/packages/core/src/blitzkit/api/server/6_consumableDefinitions.ts index d12b7612d..d77947276 100644 --- a/packages/core/src/blitzkit/api/server/6_consumableDefinitions.ts +++ b/packages/core/src/blitzkit/api/server/6_consumableDefinitions.ts @@ -15,7 +15,7 @@ export abstract class ServerBlitzKitAPI6 extends ServerBlitzKitAPI5 { const entry: Consumable = { id: consumable.id, game_mode_exclusive: "gameModeFilter" in consumable, - cooldown: consumable.script.cooldown, + cooldown: consumable.script.cooldown ?? 0, duration: consumable.script.duration, name: this.getString(consumable.userString), exclude: [], diff --git a/packages/core/src/types/consumablesCommon.ts b/packages/core/src/types/consumablesCommon.ts index 6b4068edf..25a54f8fd 100644 --- a/packages/core/src/types/consumablesCommon.ts +++ b/packages/core/src/types/consumablesCommon.ts @@ -15,7 +15,7 @@ export interface ConsumablesCommon { script: { "#text": string; automatic?: boolean; - cooldown: number; + cooldown?: number; duration?: number; shotEffect?: string; bonusValues?: { [key: string]: number }; From 7f80723ee71b9a1c006fb324866ed3c00d83e74d Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sat, 14 Nov 2026 11:16:49 -0600 Subject: [PATCH 2/6] add zip vfs --- packages/core/src/blitzkit/vfs/client.ts | 18 ++++++++++++++++++ packages/scripts/src/downloadClient/index.ts | 5 ++--- packages/scripts/src/vfs/vfs.ts | 5 ++--- packages/website/src/core/blitzkit/vfs.ts | 5 ++--- 4 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 packages/core/src/blitzkit/vfs/client.ts diff --git a/packages/core/src/blitzkit/vfs/client.ts b/packages/core/src/blitzkit/vfs/client.ts new file mode 100644 index 000000000..663e2c32d --- /dev/null +++ b/packages/core/src/blitzkit/vfs/client.ts @@ -0,0 +1,18 @@ +import { assertSecret } from "@blitzkit/core"; +import { LocalVFS } from "./local"; +import { MixedVFS } from "./mixed"; +import { ZipVFS } from "./zip"; + +// zip reads straight from the remote archive; CLIENT_DIR stays first so SmartDLC patches override it +export function createClientVFS() { + const local = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR)); + + if (import.meta.env.CLIENT_PROVIDER === "zip") { + return new MixedVFS([ + local, + new ZipVFS(assertSecret(import.meta.env.CLIENT_SOURCE)), + ]); + } + + return local; +} diff --git a/packages/scripts/src/downloadClient/index.ts b/packages/scripts/src/downloadClient/index.ts index 44b5531bd..464d54b58 100644 --- a/packages/scripts/src/downloadClient/index.ts +++ b/packages/scripts/src/downloadClient/index.ts @@ -3,7 +3,6 @@ import { mkdir, rm } from "node:fs/promises"; import { downloadSteamClient } from "./steam"; import { downloadWGCClient } from "./wgc"; import { downloadWGPKGClient } from "./wgpkg"; -import { downloadZipClient } from "./zip"; export const DEPOT_DOWNLOADER_RETRY_TIME = 30_000; @@ -20,9 +19,9 @@ switch (provider) { await downloadSteamClient(); break; - // from zip, usually has a root directory for opentest + // from zip, read remotely by ZipVFS at build time; nothing to download case "zip": - await downloadZipClient(); + console.log("Zip client provider; skipping download in favor of ZipVFS"); break; // effectively the same as wgc, but direct for preview diff --git a/packages/scripts/src/vfs/vfs.ts b/packages/scripts/src/vfs/vfs.ts index a94b39bae..cf3fe8c5f 100644 --- a/packages/scripts/src/vfs/vfs.ts +++ b/packages/scripts/src/vfs/vfs.ts @@ -1,4 +1,3 @@ -import { assertSecret } from "@blitzkit/core"; -import { LocalVFS } from "@blitzkit/core/src/blitzkit/vfs/local"; +import { createClientVFS } from "@blitzkit/core/src/blitzkit/vfs/client"; -export const vfs = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR)); +export const vfs = createClientVFS(); diff --git a/packages/website/src/core/blitzkit/vfs.ts b/packages/website/src/core/blitzkit/vfs.ts index a94b39bae..cf3fe8c5f 100644 --- a/packages/website/src/core/blitzkit/vfs.ts +++ b/packages/website/src/core/blitzkit/vfs.ts @@ -1,4 +1,3 @@ -import { assertSecret } from "@blitzkit/core"; -import { LocalVFS } from "@blitzkit/core/src/blitzkit/vfs/local"; +import { createClientVFS } from "@blitzkit/core/src/blitzkit/vfs/client"; -export const vfs = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR)); +export const vfs = createClientVFS(); From 79c2ad87a4f54f54fca602f02c63eb75455e84e1 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sat, 14 Nov 2026 11:22:21 -0600 Subject: [PATCH 3/6] wtf? lets try this --- .github/workflows/website.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/website.yaml b/.github/workflows/website.yaml index d8ff5ed3e..4b0e303ce 100644 --- a/.github/workflows/website.yaml +++ b/.github/workflows/website.yaml @@ -112,12 +112,17 @@ jobs: # Future proofing for Reforged: we'll have both closed and open repos, so # we need to handle them here instead of disabling submodules outright + # checkout's persisted credentials are scoped to the root .git, so submodule clones need the token passed explicitly - name: Checkout submodules + env: + TOKEN: ${{ secrets.GH_TOKEN || github.token }} run: | + AUTH="AUTHORIZATION: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" + if [ "$HAS_ROOT_REPO_CONTEXT" = "true" ]; then - git submodule update --init --recursive --depth=1 + git -c "http.https://github.com/.extraheader=$AUTH" submodule update --init --recursive --depth=1 else - git submodule update --init --recursive --depth=1 -- . ':!packages/closed' + git -c "http.https://github.com/.extraheader=$AUTH" submodule update --init --recursive --depth=1 -- . ':!packages/closed' fi - name: Setup bun From 20fb8f2ac9bf07710fd225b4a3bb7a085a5c96cc Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sat, 14 Nov 2026 11:25:58 -0600 Subject: [PATCH 4/6] there we go --- .github/workflows/website.yaml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/.github/workflows/website.yaml b/.github/workflows/website.yaml index 4b0e303ce..3ab2889d2 100644 --- a/.github/workflows/website.yaml +++ b/.github/workflows/website.yaml @@ -107,24 +107,10 @@ jobs: uses: actions/checkout@v6 with: ref: ${{ github.event.pull_request.head.sha || inputs.branch || 'production' }} - submodules: false + # the only submodule is closed, which needs secrets + submodules: ${{ env.HAS_ROOT_REPO_CONTEXT == 'true' && 'recursive' || 'false' }} token: ${{ secrets.GH_TOKEN || github.token }} - # Future proofing for Reforged: we'll have both closed and open repos, so - # we need to handle them here instead of disabling submodules outright - # checkout's persisted credentials are scoped to the root .git, so submodule clones need the token passed explicitly - - name: Checkout submodules - env: - TOKEN: ${{ secrets.GH_TOKEN || github.token }} - run: | - AUTH="AUTHORIZATION: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" - - if [ "$HAS_ROOT_REPO_CONTEXT" = "true" ]; then - git -c "http.https://github.com/.extraheader=$AUTH" submodule update --init --recursive --depth=1 - else - git -c "http.https://github.com/.extraheader=$AUTH" submodule update --init --recursive --depth=1 -- . ':!packages/closed' - fi - - name: Setup bun uses: oven-sh/setup-bun@v2 From 1a4ca8ca1e977208731515c3328c5275d77c4bd1 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sat, 14 Nov 2026 11:28:46 -0600 Subject: [PATCH 5/6] init --- .../core/src/blitzkit/api/server/0_base.ts | 3 --- packages/core/src/blitzkit/vfs/client.ts | 18 +++++++++--------- packages/scripts/src/vfs/vfs.ts | 2 +- packages/website/src/core/blitzkit/vfs.ts | 2 +- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/packages/core/src/blitzkit/api/server/0_base.ts b/packages/core/src/blitzkit/api/server/0_base.ts index 034122e00..05996a84e 100644 --- a/packages/core/src/blitzkit/api/server/0_base.ts +++ b/packages/core/src/blitzkit/api/server/0_base.ts @@ -116,9 +116,6 @@ export abstract class ServerBlitzKitAPI0 extends BlitzKitAPI { const { existsSync } = await import("fs"); const { readFile, writeFile, mkdir } = await import("fs/promises"); - console.log("Initializing virtual file system..."); - await this.vfs.init(); - console.log("Fetching game data..."); this.nationsDir = await this.vfs .dir("Data/XML/item_defs/vehicles") diff --git a/packages/core/src/blitzkit/vfs/client.ts b/packages/core/src/blitzkit/vfs/client.ts index 663e2c32d..9a314801b 100644 --- a/packages/core/src/blitzkit/vfs/client.ts +++ b/packages/core/src/blitzkit/vfs/client.ts @@ -1,18 +1,18 @@ import { assertSecret } from "@blitzkit/core"; +import { AbstractVFS } from "./abstract"; import { LocalVFS } from "./local"; -import { MixedVFS } from "./mixed"; import { ZipVFS } from "./zip"; -// zip reads straight from the remote archive; CLIENT_DIR stays first so SmartDLC patches override it -export function createClientVFS() { - const local = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR)); +export async function createClientVFS() { + let vfs: AbstractVFS; if (import.meta.env.CLIENT_PROVIDER === "zip") { - return new MixedVFS([ - local, - new ZipVFS(assertSecret(import.meta.env.CLIENT_SOURCE)), - ]); + vfs = new ZipVFS(assertSecret(import.meta.env.CLIENT_SOURCE)); + } else { + vfs = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR)); } - return local; + await vfs.init(); + + return vfs; } diff --git a/packages/scripts/src/vfs/vfs.ts b/packages/scripts/src/vfs/vfs.ts index cf3fe8c5f..48d6baa82 100644 --- a/packages/scripts/src/vfs/vfs.ts +++ b/packages/scripts/src/vfs/vfs.ts @@ -1,3 +1,3 @@ import { createClientVFS } from "@blitzkit/core/src/blitzkit/vfs/client"; -export const vfs = createClientVFS(); +export const vfs = await createClientVFS(); diff --git a/packages/website/src/core/blitzkit/vfs.ts b/packages/website/src/core/blitzkit/vfs.ts index cf3fe8c5f..48d6baa82 100644 --- a/packages/website/src/core/blitzkit/vfs.ts +++ b/packages/website/src/core/blitzkit/vfs.ts @@ -1,3 +1,3 @@ import { createClientVFS } from "@blitzkit/core/src/blitzkit/vfs/client"; -export const vfs = createClientVFS(); +export const vfs = await createClientVFS(); From af475a0ebc2aef5ae21e11234ba86686c05985f4 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sat, 14 Nov 2026 13:51:19 -0600 Subject: [PATCH 6/6] move version to protected field --- packages/core/src/blitzkit/api/server/0_base.ts | 5 ++++- packages/core/src/blitzkit/api/server/9_gameDefinitions.ts | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/core/src/blitzkit/api/server/0_base.ts b/packages/core/src/blitzkit/api/server/0_base.ts index 05996a84e..5cbd7518d 100644 --- a/packages/core/src/blitzkit/api/server/0_base.ts +++ b/packages/core/src/blitzkit/api/server/0_base.ts @@ -106,6 +106,7 @@ export abstract class ServerBlitzKitAPI0 extends BlitzKitAPI { protected gameTypeSelectorStyles?: SquadBattleTypeStylesYaml; protected combatRoles?: CombatRolesYaml; protected tierEqualizer?: string[][]; + protected version?: string; constructor(vfs: AbstractVFS) { super(); @@ -153,11 +154,13 @@ export abstract class ServerBlitzKitAPI0 extends BlitzKitAPI { { delimiter: ";" }, ); + this.version = (await this.vfs.text("Data/version.txt")).split(" ")[0]; + console.log("Fetching game localizations..."); await Promise.all( locales.supported.map(async ({ locale }) => { - const root = "../../temp/game-strings"; + const root = `../../temp/game-strings/${this.version}`; const cachePath = `${root}/${locale}.json`; if (existsSync(cachePath)) { diff --git a/packages/core/src/blitzkit/api/server/9_gameDefinitions.ts b/packages/core/src/blitzkit/api/server/9_gameDefinitions.ts index 2803df1b6..6a423f2cb 100644 --- a/packages/core/src/blitzkit/api/server/9_gameDefinitions.ts +++ b/packages/core/src/blitzkit/api/server/9_gameDefinitions.ts @@ -19,9 +19,7 @@ export abstract class ServerBlitzKitAPI9 extends ServerBlitzKitAPI8 { provisionNativeNames[key] = provision.id; }); - const version = (await this.vfs.text("Data/version.txt")).split(" ")[0]; - - gameDefinitions.version = version; + gameDefinitions.version = this.version!; gameDefinitions.nations = ( await this.vfs.yaml("Data/available_nations.yaml") ).available_nations;