move version to protected field

This commit is contained in:
tresabhi committed 2026-11-14 13:51:19 -06:00
1 parent 1a4ca8ca1e
commit af475a0ebc
2 files changed
+5 -4

No files matched your search

@@ -106,6 +106,7 @@ export abstract class ServerBlitzKitAPI0 extends BlitzKitAPI {
protected gameTypeSelectorStyles?: SquadBattleTypeStylesYaml; protected gameTypeSelectorStyles?: SquadBattleTypeStylesYaml;
protected combatRoles?: CombatRolesYaml; protected combatRoles?: CombatRolesYaml;
protected tierEqualizer?: string[][]; protected tierEqualizer?: string[][];
protected version?: string;
constructor(vfs: AbstractVFS) { constructor(vfs: AbstractVFS) {
super(); super();
@@ -153,11 +154,13 @@ export abstract class ServerBlitzKitAPI0 extends BlitzKitAPI {
{ delimiter: ";" }, { delimiter: ";" },
); );
this.version = (await this.vfs.text("Data/version.txt")).split(" ")[0];
console.log("Fetching game localizations..."); console.log("Fetching game localizations...");
await Promise.all( await Promise.all(
locales.supported.map(async ({ locale }) => { locales.supported.map(async ({ locale }) => {
const root = "../../temp/game-strings"; const root = `../../temp/game-strings/${this.version}`;
const cachePath = `${root}/${locale}.json`; const cachePath = `${root}/${locale}.json`;
if (existsSync(cachePath)) { if (existsSync(cachePath)) {
@@ -19,9 +19,7 @@ export abstract class ServerBlitzKitAPI9 extends ServerBlitzKitAPI8 {
provisionNativeNames[key] = provision.id; provisionNativeNames[key] = provision.id;
}); });
const version = (await this.vfs.text("Data/version.txt")).split(" ")[0]; gameDefinitions.version = this.version!;
gameDefinitions.version = version;
gameDefinitions.nations = ( gameDefinitions.nations = (
await this.vfs.yaml<AvailableNationsYaml>("Data/available_nations.yaml") await this.vfs.yaml<AvailableNationsYaml>("Data/available_nations.yaml")
).available_nations; ).available_nations;