diff --git a/bun.lock b/bun.lock index e8b0cd19a..9b9c1ee71 100644 --- a/bun.lock +++ b/bun.lock @@ -92,21 +92,25 @@ "@gltf-transform/core": "^4.2.1", "@gltf-transform/extensions": "^4.2.1", "@gltf-transform/functions": "^4.2.1", + "@types/bun": "^1.3.0", + "@types/decompress": "^4.2.7", + "@types/lodash-es": "^4.17.12", "@types/lz4js": "^0.2.1", + "@types/progress": "^2.0.7", + "@types/three": "^0.180.0", "crc": "^4.3.2", "csv-parse": "^6.1.0", "decompress": "^4.2.1", + "dotenv": "^17.2.3", "esbuild": "^0.25.10", "fast-xml-parser": "^5.2.5", + "lodash-es": "^4.17.21", "lz4js": "^0.2.0", "progress": "^2.0.3", "puppeteer": "^24.22.3", + "three": "^0.180.0", "ts-proto": "^2.7.7", }, - "devDependencies": { - "@types/decompress": "^4.2.7", - "@types/progress": "^2.0.7", - }, }, "packages/varuna": { "name": "varuna", @@ -891,6 +895,8 @@ "@types/babel__traverse": ["@types/babel__traverse@7.28.0", "", { "dependencies": { "@babel/types": "^7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="], + "@types/bun": ["@types/bun@1.3.0", "", { "dependencies": { "bun-types": "1.3.0" } }, "sha512-+lAGCYjXjip2qY375xX/scJeVRmZ5cY0wyHYyCYxNcdEXrQ4AOe3gACgd4iQ8ksOslJtW4VNxBJ8llUwc3a6AA=="], + "@types/debug": ["@types/debug@4.1.12", "", { "dependencies": { "@types/ms": "*" } }, "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ=="], "@types/decompress": ["@types/decompress@4.2.7", "", { "dependencies": { "@types/node": "*" } }, "sha512-9z+8yjKr5Wn73Pt17/ldnmQToaFHZxK0N1GHysuk/JIPT8RIdQeoInM01wWPgypRcvb6VH1drjuFpQ4zmY437g=="], @@ -1089,6 +1095,8 @@ "buffer-from": ["buffer-from@1.1.2", "", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="], + "bun-types": ["bun-types@1.3.0", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-u8X0thhx+yJ0KmkxuEo9HAtdfgCBaM/aI9K90VQcQioAmkVp3SG3FkwWGibUFz3WdXAdcsqOcbU40lK7tbHdkQ=="], + "c12": ["c12@3.1.0", "", { "dependencies": { "chokidar": "^4.0.3", "confbox": "^0.2.2", "defu": "^6.1.4", "dotenv": "^16.6.1", "exsolve": "^1.0.7", "giget": "^2.0.0", "jiti": "^2.4.2", "ohash": "^2.0.11", "pathe": "^2.0.3", "perfect-debounce": "^1.0.0", "pkg-types": "^2.2.0", "rc9": "^2.1.2" }, "peerDependencies": { "magicast": "^0.3.5" }, "optionalPeers": ["magicast"] }, "sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw=="], "call-bind": ["call-bind@1.0.8", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" } }, "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww=="], @@ -2451,6 +2459,10 @@ "@babel/preset-env/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], + "@blitzkit/core/dotenv": ["dotenv@17.2.3", "", {}, "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w=="], + + "@blitzkit/scripts/dotenv": ["dotenv@17.2.3", "", {}, "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w=="], + "@blitzkit/website/@types/react": ["@types/react@19.1.14", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-ukd93VGzaNPMAUPy0gRDSC57UuQbnH9Kussp7HBjM06YFi9uZTFhOvMSO2OKqXm1rSgzOE+pVx1k1PYHGwlc8Q=="], "@blitzkit/website/react": ["react@19.1.1", "", {}, "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ=="], diff --git a/packages/closed b/packages/closed index 7b5bc2d93..6c6ab9bee 160000 --- a/packages/closed +++ b/packages/closed @@ -1 +1 @@ -Subproject commit 7b5bc2d935704607a170085d3a1d319698205b44 +Subproject commit 6c6ab9bee68ea393439d6e94b21bc41cd6771cb1 diff --git a/packages/core/src/protos/tank_definitions.ts b/packages/core/src/protos/tank_definitions.ts index fdbae9625..08431fa77 100644 --- a/packages/core/src/protos/tank_definitions.ts +++ b/packages/core/src/protos/tank_definitions.ts @@ -1,3 +1,5 @@ +// @ts-nocheck + // Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.2.2 @@ -5,10 +7,10 @@ // source: packages/core/src/protos/tank_definitions.proto /* eslint-disable */ -import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire'; -import { I18nString } from './i18n'; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { I18nString } from "./i18n"; -export const protobufPackage = 'blitzkit'; +export const protobufPackage = "blitzkit"; export enum TankPriceType { CREDITS = 0, @@ -18,14 +20,14 @@ export enum TankPriceType { export function tankPriceTypeFromJSON(object: any): TankPriceType { switch (object) { case 0: - case 'TANK_PRICE_TYPE_CREDITS': + case "TANK_PRICE_TYPE_CREDITS": return TankPriceType.CREDITS; case 1: - case 'TANK_PRICE_TYPE_GOLD': + case "TANK_PRICE_TYPE_GOLD": return TankPriceType.GOLD; default: throw new globalThis.Error( - 'Unrecognized enum value ' + object + ' for enum TankPriceType', + "Unrecognized enum value " + object + " for enum TankPriceType" ); } } @@ -33,12 +35,12 @@ export function tankPriceTypeFromJSON(object: any): TankPriceType { export function tankPriceTypeToJSON(object: TankPriceType): string { switch (object) { case TankPriceType.CREDITS: - return 'TANK_PRICE_TYPE_CREDITS'; + return "TANK_PRICE_TYPE_CREDITS"; case TankPriceType.GOLD: - return 'TANK_PRICE_TYPE_GOLD'; + return "TANK_PRICE_TYPE_GOLD"; default: throw new globalThis.Error( - 'Unrecognized enum value ' + object + ' for enum TankPriceType', + "Unrecognized enum value " + object + " for enum TankPriceType" ); } } @@ -53,20 +55,20 @@ export enum ShellType { export function shellTypeFromJSON(object: any): ShellType { switch (object) { case 0: - case 'SHELL_TYPE_AP': + case "SHELL_TYPE_AP": return ShellType.AP; case 1: - case 'SHELL_TYPE_APCR': + case "SHELL_TYPE_APCR": return ShellType.APCR; case 2: - case 'SHELL_TYPE_HEAT': + case "SHELL_TYPE_HEAT": return ShellType.HEAT; case 3: - case 'SHELL_TYPE_HE': + case "SHELL_TYPE_HE": return ShellType.HE; default: throw new globalThis.Error( - 'Unrecognized enum value ' + object + ' for enum ShellType', + "Unrecognized enum value " + object + " for enum ShellType" ); } } @@ -74,16 +76,16 @@ export function shellTypeFromJSON(object: any): ShellType { export function shellTypeToJSON(object: ShellType): string { switch (object) { case ShellType.AP: - return 'SHELL_TYPE_AP'; + return "SHELL_TYPE_AP"; case ShellType.APCR: - return 'SHELL_TYPE_APCR'; + return "SHELL_TYPE_APCR"; case ShellType.HEAT: - return 'SHELL_TYPE_HEAT'; + return "SHELL_TYPE_HEAT"; case ShellType.HE: - return 'SHELL_TYPE_HE'; + return "SHELL_TYPE_HE"; default: throw new globalThis.Error( - 'Unrecognized enum value ' + object + ' for enum ShellType', + "Unrecognized enum value " + object + " for enum ShellType" ); } } @@ -99,23 +101,23 @@ export enum ModuleType { export function moduleTypeFromJSON(object: any): ModuleType { switch (object) { case 0: - case 'MODULE_TYPE_VEHICLE': + case "MODULE_TYPE_VEHICLE": return ModuleType.VEHICLE; case 1: - case 'MODULE_TYPE_ENGINE': + case "MODULE_TYPE_ENGINE": return ModuleType.ENGINE; case 2: - case 'MODULE_TYPE_TRACKS': + case "MODULE_TYPE_TRACKS": return ModuleType.TRACKS; case 3: - case 'MODULE_TYPE_TURRET': + case "MODULE_TYPE_TURRET": return ModuleType.TURRET; case 4: - case 'MODULE_TYPE_GUN': + case "MODULE_TYPE_GUN": return ModuleType.GUN; default: throw new globalThis.Error( - 'Unrecognized enum value ' + object + ' for enum ModuleType', + "Unrecognized enum value " + object + " for enum ModuleType" ); } } @@ -123,18 +125,18 @@ export function moduleTypeFromJSON(object: any): ModuleType { export function moduleTypeToJSON(object: ModuleType): string { switch (object) { case ModuleType.VEHICLE: - return 'MODULE_TYPE_VEHICLE'; + return "MODULE_TYPE_VEHICLE"; case ModuleType.ENGINE: - return 'MODULE_TYPE_ENGINE'; + return "MODULE_TYPE_ENGINE"; case ModuleType.TRACKS: - return 'MODULE_TYPE_TRACKS'; + return "MODULE_TYPE_TRACKS"; case ModuleType.TURRET: - return 'MODULE_TYPE_TURRET'; + return "MODULE_TYPE_TURRET"; case ModuleType.GUN: - return 'MODULE_TYPE_GUN'; + return "MODULE_TYPE_GUN"; default: throw new globalThis.Error( - 'Unrecognized enum value ' + object + ' for enum ModuleType', + "Unrecognized enum value " + object + " for enum ModuleType" ); } } @@ -149,20 +151,20 @@ export enum TankClass { export function tankClassFromJSON(object: any): TankClass { switch (object) { case 0: - case 'TANK_CLASS_LIGHT': + case "TANK_CLASS_LIGHT": return TankClass.LIGHT; case 1: - case 'TANK_CLASS_MEDIUM': + case "TANK_CLASS_MEDIUM": return TankClass.MEDIUM; case 2: - case 'TANK_CLASS_HEAVY': + case "TANK_CLASS_HEAVY": return TankClass.HEAVY; case 3: - case 'TANK_CLASS_TANK_DESTROYER': + case "TANK_CLASS_TANK_DESTROYER": return TankClass.TANK_DESTROYER; default: throw new globalThis.Error( - 'Unrecognized enum value ' + object + ' for enum TankClass', + "Unrecognized enum value " + object + " for enum TankClass" ); } } @@ -170,16 +172,16 @@ export function tankClassFromJSON(object: any): TankClass { export function tankClassToJSON(object: TankClass): string { switch (object) { case TankClass.LIGHT: - return 'TANK_CLASS_LIGHT'; + return "TANK_CLASS_LIGHT"; case TankClass.MEDIUM: - return 'TANK_CLASS_MEDIUM'; + return "TANK_CLASS_MEDIUM"; case TankClass.HEAVY: - return 'TANK_CLASS_HEAVY'; + return "TANK_CLASS_HEAVY"; case TankClass.TANK_DESTROYER: - return 'TANK_CLASS_TANK_DESTROYER'; + return "TANK_CLASS_TANK_DESTROYER"; default: throw new globalThis.Error( - 'Unrecognized enum value ' + object + ' for enum TankClass', + "Unrecognized enum value " + object + " for enum TankClass" ); } } @@ -193,17 +195,17 @@ export enum TankType { export function tankTypeFromJSON(object: any): TankType { switch (object) { case 0: - case 'TANK_TYPE_RESEARCHABLE': + case "TANK_TYPE_RESEARCHABLE": return TankType.RESEARCHABLE; case 1: - case 'TANK_TYPE_PREMIUM': + case "TANK_TYPE_PREMIUM": return TankType.PREMIUM; case 2: - case 'TANK_TYPE_COLLECTOR': + case "TANK_TYPE_COLLECTOR": return TankType.COLLECTOR; default: throw new globalThis.Error( - 'Unrecognized enum value ' + object + ' for enum TankType', + "Unrecognized enum value " + object + " for enum TankType" ); } } @@ -211,14 +213,14 @@ export function tankTypeFromJSON(object: any): TankType { export function tankTypeToJSON(object: TankType): string { switch (object) { case TankType.RESEARCHABLE: - return 'TANK_TYPE_RESEARCHABLE'; + return "TANK_TYPE_RESEARCHABLE"; case TankType.PREMIUM: - return 'TANK_TYPE_PREMIUM'; + return "TANK_TYPE_PREMIUM"; case TankType.COLLECTOR: - return 'TANK_TYPE_COLLECTOR'; + return "TANK_TYPE_COLLECTOR"; default: throw new globalThis.Error( - 'Unrecognized enum value ' + object + ' for enum TankType', + "Unrecognized enum value " + object + " for enum TankType" ); } } @@ -234,23 +236,23 @@ export enum CrewType { export function crewTypeFromJSON(object: any): CrewType { switch (object) { case 0: - case 'CREW_TYPE_COMMANDER': + case "CREW_TYPE_COMMANDER": return CrewType.COMMANDER; case 1: - case 'CREW_TYPE_RADIOMAN': + case "CREW_TYPE_RADIOMAN": return CrewType.RADIOMAN; case 2: - case 'CREW_TYPE_GUNNER': + case "CREW_TYPE_GUNNER": return CrewType.GUNNER; case 3: - case 'CREW_TYPE_DRIVER': + case "CREW_TYPE_DRIVER": return CrewType.DRIVER; case 4: - case 'CREW_TYPE_LOADER': + case "CREW_TYPE_LOADER": return CrewType.LOADER; default: throw new globalThis.Error( - 'Unrecognized enum value ' + object + ' for enum CrewType', + "Unrecognized enum value " + object + " for enum CrewType" ); } } @@ -258,18 +260,18 @@ export function crewTypeFromJSON(object: any): CrewType { export function crewTypeToJSON(object: CrewType): string { switch (object) { case CrewType.COMMANDER: - return 'CREW_TYPE_COMMANDER'; + return "CREW_TYPE_COMMANDER"; case CrewType.RADIOMAN: - return 'CREW_TYPE_RADIOMAN'; + return "CREW_TYPE_RADIOMAN"; case CrewType.GUNNER: - return 'CREW_TYPE_GUNNER'; + return "CREW_TYPE_GUNNER"; case CrewType.DRIVER: - return 'CREW_TYPE_DRIVER'; + return "CREW_TYPE_DRIVER"; case CrewType.LOADER: - return 'CREW_TYPE_LOADER'; + return "CREW_TYPE_LOADER"; default: throw new globalThis.Error( - 'Unrecognized enum value ' + object + ' for enum CrewType', + "Unrecognized enum value " + object + " for enum CrewType" ); } } @@ -323,8 +325,8 @@ export interface TankDefinition_RolesEntry { export interface ResearchCost { research_cost_type?: - | { $case: 'xp'; value: number } - | { $case: 'seasonal_tokens'; value: ResearchCostSeasonalTokens }; + | { $case: "xp"; value: number } + | { $case: "seasonal_tokens"; value: ResearchCostSeasonalTokens }; } export interface ResearchCostSeasonalTokens { @@ -378,9 +380,9 @@ export interface TurretDefinition { export interface GunDefinition { gun_type?: - | { $case: 'regular'; value: GunDefinitionRegular } - | { $case: 'auto_loader'; value: GunDefinitionAutoLoader } - | { $case: 'auto_reloader'; value: GunDefinitionAutoReloader }; + | { $case: "regular"; value: GunDefinitionRegular } + | { $case: "auto_loader"; value: GunDefinitionAutoLoader } + | { $case: "auto_reloader"; value: GunDefinitionAutoReloader }; id: number; rotation_speed: number; research_cost?: ResearchCost; @@ -476,12 +478,12 @@ function createBaseTankDefinitions(): TankDefinitions { export const TankDefinitions: MessageFns = { encode( message: TankDefinitions, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { Object.entries(message.tanks).forEach(([key, value]) => { TankDefinitions_TanksEntry.encode( { key: key as any, value }, - writer.uint32(10).fork(), + writer.uint32(10).fork() ).join(); }); return writer; @@ -502,7 +504,7 @@ export const TankDefinitions: MessageFns = { const entry1 = TankDefinitions_TanksEntry.decode( reader, - reader.uint32(), + reader.uint32() ); if (entry1.value !== undefined) { message.tanks[entry1.key] = entry1.value; @@ -546,12 +548,12 @@ export const TankDefinitions: MessageFns = { }, create, I>>( - base?: I, + base?: I ): TankDefinitions { return TankDefinitions.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): TankDefinitions { const message = createBaseTankDefinitions(); message.tanks = Object.entries(object.tanks ?? {}).reduce<{ @@ -574,7 +576,7 @@ export const TankDefinitions_TanksEntry: MessageFns { encode( message: TankDefinitions_TanksEntry, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.key !== 0) { writer.uint32(8).uint32(message.key); @@ -587,7 +589,7 @@ export const TankDefinitions_TanksEntry: MessageFns decode( input: BinaryReader | Uint8Array, - length?: number, + length?: number ): TankDefinitions_TanksEntry { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); @@ -642,12 +644,12 @@ export const TankDefinitions_TanksEntry: MessageFns }, create, I>>( - base?: I, + base?: I ): TankDefinitions_TanksEntry { return TankDefinitions_TanksEntry.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): TankDefinitions_TanksEntry { const message = createBaseTankDefinitions_TanksEntry(); message.key = object.key ?? 0; @@ -662,7 +664,7 @@ export const TankDefinitions_TanksEntry: MessageFns function createBaseTankDefinition(): TankDefinition { return { id: 0, - slug: '', + slug: "", roles: {}, fixed_camouflage: false, camouflages: [], @@ -670,7 +672,7 @@ function createBaseTankDefinition(): TankDefinition { successors: [], crew: [], health: 0, - nation: '', + nation: "", name: undefined, type: 0, max_consumables: 0, @@ -689,7 +691,7 @@ function createBaseTankDefinition(): TankDefinition { camouflage_still: 0, camouflage_moving: 0, camouflage_onFire: 0, - equipment_preset: '', + equipment_preset: "", weight: 0, }; } @@ -697,18 +699,18 @@ function createBaseTankDefinition(): TankDefinition { export const TankDefinition: MessageFns = { encode( message: TankDefinition, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.id !== 0) { writer.uint32(8).uint32(message.id); } - if (message.slug !== '') { + if (message.slug !== "") { writer.uint32(18).string(message.slug); } Object.entries(message.roles).forEach(([key, value]) => { TankDefinition_RolesEntry.encode( { key: key as any, value }, - writer.uint32(26).fork(), + writer.uint32(26).fork() ).join(); }); if (message.fixed_camouflage !== false) { @@ -735,7 +737,7 @@ export const TankDefinition: MessageFns = { if (message.health !== 0) { writer.uint32(80).uint32(message.health); } - if (message.nation !== '') { + if (message.nation !== "") { writer.uint32(90).string(message.nation); } if (message.name !== undefined) { @@ -777,7 +779,7 @@ export const TankDefinition: MessageFns = { if (message.research_cost !== undefined) { ResearchCost.encode( message.research_cost, - writer.uint32(194).fork(), + writer.uint32(194).fork() ).join(); } if (message.speed_forwards !== 0) { @@ -795,7 +797,7 @@ export const TankDefinition: MessageFns = { if (message.camouflage_onFire !== 0) { writer.uint32(237).float(message.camouflage_onFire); } - if (message.equipment_preset !== '') { + if (message.equipment_preset !== "") { writer.uint32(242).string(message.equipment_preset); } if (message.weight !== 0) { @@ -835,7 +837,7 @@ export const TankDefinition: MessageFns = { const entry3 = TankDefinition_RolesEntry.decode( reader, - reader.uint32(), + reader.uint32() ); if (entry3.value !== undefined) { message.roles[entry3.key] = entry3.value; @@ -998,7 +1000,7 @@ export const TankDefinition: MessageFns = { } message.turrets.push( - TurretDefinition.decode(reader, reader.uint32()), + TurretDefinition.decode(reader, reader.uint32()) ); continue; } @@ -1008,7 +1010,7 @@ export const TankDefinition: MessageFns = { } message.engines.push( - EngineDefinition.decode(reader, reader.uint32()), + EngineDefinition.decode(reader, reader.uint32()) ); continue; } @@ -1104,14 +1106,14 @@ export const TankDefinition: MessageFns = { fromJSON(object: any): TankDefinition { return { id: isSet(object.id) ? globalThis.Number(object.id) : 0, - slug: isSet(object.slug) ? globalThis.String(object.slug) : '', + slug: isSet(object.slug) ? globalThis.String(object.slug) : "", roles: isObject(object.roles) ? Object.entries(object.roles).reduce<{ [key: number]: number }>( (acc, [key, value]) => { acc[globalThis.Number(key)] = Number(value); return acc; }, - {}, + {} ) : {}, fixed_camouflage: isSet(object.fixed_camouflage) @@ -1130,7 +1132,7 @@ export const TankDefinition: MessageFns = { ? object.crew.map((e: any) => Crew.fromJSON(e)) : [], health: isSet(object.health) ? globalThis.Number(object.health) : 0, - nation: isSet(object.nation) ? globalThis.String(object.nation) : '', + nation: isSet(object.nation) ? globalThis.String(object.nation) : "", name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined, type: isSet(object.type) ? tankTypeFromJSON(object.type) : 0, max_consumables: isSet(object.max_consumables) @@ -1177,7 +1179,7 @@ export const TankDefinition: MessageFns = { : 0, equipment_preset: isSet(object.equipment_preset) ? globalThis.String(object.equipment_preset) - : '', + : "", weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0, }; }, @@ -1187,7 +1189,7 @@ export const TankDefinition: MessageFns = { if (message.id !== 0) { obj.id = Math.round(message.id); } - if (message.slug !== '') { + if (message.slug !== "") { obj.slug = message.slug; } if (message.roles) { @@ -1217,7 +1219,7 @@ export const TankDefinition: MessageFns = { if (message.health !== 0) { obj.health = Math.round(message.health); } - if (message.nation !== '') { + if (message.nation !== "") { obj.nation = message.nation; } if (message.name !== undefined) { @@ -1274,7 +1276,7 @@ export const TankDefinition: MessageFns = { if (message.camouflage_onFire !== 0) { obj.camouflage_onFire = message.camouflage_onFire; } - if (message.equipment_preset !== '') { + if (message.equipment_preset !== "") { obj.equipment_preset = message.equipment_preset; } if (message.weight !== 0) { @@ -1284,16 +1286,16 @@ export const TankDefinition: MessageFns = { }, create, I>>( - base?: I, + base?: I ): TankDefinition { return TankDefinition.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): TankDefinition { const message = createBaseTankDefinition(); message.id = object.id ?? 0; - message.slug = object.slug ?? ''; + message.slug = object.slug ?? ""; message.roles = Object.entries(object.roles ?? {}).reduce<{ [key: number]: number; }>((acc, [key, value]) => { @@ -1308,7 +1310,7 @@ export const TankDefinition: MessageFns = { message.successors = object.successors?.map((e) => e) || []; message.crew = object.crew?.map((e) => Crew.fromPartial(e)) || []; message.health = object.health ?? 0; - message.nation = object.nation ?? ''; + message.nation = object.nation ?? ""; message.name = object.name !== undefined && object.name !== null ? I18nString.fromPartial(object.name) @@ -1339,7 +1341,7 @@ export const TankDefinition: MessageFns = { message.camouflage_still = object.camouflage_still ?? 0; message.camouflage_moving = object.camouflage_moving ?? 0; message.camouflage_onFire = object.camouflage_onFire ?? 0; - message.equipment_preset = object.equipment_preset ?? ''; + message.equipment_preset = object.equipment_preset ?? ""; message.weight = object.weight ?? 0; return message; }, @@ -1353,7 +1355,7 @@ export const TankDefinition_RolesEntry: MessageFns = { encode( message: TankDefinition_RolesEntry, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.key !== 0) { writer.uint32(8).uint32(message.key); @@ -1366,7 +1368,7 @@ export const TankDefinition_RolesEntry: MessageFns = decode( input: BinaryReader | Uint8Array, - length?: number, + length?: number ): TankDefinition_RolesEntry { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); @@ -1419,12 +1421,12 @@ export const TankDefinition_RolesEntry: MessageFns = }, create, I>>( - base?: I, + base?: I ): TankDefinition_RolesEntry { return TankDefinition_RolesEntry.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): TankDefinition_RolesEntry { const message = createBaseTankDefinition_RolesEntry(); message.key = object.key ?? 0; @@ -1440,16 +1442,16 @@ function createBaseResearchCost(): ResearchCost { export const ResearchCost: MessageFns = { encode( message: ResearchCost, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { switch (message.research_cost_type?.$case) { - case 'xp': + case "xp": writer.uint32(8).uint32(message.research_cost_type.value); break; - case 'seasonal_tokens': + case "seasonal_tokens": ResearchCostSeasonalTokens.encode( message.research_cost_type.value, - writer.uint32(18).fork(), + writer.uint32(18).fork() ).join(); break; } @@ -1469,7 +1471,7 @@ export const ResearchCost: MessageFns = { break; } - message.research_cost_type = { $case: 'xp', value: reader.uint32() }; + message.research_cost_type = { $case: "xp", value: reader.uint32() }; continue; } case 2: { @@ -1478,7 +1480,7 @@ export const ResearchCost: MessageFns = { } message.research_cost_type = { - $case: 'seasonal_tokens', + $case: "seasonal_tokens", value: ResearchCostSeasonalTokens.decode(reader, reader.uint32()), }; continue; @@ -1495,12 +1497,12 @@ export const ResearchCost: MessageFns = { fromJSON(object: any): ResearchCost { return { research_cost_type: isSet(object.xp) - ? { $case: 'xp', value: globalThis.Number(object.xp) } + ? { $case: "xp", value: globalThis.Number(object.xp) } : isSet(object.seasonal_tokens) ? { - $case: 'seasonal_tokens', + $case: "seasonal_tokens", value: ResearchCostSeasonalTokens.fromJSON( - object.seasonal_tokens, + object.seasonal_tokens ), } : undefined, @@ -1509,45 +1511,45 @@ export const ResearchCost: MessageFns = { toJSON(message: ResearchCost): unknown { const obj: any = {}; - if (message.research_cost_type?.$case === 'xp') { + if (message.research_cost_type?.$case === "xp") { obj.xp = Math.round(message.research_cost_type.value); } - if (message.research_cost_type?.$case === 'seasonal_tokens') { + if (message.research_cost_type?.$case === "seasonal_tokens") { obj.seasonal_tokens = ResearchCostSeasonalTokens.toJSON( - message.research_cost_type.value, + message.research_cost_type.value ); } return obj; }, create, I>>( - base?: I, + base?: I ): ResearchCost { return ResearchCost.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): ResearchCost { const message = createBaseResearchCost(); if ( - object.research_cost_type?.$case === 'xp' && + object.research_cost_type?.$case === "xp" && object.research_cost_type?.value !== undefined && object.research_cost_type?.value !== null ) { message.research_cost_type = { - $case: 'xp', + $case: "xp", value: object.research_cost_type.value, }; } if ( - object.research_cost_type?.$case === 'seasonal_tokens' && + object.research_cost_type?.$case === "seasonal_tokens" && object.research_cost_type?.value !== undefined && object.research_cost_type?.value !== null ) { message.research_cost_type = { - $case: 'seasonal_tokens', + $case: "seasonal_tokens", value: ResearchCostSeasonalTokens.fromPartial( - object.research_cost_type.value, + object.research_cost_type.value ), }; } @@ -1563,7 +1565,7 @@ export const ResearchCostSeasonalTokens: MessageFns { encode( message: ResearchCostSeasonalTokens, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.season !== 0) { writer.uint32(8).uint32(message.season); @@ -1576,7 +1578,7 @@ export const ResearchCostSeasonalTokens: MessageFns decode( input: BinaryReader | Uint8Array, - length?: number, + length?: number ): ResearchCostSeasonalTokens { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); @@ -1629,12 +1631,12 @@ export const ResearchCostSeasonalTokens: MessageFns }, create, I>>( - base?: I, + base?: I ): ResearchCostSeasonalTokens { return ResearchCostSeasonalTokens.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): ResearchCostSeasonalTokens { const message = createBaseResearchCostSeasonalTokens(); message.season = object.season ?? 0; @@ -1650,7 +1652,7 @@ function createBaseTankPrice(): TankPrice { export const TankPrice: MessageFns = { encode( message: TankPrice, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); @@ -1716,7 +1718,7 @@ export const TankPrice: MessageFns = { return TankPrice.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): TankPrice { const message = createBaseTankPrice(); message.type = object.type ?? 0; @@ -1745,7 +1747,7 @@ function createBaseTrackDefinition(): TrackDefinition { export const TrackDefinition: MessageFns = { encode( message: TrackDefinition, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.id !== 0) { writer.uint32(8).uint32(message.id); @@ -1765,7 +1767,7 @@ export const TrackDefinition: MessageFns = { if (message.research_cost !== undefined) { ResearchCost.encode( message.research_cost, - writer.uint32(50).fork(), + writer.uint32(50).fork() ).join(); } if (message.dispersion_move !== 0) { @@ -1977,12 +1979,12 @@ export const TrackDefinition: MessageFns = { }, create, I>>( - base?: I, + base?: I ): TrackDefinition { return TrackDefinition.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): TrackDefinition { const message = createBaseTrackDefinition(); message.id = object.id ?? 0; @@ -2023,7 +2025,7 @@ function createBaseEngineDefinition(): EngineDefinition { export const EngineDefinition: MessageFns = { encode( message: EngineDefinition, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.id !== 0) { writer.uint32(8).uint32(message.id); @@ -2034,7 +2036,7 @@ export const EngineDefinition: MessageFns = { if (message.research_cost !== undefined) { ResearchCost.encode( message.research_cost, - writer.uint32(26).fork(), + writer.uint32(26).fork() ).join(); } if (message.tier !== 0) { @@ -2185,12 +2187,12 @@ export const EngineDefinition: MessageFns = { }, create, I>>( - base?: I, + base?: I ): EngineDefinition { return EngineDefinition.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): EngineDefinition { const message = createBaseEngineDefinition(); message.id = object.id ?? 0; @@ -2229,7 +2231,7 @@ function createBaseTurretDefinition(): TurretDefinition { export const TurretDefinition: MessageFns = { encode( message: TurretDefinition, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.id !== 0) { writer.uint32(8).uint32(message.id); @@ -2246,7 +2248,7 @@ export const TurretDefinition: MessageFns = { if (message.research_cost !== undefined) { ResearchCost.encode( message.research_cost, - writer.uint32(42).fork(), + writer.uint32(42).fork() ).join(); } if (message.name !== undefined) { @@ -2425,12 +2427,12 @@ export const TurretDefinition: MessageFns = { }, create, I>>( - base?: I, + base?: I ): TurretDefinition { return TurretDefinition.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): TurretDefinition { const message = createBaseTurretDefinition(); message.id = object.id ?? 0; @@ -2479,25 +2481,25 @@ function createBaseGunDefinition(): GunDefinition { export const GunDefinition: MessageFns = { encode( message: GunDefinition, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { switch (message.gun_type?.$case) { - case 'regular': + case "regular": GunDefinitionRegular.encode( message.gun_type.value, - writer.uint32(10).fork(), + writer.uint32(10).fork() ).join(); break; - case 'auto_loader': + case "auto_loader": GunDefinitionAutoLoader.encode( message.gun_type.value, - writer.uint32(18).fork(), + writer.uint32(18).fork() ).join(); break; - case 'auto_reloader': + case "auto_reloader": GunDefinitionAutoReloader.encode( message.gun_type.value, - writer.uint32(26).fork(), + writer.uint32(26).fork() ).join(); break; } @@ -2510,7 +2512,7 @@ export const GunDefinition: MessageFns = { if (message.research_cost !== undefined) { ResearchCost.encode( message.research_cost, - writer.uint32(50).fork(), + writer.uint32(50).fork() ).join(); } if (message.weight !== 0) { @@ -2552,7 +2554,7 @@ export const GunDefinition: MessageFns = { if (message.assault_ranges !== undefined) { AssaultRanges.encode( message.assault_ranges, - writer.uint32(154).fork(), + writer.uint32(154).fork() ).join(); } if (message.burst !== undefined) { @@ -2575,7 +2577,7 @@ export const GunDefinition: MessageFns = { } message.gun_type = { - $case: 'regular', + $case: "regular", value: GunDefinitionRegular.decode(reader, reader.uint32()), }; continue; @@ -2586,7 +2588,7 @@ export const GunDefinition: MessageFns = { } message.gun_type = { - $case: 'auto_loader', + $case: "auto_loader", value: GunDefinitionAutoLoader.decode(reader, reader.uint32()), }; continue; @@ -2597,7 +2599,7 @@ export const GunDefinition: MessageFns = { } message.gun_type = { - $case: 'auto_reloader', + $case: "auto_reloader", value: GunDefinitionAutoReloader.decode(reader, reader.uint32()), }; continue; @@ -2729,7 +2731,7 @@ export const GunDefinition: MessageFns = { message.assault_ranges = AssaultRanges.decode( reader, - reader.uint32(), + reader.uint32() ); continue; } @@ -2754,17 +2756,17 @@ export const GunDefinition: MessageFns = { return { gun_type: isSet(object.regular) ? { - $case: 'regular', + $case: "regular", value: GunDefinitionRegular.fromJSON(object.regular), } : isSet(object.auto_loader) ? { - $case: 'auto_loader', + $case: "auto_loader", value: GunDefinitionAutoLoader.fromJSON(object.auto_loader), } : isSet(object.auto_reloader) ? { - $case: 'auto_reloader', + $case: "auto_reloader", value: GunDefinitionAutoReloader.fromJSON(object.auto_reloader), } : undefined, @@ -2812,15 +2814,15 @@ export const GunDefinition: MessageFns = { toJSON(message: GunDefinition): unknown { const obj: any = {}; - if (message.gun_type?.$case === 'regular') { + if (message.gun_type?.$case === "regular") { obj.regular = GunDefinitionRegular.toJSON(message.gun_type.value); } - if (message.gun_type?.$case === 'auto_loader') { + if (message.gun_type?.$case === "auto_loader") { obj.auto_loader = GunDefinitionAutoLoader.toJSON(message.gun_type.value); } - if (message.gun_type?.$case === 'auto_reloader') { + if (message.gun_type?.$case === "auto_reloader") { obj.auto_reloader = GunDefinitionAutoReloader.toJSON( - message.gun_type.value, + message.gun_type.value ); } if (message.id !== 0) { @@ -2878,41 +2880,41 @@ export const GunDefinition: MessageFns = { }, create, I>>( - base?: I, + base?: I ): GunDefinition { return GunDefinition.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): GunDefinition { const message = createBaseGunDefinition(); if ( - object.gun_type?.$case === 'regular' && + object.gun_type?.$case === "regular" && object.gun_type?.value !== undefined && object.gun_type?.value !== null ) { message.gun_type = { - $case: 'regular', + $case: "regular", value: GunDefinitionRegular.fromPartial(object.gun_type.value), }; } if ( - object.gun_type?.$case === 'auto_loader' && + object.gun_type?.$case === "auto_loader" && object.gun_type?.value !== undefined && object.gun_type?.value !== null ) { message.gun_type = { - $case: 'auto_loader', + $case: "auto_loader", value: GunDefinitionAutoLoader.fromPartial(object.gun_type.value), }; } if ( - object.gun_type?.$case === 'auto_reloader' && + object.gun_type?.$case === "auto_reloader" && object.gun_type?.value !== undefined && object.gun_type?.value !== null ) { message.gun_type = { - $case: 'auto_reloader', + $case: "auto_reloader", value: GunDefinitionAutoReloader.fromPartial(object.gun_type.value), }; } @@ -2957,7 +2959,7 @@ function createBaseGunDefinitionRegular(): GunDefinitionRegular { export const GunDefinitionRegular: MessageFns = { encode( message: GunDefinitionRegular, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.reload !== 0) { writer.uint32(13).float(message.reload); @@ -2967,7 +2969,7 @@ export const GunDefinitionRegular: MessageFns = { decode( input: BinaryReader | Uint8Array, - length?: number, + length?: number ): GunDefinitionRegular { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); @@ -3008,12 +3010,12 @@ export const GunDefinitionRegular: MessageFns = { }, create, I>>( - base?: I, + base?: I ): GunDefinitionRegular { return GunDefinitionRegular.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): GunDefinitionRegular { const message = createBaseGunDefinitionRegular(); message.reload = object.reload ?? 0; @@ -3028,7 +3030,7 @@ function createBaseGunDefinitionAutoLoader(): GunDefinitionAutoLoader { export const GunDefinitionAutoLoader: MessageFns = { encode( message: GunDefinitionAutoLoader, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.clip_reload !== 0) { writer.uint32(13).float(message.clip_reload); @@ -3044,7 +3046,7 @@ export const GunDefinitionAutoLoader: MessageFns = { decode( input: BinaryReader | Uint8Array, - length?: number, + length?: number ): GunDefinitionAutoLoader { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); @@ -3115,12 +3117,12 @@ export const GunDefinitionAutoLoader: MessageFns = { }, create, I>>( - base?: I, + base?: I ): GunDefinitionAutoLoader { return GunDefinitionAutoLoader.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): GunDefinitionAutoLoader { const message = createBaseGunDefinitionAutoLoader(); message.clip_reload = object.clip_reload ?? 0; @@ -3137,7 +3139,7 @@ function createBaseBurst(): Burst { export const Burst: MessageFns = { encode( message: Burst, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.count !== 0) { writer.uint32(8).uint32(message.count); @@ -3218,7 +3220,7 @@ export const GunDefinitionAutoReloader: MessageFns = { encode( message: GunDefinitionAutoReloader, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { writer.uint32(10).fork(); for (const v of message.shell_reloads) { @@ -3236,7 +3238,7 @@ export const GunDefinitionAutoReloader: MessageFns = decode( input: BinaryReader | Uint8Array, - length?: number, + length?: number ): GunDefinitionAutoReloader { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); @@ -3317,12 +3319,12 @@ export const GunDefinitionAutoReloader: MessageFns = }, create, I>>( - base?: I, + base?: I ): GunDefinitionAutoReloader { return GunDefinitionAutoReloader.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): GunDefinitionAutoReloader { const message = createBaseGunDefinitionAutoReloader(); message.shell_reloads = object.shell_reloads?.map((e) => e) || []; @@ -3339,7 +3341,7 @@ function createBaseAssaultRanges(): AssaultRanges { export const AssaultRanges: MessageFns = { encode( message: AssaultRanges, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { for (const v of message.ranges) { AssaultRange.encode(v!, writer.uint32(10).fork()).join(); @@ -3418,12 +3420,12 @@ export const AssaultRanges: MessageFns = { }, create, I>>( - base?: I, + base?: I ): AssaultRanges { return AssaultRanges.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): AssaultRanges { const message = createBaseAssaultRanges(); message.ranges = @@ -3440,7 +3442,7 @@ function createBaseAssaultRange(): AssaultRange { export const AssaultRange: MessageFns = { encode( message: AssaultRange, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.distance !== 0) { writer.uint32(13).float(message.distance); @@ -3503,12 +3505,12 @@ export const AssaultRange: MessageFns = { }, create, I>>( - base?: I, + base?: I ): AssaultRange { return AssaultRange.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): AssaultRange { const message = createBaseAssaultRange(); message.distance = object.distance ?? 0; @@ -3525,7 +3527,7 @@ function createBaseShellDefinition(): ShellDefinition { armor_damage: 0, module_damage: 0, caliber: 0, - icon: '', + icon: "", penetration: undefined, type: 0, normalization: 0, @@ -3538,7 +3540,7 @@ function createBaseShellDefinition(): ShellDefinition { export const ShellDefinition: MessageFns = { encode( message: ShellDefinition, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.id !== 0) { writer.uint32(8).uint32(message.id); @@ -3558,13 +3560,13 @@ export const ShellDefinition: MessageFns = { if (message.caliber !== 0) { writer.uint32(53).float(message.caliber); } - if (message.icon !== '') { + if (message.icon !== "") { writer.uint32(58).string(message.icon); } if (message.penetration !== undefined) { ShellPenetration.encode( message.penetration, - writer.uint32(66).fork(), + writer.uint32(66).fork() ).join(); } if (message.type !== 0) { @@ -3659,7 +3661,7 @@ export const ShellDefinition: MessageFns = { message.penetration = ShellPenetration.decode( reader, - reader.uint32(), + reader.uint32() ); continue; } @@ -3724,7 +3726,7 @@ export const ShellDefinition: MessageFns = { ? globalThis.Number(object.module_damage) : 0, caliber: isSet(object.caliber) ? globalThis.Number(object.caliber) : 0, - icon: isSet(object.icon) ? globalThis.String(object.icon) : '', + icon: isSet(object.icon) ? globalThis.String(object.icon) : "", penetration: isSet(object.penetration) ? ShellPenetration.fromJSON(object.penetration) : undefined, @@ -3760,7 +3762,7 @@ export const ShellDefinition: MessageFns = { if (message.caliber !== 0) { obj.caliber = message.caliber; } - if (message.icon !== '') { + if (message.icon !== "") { obj.icon = message.icon; } if (message.penetration !== undefined) { @@ -3788,12 +3790,12 @@ export const ShellDefinition: MessageFns = { }, create, I>>( - base?: I, + base?: I ): ShellDefinition { return ShellDefinition.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): ShellDefinition { const message = createBaseShellDefinition(); message.id = object.id ?? 0; @@ -3805,7 +3807,7 @@ export const ShellDefinition: MessageFns = { message.armor_damage = object.armor_damage ?? 0; message.module_damage = object.module_damage ?? 0; message.caliber = object.caliber ?? 0; - message.icon = object.icon ?? ''; + message.icon = object.icon ?? ""; message.penetration = object.penetration !== undefined && object.penetration !== null ? ShellPenetration.fromPartial(object.penetration) @@ -3826,7 +3828,7 @@ function createBaseShellPenetration(): ShellPenetration { export const ShellPenetration: MessageFns = { encode( message: ShellPenetration, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.near !== 0) { writer.uint32(13).float(message.near); @@ -3889,12 +3891,12 @@ export const ShellPenetration: MessageFns = { }, create, I>>( - base?: I, + base?: I ): ShellPenetration { return ShellPenetration.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): ShellPenetration { const message = createBaseShellPenetration(); message.near = object.near ?? 0; @@ -3910,7 +3912,7 @@ function createBaseUnlock(): Unlock { export const Unlock: MessageFns = { encode( message: Unlock, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.id !== 0) { writer.uint32(8).int32(message.id); @@ -4003,15 +4005,15 @@ export const Unlock: MessageFns = { }; function createBaseUnlockCost(): UnlockCost { - return { type: '', value: 0 }; + return { type: "", value: 0 }; } export const UnlockCost: MessageFns = { encode( message: UnlockCost, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { - if (message.type !== '') { + if (message.type !== "") { writer.uint32(10).string(message.type); } if (message.value !== 0) { @@ -4055,14 +4057,14 @@ export const UnlockCost: MessageFns = { fromJSON(object: any): UnlockCost { return { - type: isSet(object.type) ? globalThis.String(object.type) : '', + type: isSet(object.type) ? globalThis.String(object.type) : "", value: isSet(object.value) ? globalThis.Number(object.value) : 0, }; }, toJSON(message: UnlockCost): unknown { const obj: any = {}; - if (message.type !== '') { + if (message.type !== "") { obj.type = message.type; } if (message.value !== 0) { @@ -4075,10 +4077,10 @@ export const UnlockCost: MessageFns = { return UnlockCost.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( - object: I, + object: I ): UnlockCost { const message = createBaseUnlockCost(); - message.type = object.type ?? ''; + message.type = object.type ?? ""; message.value = object.value ?? 0; return message; }, @@ -4091,7 +4093,7 @@ function createBaseCrew(): Crew { export const Crew: MessageFns = { encode( message: Crew, - writer: BinaryWriter = new BinaryWriter(), + writer: BinaryWriter = new BinaryWriter() ): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); @@ -4203,7 +4205,7 @@ export type DeepPartial = T extends Builtin : T extends ReadonlyArray ? ReadonlyArray> : T extends { $case: string; value: unknown } - ? { $case: T['$case']; value?: DeepPartial } + ? { $case: T["$case"]; value?: DeepPartial } : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; @@ -4216,7 +4218,7 @@ export type Exact = P extends Builtin }; function isObject(value: any): boolean { - return typeof value === 'object' && value !== null; + return typeof value === "object" && value !== null; } function isSet(value: any): boolean { diff --git a/packages/scripts/package.json b/packages/scripts/package.json index ae0baf488..cc1069e59 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -1,7 +1,32 @@ { "name": "@blitzkit/scripts", + "dependencies": { + "@blitzkit/closed": "workspace:*", + "@blitzkit/core": "workspace:*", + "@blitzkit/i18n": "workspace:*", + "@gltf-transform/core": "^4.2.1", + "@gltf-transform/extensions": "^4.2.1", + "@gltf-transform/functions": "^4.2.1", + "@types/bun": "^1.3.0", + "@types/decompress": "^4.2.7", + "@types/lodash-es": "^4.17.12", + "@types/lz4js": "^0.2.1", + "@types/progress": "^2.0.7", + "@types/three": "^0.180.0", + "crc": "^4.3.2", + "csv-parse": "^6.1.0", + "decompress": "^4.2.1", + "dotenv": "^17.2.3", + "esbuild": "^0.25.10", + "fast-xml-parser": "^5.2.5", + "lodash-es": "^4.17.21", + "lz4js": "^0.2.0", + "progress": "^2.0.3", + "puppeteer": "^24.22.3", + "three": "^0.180.0", + "ts-proto": "^2.7.7" + }, "private": true, - "type": "module", "scripts": { "build:assets": "bun src/buildAssets/index.ts", "build:averages": "bun src/averages.ts", @@ -15,26 +40,5 @@ "prunestrings": "bun src/pruneStrings.ts", "build:protos": "bun src/protos.ts" }, - "dependencies": { - "@blitzkit/closed": "workspace:*", - "@blitzkit/core": "workspace:*", - "@blitzkit/i18n": "workspace:*", - "@gltf-transform/core": "^4.2.1", - "@gltf-transform/extensions": "^4.2.1", - "@gltf-transform/functions": "^4.2.1", - "@types/lz4js": "^0.2.1", - "crc": "^4.3.2", - "csv-parse": "^6.1.0", - "decompress": "^4.2.1", - "esbuild": "^0.25.10", - "fast-xml-parser": "^5.2.5", - "lz4js": "^0.2.0", - "progress": "^2.0.3", - "puppeteer": "^24.22.3", - "ts-proto": "^2.7.7" - }, - "devDependencies": { - "@types/decompress": "^4.2.7", - "@types/progress": "^2.0.7" - } + "type": "module" } diff --git a/packages/scripts/src/buildAssets/index.ts b/packages/scripts/src/buildAssets/index.ts index 5c090e6da..fc9db72c2 100644 --- a/packages/scripts/src/buildAssets/index.ts +++ b/packages/scripts/src/buildAssets/index.ts @@ -1,33 +1,32 @@ -import { config } from 'dotenv'; -import { argv } from 'process'; +import { config } from "dotenv"; +import { argv } from "process"; config(); -const allTargets = argv.includes('--all-targets'); +const allTargets = argv.includes("--all-targets"); const targets = argv - .find((argument) => argument.startsWith('--target')) - ?.split('=')[1] - .split(','); + .find((argument) => argument.startsWith("--target")) + ?.split("=")[1] + .split(","); -import { blitzkitTankIcons } from './blitzkitTankIcons'; -import { boosterIcons } from './boosterIcons'; -import { camouflageIcons } from './camouflageIcons'; -import { consumableProvisionIcons } from './consumableProvisionIcons'; -import { currencies } from './currencies'; -import { definitions } from './definitions'; -import { equipmentIcons } from './equipmentIcons'; -import { flags } from './flags'; -import { gameModeBanners } from './gameModeBanners'; -import { glossary } from './glossary'; -import { migration } from './migration'; -import { moduleIcons } from './moduleIcons'; -import { shellIcons } from './shellIcons'; -import { skillIcons } from './skillIcons'; -import { tankArmors } from './tankArmors'; -import { tankIcons } from './tankIcons'; -import { tankModels } from './tankModels'; +import { boosterIcons } from "./boosterIcons"; +import { camouflageIcons } from "./camouflageIcons"; +import { consumableProvisionIcons } from "./consumableProvisionIcons"; +import { currencies } from "./currencies"; +import { definitions } from "./definitions"; +import { equipmentIcons } from "./equipmentIcons"; +import { flags } from "./flags"; +import { gameModeBanners } from "./gameModeBanners"; +import { glossary } from "./glossary"; +import { migration } from "./migration"; +import { moduleIcons } from "./moduleIcons"; +import { shellIcons } from "./shellIcons"; +import { skillIcons } from "./skillIcons"; +import { tankArmors } from "./tankArmors"; +import { tankIcons } from "./tankIcons"; +import { tankModels } from "./tankModels"; -if (!targets && !allTargets) throw new Error('No target(s) specified'); +if (!targets && !allTargets) throw new Error("No target(s) specified"); const methods = [ migration, diff --git a/packages/scripts/src/buildRatingLeaderboard.ts b/packages/scripts/src/buildRatingLeaderboard.ts index edadf6762..bfa23427c 100644 --- a/packages/scripts/src/buildRatingLeaderboard.ts +++ b/packages/scripts/src/buildRatingLeaderboard.ts @@ -10,18 +10,18 @@ import { Region, REGIONS, regionToRegionSubdomain, -} from '@blitzkit/core'; -import { chunk } from 'lodash'; -import { argv } from 'process'; -import { commitAssets } from './core/github/commitAssets'; -import { FileChange } from './core/github/commitMultipleFiles'; +} from "@blitzkit/core"; +import { chunk } from "lodash-es"; +import { argv } from "process"; +import { commitAssets } from "./core/github/commitAssets"; +import { FileChange } from "./core/github/commitMultipleFiles"; const region = argv - .find((arg) => arg.startsWith('--region=')) - ?.split('=')[1] as Region | undefined; + .find((arg) => arg.startsWith("--region=")) + ?.split("=")[1] as Region | undefined; if (region === undefined || !REGIONS.includes(region)) { - throw new Error('No valid region specified'); + throw new Error("No valid region specified"); } console.log(`Building rating leaderboard for ${region}`); @@ -29,11 +29,11 @@ console.log(`Building rating leaderboard for ${region}`); const regionSubdomain = regionToRegionSubdomain(region); const NEIGHBORS = 2 ** 8; const PLAYERS = await patientFetchJSON( - `https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/season/`, + `https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/season/` ).then((data) => (data.detail === undefined ? data.count : undefined)); if (PLAYERS === undefined) { - throw new Error('No current rating season running'); + throw new Error("No current rating season running"); } const players: Record = {}; @@ -43,7 +43,7 @@ let registered = 0; async function branchFromPlayer(id: number) { const { neighbors } = await patientFetchJSON( - `https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/user/${id}/?neighbors=${NEIGHBORS}`, + `https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/user/${id}/?neighbors=${NEIGHBORS}` ); const firstPlayer = neighbors[0]; @@ -66,7 +66,7 @@ async function branchFromPlayer(id: number) { `Registered ${registered} / ${PLAYERS} (${( (registered / PLAYERS!) * 100 - ).toFixed(2)}%)`, + ).toFixed(2)}%)` ); await Promise.all(branches); @@ -74,7 +74,7 @@ async function branchFromPlayer(id: number) { async function branchFromLeague(id: number) { const { result } = await patientFetchJSON<{ result: RatingPlayer[] }>( - `https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/league/${id}/top/`, + `https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/league/${id}/top/` ); const firstPlayer = result[0]; @@ -86,7 +86,7 @@ async function branchFromLeague(id: number) { ]); } -console.log('Branching from leagues...'); +console.log("Branching from leagues..."); await Promise.all([ branchFromLeague(0), branchFromLeague(1), @@ -95,7 +95,7 @@ await Promise.all([ branchFromLeague(4), ]); -console.log('Converting to an array...'); +console.log("Converting to an array..."); for (let index = 0; index < PLAYERS; index++) { const listing = players[index + 1]; if (listing) { @@ -106,18 +106,18 @@ for (let index = 0; index < PLAYERS; index++) { } } -console.log('Requesting further stats...'); +console.log("Requesting further stats..."); const entries: RatingLeaderboardEntryV2[] = []; let chunkIndex = 0; for (const leaderboardChunk of chunk(entriesV1, 100)) { console.log( - `Chunk ${chunkIndex + 1} of ${Math.ceil(entriesV1.length / 100)}`, + `Chunk ${chunkIndex + 1} of ${Math.ceil(entriesV1.length / 100)}` ); const stats = await getAccountInfo( region, leaderboardChunk.map(({ id }) => id), - ['statistics.rating'], + ["statistics.rating"] ); stats.forEach((stat, index) => { @@ -153,12 +153,12 @@ for (const leaderboardChunk of chunk(entriesV1, 100)) { } const info = await patientFetchJSON( - `https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/season/`, + `https://${regionSubdomain}.wotblitz.com/en/api/rating-leaderboards/season/` ); -const normalizedServer = regionSubdomain === 'na' ? 'com' : regionSubdomain; +const normalizedServer = regionSubdomain === "na" ? "com" : regionSubdomain; const content = RatingLeaderboard.encode({ - version: { $case: 'v2', value: { entries } }, + version: { $case: "v2", value: { entries } }, }).finish(); const changes: FileChange[] = [