Compare commits

...
17 Commits
Author SHA1 Message Date
TrèsAbhi 5dce234447 fix: dvp 2025-10-12 14:12:47 -05:00
TrèsAbhi 0f609717d0 adjacent 2025-10-12 13:40:32 -05:00
TrèsAbhi 3958709348 fix: adjacent submodule 2025-10-12 13:39:03 -05:00
TrèsAbhi 2d869c9fac Remove submodule submodules/blitzkit-closed 2025-10-12 13:36:15 -05:00
TrèsAbhi 82afaf9494 fix: lz4js 2025-10-12 13:24:03 -05:00
TrèsAbhi b1d82e624a fix: crc 2025-10-12 13:12:10 -05:00
TrèsAbhi 9b60d56a36 fix: immer 2025-10-12 12:26:19 -05:00
TrèsAbhi ee0d4f6996 fix: varuna 2025-10-12 17:22:26 +00:00
TrèsAbhi 2d43408822 fix: remove closed 2025-10-12 17:21:18 +00:00
TrèsAbhi 868f132105 fix: core and closed dep 2025-10-12 17:20:33 +00:00
TrèsAbhi ce428e093b fix: i18n dep 2025-10-12 17:18:39 +00:00
TrèsAbhi ab430dc0ca fix: bot imports 2025-10-12 17:17:05 +00:00
TrèsAbhi 03a51c47bb fix: self core imports 2025-10-12 15:05:58 +00:00
TrèsAbhi 1790443698 feat: rename 2025-10-12 09:51:21 -05:00
TrèsAbhi a60f95340c fix: deps 2025-10-12 09:49:31 -05:00
TrèsAbhi e407463ca7 New Crowdin updates (#173) 2025-10-12 09:47:24 -05:00
TrèsAbhi 61cc15aafc Update package.json 2025-10-12 09:38:02 -05:00
55 changed files with 352 additions and 281 deletions

No files matched your search

+3 -3
View File
@@ -1,4 +1,4 @@
name: Build Assets
name: Assets
on:
push:
@@ -21,7 +21,7 @@ on:
description: Root dir of ZIP which houses the executable and Data dir
schedule:
- cron: '0 2 * * *'
- cron: "0 2 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.cdn_branch }}
@@ -67,7 +67,7 @@ jobs:
with:
root-reserve-mb: 512
swap-size-mb: 1024
remove-dotnet: 'true'
remove-dotnet: "true"
- uses: actions/checkout@v4
with:
+1 -1
View File
@@ -1,4 +1,4 @@
name: Build Bot
name: Bot
on:
push:
+2 -2
View File
@@ -1,9 +1,9 @@
name: Discover IDs
name: IDs
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 1'
- cron: "0 0 * * 1"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
+2 -2
View File
@@ -1,10 +1,10 @@
name: Host Bot
name: Host
on:
push:
branches: main
schedule:
- cron: '0 */5 * * *'
- cron: "0 */5 * * *"
workflow_dispatch:
release:
types: [created, published, released, edited]
+1 -1
View File
@@ -5,7 +5,7 @@ on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'
- cron: "0 4 * * *"
permissions:
contents: read
+3 -3
View File
@@ -1,9 +1,9 @@
[submodule "submodules/blitzkit-closed"]
path = submodules/blitzkit-closed
url = https://github.com/tresabhi/blitzkit-closed
[submodule "submodules/CUE4Parse"]
path = submodules/CUE4Parse
url = https://github.com/FabianFG/CUE4Parse
[submodule "submodules/blitzkit-internal"]
path = submodules/blitzkit-internal
url = https://github.com/blitzkit/internal
[submodule "packages/closed"]
path = packages/closed
url = https://github.com/blitzkit/closed.git
+42 -5
View File
@@ -4,6 +4,7 @@
"": {
"name": "blitzkit",
"dependencies": {
"@prisma/client": "^6.17.1",
"@types/xmpp__client": "^0.13.3",
"@xmpp/client": "^0.13.6",
"astro-favicons": "^3.1.5",
@@ -13,6 +14,7 @@
"protobufjs": "^7.5.4",
"quicklime": "^1.2.0",
"sharp": "^0.34.4",
"yaml": "^2.8.1",
},
"devDependencies": {
"@types/bun": "^1.2.22",
@@ -45,6 +47,7 @@
"dotenv": "^17.2.2",
"fuzzysort": "^3.1.0",
"markdown-escape": "^2.0.0",
"prisma": "^6.17.1",
"react": "^19.1.1",
"satori": "^0.18.3",
},
@@ -52,25 +55,35 @@
"@types/markdown-escape": "^1.1.3",
},
},
"packages/closed": {
"name": "@blitzkit/closed",
"dependencies": {
"@blitzkit/core": "workspace:*",
"@types/lz4js": "^0.2.1",
"lz4js": "^0.2.0",
},
},
"packages/core": {
"name": "@blitzkit/core",
"dependencies": {
"@blitzkit/i18n": "workspace:*",
"@bufbuild/protobuf": "^2.9.0",
"@octokit/plugin-throttling": "^11.0.1",
"@octokit/rest": "^22.0.0",
"@prisma/client": "^6.16.2",
"@types/adm-zip": "^0.5.7",
"@types/lz4js": "^0.2.1",
"@types/three": "^0.180.0",
"adm-zip": "^0.5.16",
"crc": "^4.3.2",
"dotenv": "^17.2.2",
"lz4js": "^0.2.0",
"pickleparser": "^0.2.1",
"protobufjs": "^7.5.4",
"three": "^0.180.0",
"ts-proto": "^2.7.7",
"yaml": "^2.8.1",
},
"devDependencies": {
"@types/adm-zip": "^0.5.7",
"@types/lz4js": "^0.2.1",
},
},
"packages/i18n": {
"name": "@blitzkit/i18n",
@@ -81,15 +94,19 @@
"packages/scripts": {
"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/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",
},
@@ -101,6 +118,7 @@
"packages/varuna": {
"name": "varuna",
"dependencies": {
"immer": "^10.1.3",
"react": "^19.1.1",
},
},
@@ -111,6 +129,8 @@
"@astrojs/node": "^9.4.4",
"@astrojs/react": "^4.4.0",
"@astrolib/seo": "^1.0.0-beta.8",
"@blitzkit/core": "workspace:*",
"@blitzkit/i18n": "workspace:*",
"@fontsource/inter": "^5.2.8",
"@radix-ui/colors": "^3.0.0",
"@radix-ui/react-icons": "^1.3.2",
@@ -135,6 +155,7 @@
"three-stdlib": "^2.36.0",
"typescript": "^5.9.2",
"urlon": "^3.1.0",
"varuna": "workspace:*",
},
},
},
@@ -361,6 +382,8 @@
"@blitzkit/bot": ["@blitzkit/bot@workspace:packages/bot"],
"@blitzkit/closed": ["@blitzkit/closed@workspace:packages/closed"],
"@blitzkit/core": ["@blitzkit/core@workspace:packages/core"],
"@blitzkit/i18n": ["@blitzkit/i18n@workspace:packages/i18n"],
@@ -569,7 +592,7 @@
"@oslojs/encoding": ["@oslojs/[email protected]", "", {}, "sha512-70wQhgYmndg4GCPxPPxPGevRKqTIJ2Nh4OkiMWmDAVYsTQ+Ta7Sq+rPevXyXGdzr30/qZBnyOalCszoMxlyldQ=="],
"@prisma/client": ["@prisma/[email protected]6.2", "", { "peerDependencies": { "prisma": "*", "typescript": ">=5.1.0" }, "optionalPeers": ["prisma", "typescript"] }, "sha512-E00PxBcalMfYO/TWnXobBVUai6eW/g5OsifWQsQDzJYm7yaY+IRLo7ZLsaefi0QkTpxfuhFcQ/w180i6kX3iJw=="],
"@prisma/client": ["@prisma/[email protected]7.1", "", { "peerDependencies": { "prisma": "*", "typescript": ">=5.1.0" }, "optionalPeers": ["prisma", "typescript"] }, "sha512-zL58jbLzYamjnNnmNA51IOZdbk5ci03KviXCuB0Tydc9btH2kDWsi1pQm2VecviRTM7jGia0OPPkgpGnT3nKvw=="],
"@prisma/config": ["@prisma/[email protected]", "", { "dependencies": { "c12": "3.1.0", "deepmerge-ts": "7.1.5", "effect": "3.16.12", "empathic": "2.0.0" } }, "sha512-mKXSUrcqXj0LXWPmJsK2s3p9PN+aoAbyMx7m5E1v1FufofR1ZpPoIArjjzOIm+bJRLLvYftoNYLx1tbHgF9/yg=="],
@@ -2739,6 +2762,8 @@
"@blitzkit/app/typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw=="],
"@blitzkit/bot/prisma": ["[email protected]", "", { "dependencies": { "@prisma/config": "6.17.1", "@prisma/engines": "6.17.1" }, "peerDependencies": { "typescript": ">=5.1.0" }, "optionalPeers": ["typescript"], "bin": { "prisma": "build/index.js" } }, "sha512-ac6h0sM1Tg3zu8NInY+qhP/S9KhENVaw9n1BrGKQVFu05JT5yT5Qqqmb8tMRIE3ZXvVj4xcRA5yfrsy4X7Yy5g=="],
"@discordjs/rest/@discordjs/collection": ["@discordjs/[email protected]", "", {}, "sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg=="],
"@discordjs/rest/undici": ["[email protected]", "", {}, "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw=="],
@@ -2889,6 +2914,10 @@
"@babel/register/make-dir/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver" } }, "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g=="],
"@blitzkit/bot/prisma/@prisma/config": ["@prisma/[email protected]", "", { "dependencies": { "c12": "3.1.0", "deepmerge-ts": "7.1.5", "effect": "3.16.12", "empathic": "2.0.0" } }, "sha512-fs8wY6DsvOCzuiyWVckrVs1LOcbY4LZNz8ki4uUIQ28jCCzojTGqdLhN2Jl5lDnC1yI8/gNIKpsWDM8pLhOdwA=="],
"@blitzkit/bot/prisma/@prisma/engines": ["@prisma/[email protected]", "", { "dependencies": { "@prisma/debug": "6.17.1", "@prisma/engines-version": "6.17.1-1.272a37d34178c2894197e17273bf937f25acdeac", "@prisma/fetch-engine": "6.17.1", "@prisma/get-platform": "6.17.1" } }, "sha512-D95Ik3GYZkqZ8lSR4EyFOJ/tR33FcYRP8kK61o+WMsyD10UfJwd7+YielflHfKwiGodcqKqoraWw8ElAgMDbPw=="],
"@octokit/core/@octokit/types/@octokit/openapi-types": ["@octokit/[email protected]", "", {}, "sha512-7AtcfKtpo77j7Ts73b4OWhOZHTKo/gGY8bB3bNBQz4H+GRSWqx2yvj8TXRsbdTE0eRmYmXOEY66jM7mJ7LzfsA=="],
"@octokit/plugin-rest-endpoint-methods/@octokit/types/@octokit/openapi-types": ["@octokit/[email protected]", "", {}, "sha512-7AtcfKtpo77j7Ts73b4OWhOZHTKo/gGY8bB3bNBQz4H+GRSWqx2yvj8TXRsbdTE0eRmYmXOEY66jM7mJ7LzfsA=="],
@@ -2969,6 +2998,14 @@
"@babel/cli/chokidar/readdirp/picomatch": ["[email protected]", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
"@blitzkit/bot/prisma/@prisma/engines/@prisma/debug": ["@prisma/[email protected]", "", {}, "sha512-Vf7Tt5Wh9XcndpbmeotuqOMLWPTjEKCsgojxXP2oxE1/xYe7PtnP76hsouG9vis6fctX+TxgmwxTuYi/+xc7dQ=="],
"@blitzkit/bot/prisma/@prisma/engines/@prisma/engines-version": ["@prisma/engines-version@6.17.1-1.272a37d34178c2894197e17273bf937f25acdeac", "", {}, "sha512-17140E3huOuD9lMdJ9+SF/juOf3WR3sTJMVyyenzqUPbuH+89nPhSWcrY+Mf7tmSs6HvaO+7S+HkELinn6bhdg=="],
"@blitzkit/bot/prisma/@prisma/engines/@prisma/fetch-engine": ["@prisma/[email protected]", "", { "dependencies": { "@prisma/debug": "6.17.1", "@prisma/engines-version": "6.17.1-1.272a37d34178c2894197e17273bf937f25acdeac", "@prisma/get-platform": "6.17.1" } }, "sha512-AYZiHOs184qkDMiTeshyJCtyL4yERkjfTkJiSJdYuSfc24m94lTNL5+GFinZ6vVz+ktX4NJzHKn1zIFzGTWrWg=="],
"@blitzkit/bot/prisma/@prisma/engines/@prisma/get-platform": ["@prisma/[email protected]", "", { "dependencies": { "@prisma/debug": "6.17.1" } }, "sha512-AKEn6fsfz0r482S5KRDFlIGEaq9wLNcgalD1adL+fPcFFblIKs1sD81kY/utrHdqKuVC6E1XSRpegDK3ZLL4Qg=="],
"boxen/string-width/strip-ansi/ansi-regex": ["[email protected]", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="],
"cross-fetch/node-fetch/whatwg-url/tr46": ["[email protected]", "", {}, "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="],
+4 -2
View File
@@ -12,7 +12,7 @@
"build:assets": "cd packages/scripts && bun run build:assets",
"build:averages": "bun --filter=@blitzkit/scripts run build:averages",
"build:bot": "cd packages/scripts && bun run build:bot",
"build:website": "bun build:prisma --no-hints && cd packages/website && bun run build",
"build:website": "bun build:prisma && cd packages/website && bun run build",
"build:prisma": "prisma generate",
"build:sitemap": "bun scripts/sitemap.ts",
"build:docs": "vitepress build docs",
@@ -44,6 +44,7 @@
},
"license": "MIT",
"dependencies": {
"@prisma/client": "^6.17.1",
"@types/xmpp__client": "^0.13.3",
"@xmpp/client": "^0.13.6",
"astro-favicons": "^3.1.5",
@@ -52,7 +53,8 @@
"lodash-es": "^4.17.21",
"protobufjs": "^7.5.4",
"quicklime": "^1.2.0",
"sharp": "^0.34.4"
"sharp": "^0.34.4",
"yaml": "^2.8.1"
},
"devDependencies": {
"@types/bun": "^1.2.22",
+7 -6
View File
@@ -6,15 +6,16 @@
"dependencies": {
"@blitzkit/core": "workspace:*",
"@blitzkit/i18n": "workspace:*",
"satori": "^0.18.3",
"@resvg/resvg-js": "^2.6.2",
"discord.js": "^14.22.1",
"react": "^19.1.1",
"@radix-ui/colors": "^3.0.0",
"fuzzysort": "^3.1.0",
"@resvg/resvg-js": "^2.6.2",
"bepaint": "^0.1.0-beta.3",
"discord.js": "^14.22.1",
"dotenv": "^17.2.2",
"markdown-escape": "^2.0.0"
"fuzzysort": "^3.1.0",
"markdown-escape": "^2.0.0",
"prisma": "^6.17.1",
"react": "^19.1.1",
"satori": "^0.18.3"
},
"scripts": {
"dev": "bun --watch src/main.ts",
+1
Submodule packages/closed added at 1caf47f66d.
+6 -4
View File
@@ -4,20 +4,22 @@
"type": "module",
"main": "src/index.ts",
"dependencies": {
"@blitzkit/i18n": "workspace:*",
"@bufbuild/protobuf": "^2.9.0",
"@octokit/plugin-throttling": "^11.0.1",
"@octokit/rest": "^22.0.0",
"@prisma/client": "^6.16.2",
"@types/adm-zip": "^0.5.7",
"@types/lz4js": "^0.2.1",
"@types/three": "^0.180.0",
"adm-zip": "^0.5.16",
"crc": "^4.3.2",
"dotenv": "^17.2.2",
"lz4js": "^0.2.0",
"pickleparser": "^0.2.1",
"protobufjs": "^7.5.4",
"three": "^0.180.0",
"ts-proto": "^2.7.7",
"yaml": "^2.8.1"
},
"devDependencies": {
"@types/adm-zip": "^0.5.7",
"@types/lz4js": "^0.2.1"
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
import { type ShellDefinition, ShellType } from '@blitzkit/core';
import { ShellDefinition, ShellType } from "../protos";
export function canSplash(type: ShellDefinition['type']): type is ShellType.HE {
export function canSplash(type: ShellDefinition["type"]): type is ShellType.HE {
return type === ShellType.HE;
}
+1 -1
View File
@@ -1,4 +1,4 @@
import { BlitzStats, calculateWN8 } from '@blitzkit/core';
import { BlitzStats, calculateWN8 } from "../statistics";
export type Stat = keyof ReturnType<typeof generateStats>;
@@ -1,5 +1,6 @@
import { fetchBlitz, Region } from '@blitzkit/core';
import { normalizeIds } from './normalizeIds';
import { fetchBlitz } from "./fetchBlitz";
import { normalizeIds } from "./normalizeIds";
import { Region } from "./regions";
interface IndividualAccountAchievements {
achievements: {
@@ -22,11 +23,11 @@ export async function getAccountAchievements<
>(region: Region, ids: Ids) {
const object = await fetchBlitz<AccountAchievements>(
region,
'account/achievements',
{ account_id: normalizeIds(ids) },
"account/achievements",
{ account_id: normalizeIds(ids) }
);
if (typeof ids === 'number') {
if (typeof ids === "number") {
return object[ids as number] as ReturnType;
} else {
return ids.map((id) => object[id]) as ReturnType;
+8 -11
View File
@@ -1,10 +1,7 @@
import {
BlitzStats,
FetchBlitzParams,
Region,
fetchBlitz,
} from '@blitzkit/core';
import { normalizeIds } from './normalizeIds';
import { BlitzStats } from "../statistics";
import { FetchBlitzParams, fetchBlitz } from "./fetchBlitz";
import { normalizeIds } from "./normalizeIds";
import { Region } from "./regions";
export interface SupplementaryStats {
WN8?: number;
@@ -83,15 +80,15 @@ export async function getAccountInfo<
region: Region,
ids: Ids,
extra: string[] = [],
params: FetchBlitzParams = {},
params: FetchBlitzParams = {}
) {
const object = await fetchBlitz<AccountInfo>(region, 'account/info', {
const object = await fetchBlitz<AccountInfo>(region, "account/info", {
account_id: normalizeIds(ids),
extra: extra.length === 0 ? undefined : extra.join(','),
extra: extra.length === 0 ? undefined : extra.join(","),
...params,
});
if (typeof ids === 'number') {
if (typeof ids === "number") {
return object[ids as number] as ReturnType;
} else {
return ids.map((id) => object[id]) as ReturnType;
@@ -1,5 +1,6 @@
import { fetchBlitz, Region } from '@blitzkit/core';
import { normalizeIds } from './normalizeIds';
import { fetchBlitz } from "./fetchBlitz";
import { normalizeIds } from "./normalizeIds";
import { Region } from "./regions";
type IndividualClanAccountInfo = {
account_id: number;
@@ -30,14 +31,14 @@ export async function getClanAccountInfo<
>(region: Region, ids: Ids, extra: string[] = []) {
const object = await fetchBlitz<ClanAccountInfo>(
region,
'clans/accountinfo',
"clans/accountinfo",
{
account_id: normalizeIds(ids),
extra: extra.length === 0 ? undefined : extra.join(','),
},
extra: extra.length === 0 ? undefined : extra.join(","),
}
);
if (typeof ids === 'number') {
if (typeof ids === "number") {
return object[ids as number] as ReturnType;
} else {
return ids.map((id) => object[id]) as ReturnType;
+5 -4
View File
@@ -1,5 +1,6 @@
import { fetchBlitz, Region } from '@blitzkit/core';
import { normalizeIds } from './normalizeIds';
import { fetchBlitz } from "./fetchBlitz";
import { normalizeIds } from "./normalizeIds";
import { Region } from "./regions";
interface IndividualClanInfo {
recruiting_options: {
@@ -38,11 +39,11 @@ export async function getClanInfo<
Ids extends number | number[],
ReturnType = Ids extends number ? IndividualClanInfo : IndividualClanInfo[],
>(region: Region, ids: Ids) {
const object = await fetchBlitz<ClanInfo>(region, 'clans/info', {
const object = await fetchBlitz<ClanInfo>(region, "clans/info", {
clan_id: normalizeIds(ids),
});
if (typeof ids === 'number') {
if (typeof ids === "number") {
return object[ids as number] as ReturnType;
} else {
return ids.map((id) => object[id]) as ReturnType;
@@ -1,4 +1,4 @@
import { LEAGUES } from '@blitzkit/core';
import { LEAGUES } from "./rating";
export function getLeagueFromScore(score: number) {
return LEAGUES.find(({ minScore }) => score >= minScore)!;
+8 -7
View File
@@ -1,7 +1,8 @@
import { RatingLeague, RatingReward, Region } from '@blitzkit/core';
import { context } from '../blitzkit/context';
import { patientFetch } from '../blitzkit/patientFetch';
import { regionToRegionSubdomain } from './regionToRegionSubdomain';
import { context } from "../blitzkit/context";
import { patientFetch } from "../blitzkit/patientFetch";
import { RatingLeague, RatingReward } from "./rating";
import { Region } from "./regions";
import { regionToRegionSubdomain } from "./regionToRegionSubdomain";
export type RatingInfo =
| {
@@ -26,12 +27,12 @@ export async function getRatingInfo(region: Region) {
if (cache[region]) return cache[region]!;
const response = await patientFetch(
context === 'website'
context === "website"
? `/api/${region}/rating/current/info`
: `https://${regionToRegionSubdomain(
region,
region
)}.wotblitz.com/en/api/rating-leaderboards/season/`,
undefined,
undefined
);
const data = (await response.json()) as RatingInfo;
+13 -11
View File
@@ -1,27 +1,29 @@
import { LeagueTop, RatingPlayer, Region } from '@blitzkit/core';
import { context } from '../blitzkit/context';
import { patientFetch } from '../blitzkit/patientFetch';
import { regionToRegionSubdomain } from './regionToRegionSubdomain';
import { context } from "../blitzkit/context";
import { patientFetch } from "../blitzkit/patientFetch";
import { RatingPlayer } from "../statistics";
import { LeagueTop } from "./rating";
import { Region } from "./regions";
import { regionToRegionSubdomain } from "./regionToRegionSubdomain";
export async function getRatingLeague(
region: Region,
league: number,
usePatientFetcher = false,
usePatientFetcher = false
) {
const fetcher = (url: string) =>
usePatientFetcher
? patientFetch(url, undefined, { cache: 'no-store' })
: fetch(url, { cache: 'no-store' });
? patientFetch(url, undefined, { cache: "no-store" })
: fetch(url, { cache: "no-store" });
const response = await fetcher(
context === 'website'
context === "website"
? `/api/${region}/rating/current/league/${league}`
: `https://${regionToRegionSubdomain(
region,
)}.wotblitz.com/en/api/rating-leaderboards/league/${league}/top/`,
region
)}.wotblitz.com/en/api/rating-leaderboards/league/${league}/top/`
);
const json = await response.json();
return context === 'website'
return context === "website"
? (json as RatingPlayer[])
: (json as LeagueTop).result;
}
+11 -10
View File
@@ -1,24 +1,25 @@
import { RatingNeighbors, Region } from '@blitzkit/core';
import { patientFetch } from '../blitzkit/patientFetch';
import { withCORSProxy } from '../blitzkit/withCORSProxy';
import { regionToRegionSubdomain } from './regionToRegionSubdomain';
import { patientFetch } from "../blitzkit/patientFetch";
import { withCORSProxy } from "../blitzkit/withCORSProxy";
import { RatingNeighbors } from "./rating";
import { Region } from "./regions";
import { regionToRegionSubdomain } from "./regionToRegionSubdomain";
export async function getRatingNeighbors(
region: Region,
id: number,
count: number,
usePatientFetcher = false,
usePatientFetcher = false
) {
const fetcher = (url: string) =>
usePatientFetcher
? patientFetch(url, undefined, { cache: 'no-store' })
: fetch(url, { cache: 'no-store' });
? patientFetch(url, undefined, { cache: "no-store" })
: fetch(url, { cache: "no-store" });
const response = await fetcher(
withCORSProxy(
`https://${regionToRegionSubdomain(
region,
)}.wotblitz.com/en/api/rating-leaderboards/user/${id}/?neighbors=${count}`,
),
region
)}.wotblitz.com/en/api/rating-leaderboards/user/${id}/?neighbors=${count}`
)
);
const json = (await response.json()) as RatingNeighbors;
+5 -8
View File
@@ -1,16 +1,13 @@
import {
fetchBlitz,
FetchBlitzParams,
Region,
TanksStats,
} from '@blitzkit/core';
import { TanksStats } from "../types";
import { FetchBlitzParams, fetchBlitz } from "./fetchBlitz";
import { Region } from "./regions";
export async function getTankStats(
region: Region,
id: number,
params?: FetchBlitzParams,
params?: FetchBlitzParams
) {
const tankStats = await fetchBlitz<TanksStats>(region, 'tanks/stats', {
const tankStats = await fetchBlitz<TanksStats>(region, "tanks/stats", {
account_id: id,
...params,
});
@@ -1,6 +1,6 @@
import { getRatingInfo } from '@blitzkit/core';
import { getRatingInfo } from "./getRatingInfo";
export async function isOnGoingRatingSeason() {
const ratingInfo = await getRatingInfo('com');
const ratingInfo = await getRatingInfo("com");
return ratingInfo.detail === undefined;
}
+10 -8
View File
@@ -1,4 +1,6 @@
import { Region, assertSecret, idToRegion } from '@blitzkit/core';
import { assertSecret } from "../blitzkit";
import { idToRegion } from "./idToRegion";
import { Region } from "./regions";
export async function isValidBlitzId(id: number, token?: string) {
let region: Region;
@@ -11,20 +13,20 @@ export async function isValidBlitzId(id: number, token?: string) {
const json = await fetch(
`https://api.wotblitz.${region}/wotb/account/info/?account_id=${id}&application_id=${assertSecret(
import.meta.env.PUBLIC_WARGAMING_APPLICATION_ID,
import.meta.env.PUBLIC_WARGAMING_APPLICATION_ID
)}${
token === undefined ? '' : `&access_token=${token}`
}&fields=account_id%2C-account_id`,
token === undefined ? "" : `&access_token=${token}`
}&fields=account_id%2C-account_id`
).then(
(response) =>
response.json() as Promise<
| {
status: 'ok';
status: "ok";
data: Record<number, {} | null>;
}
| { status: 'error' }
>,
| { status: "error" }
>
);
return json.status === 'ok' && json.data[id] !== null;
return json.status === "ok" && json.data[id] !== null;
}
@@ -1,5 +1,5 @@
import { Region, RegionSubdomain } from '@blitzkit/core';
import { Region, RegionSubdomain } from "./regions";
export function regionSubdomainToRegion(regionDomain: RegionSubdomain): Region {
return regionDomain === 'na' ? 'com' : regionDomain;
return regionDomain === "na" ? "com" : regionDomain;
}
@@ -1,5 +1,5 @@
import { Region, RegionSubdomain } from '@blitzkit/core';
import { Region, RegionSubdomain } from "./regions";
export function regionToRegionSubdomain(regionDomain: Region): RegionSubdomain {
return regionDomain === 'com' ? 'na' : regionDomain;
return regionDomain === "com" ? "na" : regionDomain;
}
@@ -1,5 +1,6 @@
import { fetchBlitz, Region } from '@blitzkit/core';
import { ClanList } from './clans';
import { ClanList } from "./clans";
import { fetchBlitz } from "./fetchBlitz";
import { Region } from "./regions";
export async function searchClansAcrossRegions(search: string, limit = 25) {
const trimmed = search.trim();
@@ -10,38 +11,38 @@ export async function searchClansAcrossRegions(search: string, limit = 25) {
return (
await Promise.all([
fetchBlitz<ClanList>('com', 'clans/list', {
fetchBlitz<ClanList>("com", "clans/list", {
search,
limit: normalizedLimit,
}).then((value) =>
value
.map((account) => ({
...account,
region: 'com' as Region,
region: "com" as Region,
}))
.splice(0, normalizedLimit),
.splice(0, normalizedLimit)
),
fetchBlitz<ClanList>('eu', 'clans/list', {
fetchBlitz<ClanList>("eu", "clans/list", {
search,
limit: normalizedLimit,
}).then((value) =>
value
.map((account) => ({
...account,
region: 'eu' as Region,
region: "eu" as Region,
}))
.splice(0, normalizedLimit),
.splice(0, normalizedLimit)
),
fetchBlitz<ClanList>('asia', 'clans/list', {
fetchBlitz<ClanList>("asia", "clans/list", {
search,
limit: normalizedLimit,
}).then((value) =>
value
.map((account) => ({
...account,
region: 'asia' as Region,
region: "asia" as Region,
}))
.splice(0, normalizedLimit),
.splice(0, normalizedLimit)
),
])
)
@@ -1,6 +1,6 @@
import { Region } from '@blitzkit/core';
import { context } from '../blitzkit/context';
import { regionToRegionSubdomain } from './regionToRegionSubdomain';
import { context } from "../blitzkit/context";
import { Region } from "./regions";
import { regionToRegionSubdomain } from "./regionToRegionSubdomain";
type CurrentRatingPlayerSearch = Record<
number,
@@ -27,12 +27,12 @@ type CurrentRatingPlayerSearch = Record<
export async function searchCurrentRatingPlayers(region: Region, name: string) {
const encodedSearch = encodeURIComponent(name);
const response = await fetch(
context === 'website'
context === "website"
? `/api/${region}/rating/current/search/${encodedSearch}`
: `https://${regionToRegionSubdomain(
region,
region
)}.wotblitz.com/en/api/rating-leaderboards/search/?prefix=${encodedSearch}`,
{ cache: 'no-store' },
{ cache: "no-store" }
);
const accountList = (await response.json()) as CurrentRatingPlayerSearch;
@@ -1,4 +1,5 @@
import { fetchBlitz, Region } from '@blitzkit/core';
import { fetchBlitz } from '../fetchBlitz';
import { Region } from '../regions';
import { usernamePattern } from './constants';
export interface AccountListItem {
+1 -1
View File
@@ -1,4 +1,4 @@
import { NATION_IDS } from "@blitzkit/core";
import { NATION_IDS } from "./nations";
export function toUniqueId(nation: string, id: number) {
return (id << 8) + (NATION_IDS[nation] << 4) + 1;
@@ -1,16 +1,12 @@
import {
GunDefinition,
ProvisionDefinitions,
TankDefinition,
} from '@blitzkit/core';
import { checkConsumableProvisionInclusivity } from './checkConsumableProvisionInclusivity';
import { GunDefinition, ProvisionDefinitions, TankDefinition } from "../protos";
import { checkConsumableProvisionInclusivity } from "./checkConsumableProvisionInclusivity";
export function availableProvisions(
tank: TankDefinition,
gun: GunDefinition,
provisionDefinitions: ProvisionDefinitions,
provisionDefinitions: ProvisionDefinitions
) {
return Object.values(provisionDefinitions.provisions).filter((provision) =>
checkConsumableProvisionInclusivity(provision, tank, gun),
checkConsumableProvisionInclusivity(provision, tank, gun)
);
}
@@ -1,5 +1,5 @@
import { SkillDefinitions } from '@blitzkit/core';
import { permanentSkills } from '../blitz/permanentSkills';
import { SkillDefinitions } from "..";
import { permanentSkills } from "../blitz/permanentSkills";
export function createDefaultSkills(skillDefinitions: SkillDefinitions) {
const skills: Record<string, number> = {};
@@ -1,4 +1,5 @@
import { assertSecret, getRatingInfo } from '@blitzkit/core';
import { getRatingInfo } from "../blitz/getRatingInfo";
import { assertSecret } from "./assertSecret";
interface GitHubTrees {
tree: { path: string; url: string }[];
@@ -11,21 +12,21 @@ export async function getArchivedLatestSeasonNumber() {
return cachedLatestArchivedSeasonNumber;
}
const ratingInfo = await getRatingInfo('com');
const ratingInfo = await getRatingInfo("com");
if (ratingInfo.detail) {
const regionsURL = (
(await fetch(
`https://api.github.com/repos/tresabhi/${assertSecret(
import.meta.env.PUBLIC_ASSET_REPO,
)}/git/trees/main`,
import.meta.env.PUBLIC_ASSET_REPO
)}/git/trees/main`
).then((response) => response.json())) as GitHubTrees
).tree.find(({ path }) => path === 'regions')!.url;
).tree.find(({ path }) => path === "regions")!.url;
const comURL = (
(await fetch(regionsURL).then((response) =>
response.json(),
response.json()
)) as GitHubTrees
).tree.find(({ path }) => path === 'com')!.url;
).tree.find(({ path }) => path === "com")!.url;
const ratingURL = (
(await fetch(comURL).then((response) => response.json())) as {
tree: [{ url: string }];
@@ -36,7 +37,7 @@ export async function getArchivedLatestSeasonNumber() {
(await fetch(ratingURL).then((response) => response.json())) as {
tree: { path: string }[];
}
).tree.map(({ path }) => Number(path)),
).tree.map(({ path }) => Number(path))
);
cachedLatestArchivedSeasonNumber = latestSeason;
@@ -1,4 +1,6 @@
import { asset, RatingLeaderboard, Region } from '@blitzkit/core';
import { Region } from "../blitz/regions";
import { RatingLeaderboard } from "../protos";
import { asset } from "./asset";
const cache: Record<Region, Record<number, RatingLeaderboard>> = {
asia: {},
@@ -8,7 +10,7 @@ const cache: Record<Region, Record<number, RatingLeaderboard>> = {
export async function getArchivedRatingLeaderboard(
region: Region,
season: number,
season: number
) {
if (!cache[region][season]) {
const info = await fetch(asset(`regions/${region}/rating/${season}.pb`))
+1 -1
View File
@@ -1,4 +1,4 @@
import { Region } from '@blitzkit/core';
import { Region } from "../blitz/regions";
const TIME_ZONE_MAPPINGS: Record<Region, number> = {
com: -5, // Central North American Time
+2 -2
View File
@@ -1,7 +1,7 @@
import { ShellDefinition, ShellType } from '@blitzkit/core';
import { ShellDefinition, ShellType } from "../protos";
export function isExplosive(
type: ShellDefinition['type'],
type: ShellDefinition["type"]
): type is ShellType.HEAT | ShellType.HE {
return type === ShellType.HEAT || type === ShellType.HE;
}
@@ -1,4 +1,5 @@
import { BoundingBox, Vector3 } from '@blitzkit/core';
import { Vector3 } from "three";
import { BoundingBox } from "../protos";
export function normalizeBoundingBox(boundingBox: BoundingBox) {
return {
+1 -1
View File
@@ -1,4 +1,4 @@
import { BKNI_COLORS, BkniPercentile, getBkniPercentile } from '@blitzkit/core';
import { BKNI_COLORS, BkniPercentile, getBkniPercentile } from "../statistics";
export function parseBkni(bkni: number) {
const bkniFraction = (bkni + 1) / 2;
+1 -1
View File
@@ -1,4 +1,4 @@
import { asset } from "@blitzkit/core";
import { asset } from "./asset";
export const BLITZKIT_TANK_ICON_SIZE = { width: 40 * 16, height: 30 * 16 };
@@ -1,4 +1,4 @@
import { BoundingBox } from '@blitzkit/core';
import { BoundingBox } from "../protos";
export function unionBoundingBox(a: BoundingBox, b: BoundingBox) {
return {
+2 -2
View File
@@ -1,5 +1,5 @@
import { I18nString } from "@blitzkit/core";
import locales from "@blitzkit/i18n/locales.json";
import { I18nString } from "../../core/src";
import locales from "../locales.json";
export function unwrapper(locale = locales.default) {
return function (i18nString: I18nString) {
+2
View File
@@ -643,6 +643,8 @@
"body": "This page has moved. Redirecting..."
},
"settings": {
"title": "Settings",
"description": "Change BlitzKit settings",
"dev_mode": "Modo de desarrollador",
"language": "Idioma"
},
+2
View File
@@ -643,6 +643,8 @@
"body": "This page has moved. Redirecting..."
},
"settings": {
"title": "Settings",
"description": "Change BlitzKit settings",
"dev_mode": "Development mode",
"language": "Language"
},
+2
View File
@@ -643,6 +643,8 @@
"body": "This page has moved. Redirecting..."
},
"settings": {
"title": "Settings",
"description": "Change BlitzKit settings",
"dev_mode": "開発者モード",
"language": "言語 / Language"
},
+2
View File
@@ -643,6 +643,8 @@
"body": "This page has moved. Redirecting..."
},
"settings": {
"title": "Settings",
"description": "Change BlitzKit settings",
"dev_mode": "Development mode",
"language": "Language"
},
+2
View File
@@ -643,6 +643,8 @@
"body": "This page has moved. Redirecting..."
},
"settings": {
"title": "Settings",
"description": "Change BlitzKit settings",
"dev_mode": "Modo de desenvolvimento",
"language": "Idioma"
},
+77 -75
View File
@@ -1,19 +1,19 @@
{
"test": {
"default": "тест",
"long": "This is a long test string. You MUST NEVER see this in the UI. My favorite fruit is {fruit} because it has the color of {color}. I like it so much that I will say its name 3 times! {fruit}! {fruit}! {fruit}! Once again, it's {color}, not {not_color}.",
"long": "Это длинная тестовая строка. Вы НИКОГДА не должны видеть её в пользовательском интерфейсе. Мой любимый фрукт — {fruit}, потому что это цвет {color}. Он мне так нравится, так что я скажу его 3 раза {fruit}! {fruit}! {fruit}! И ещё раз, это {color}, а не {not_color}.",
"fox": "Съешь же ещё этих мягких французских булок, да выпей чаю."
},
"common": {
"name": "BlitzKit",
"units": {
"m": "{value}m",
"mm": "{value}mm",
"m": "{value}м",
"mm": "{value}мм",
"deg": "{value}°",
"hp": "{value}hp",
"hp": "{value}оп",
"x": "x{value}",
"percentage": "{value}%",
"deg_s": "{value}°/s"
"deg_s": "{value}°/с"
},
"gun_types": {
"auto_loader": "Барабан",
@@ -186,11 +186,11 @@
"bot": {
"common": {
"errors": {
"clan_not_found": "# Could not find clan\nCouldn't find \"{search}\". Try selecting a clan from the search result.",
"player_not_found": "# Could not find user\nI couldn't find user \"{search}\". Try picking an user from the search result, typing in a valid username, or using the `/link` command.",
"clan_not_found": "# Не удалось найти клан\nНе найден «{search}». Попробуйте выбрать клан из результатов поиска.",
"player_not_found": "# Не удалось найти пользователя\nНе удалось найти пользователя «{search}». Попробуйте выбрать пользователя из результатов поиска, введя правильное имя пользователя или используя команду «/link».",
"player_not_linked": "# Используйте «/link», чтобы начать\nЯ не знаю, кто ты, но давай познакомимся сегодня!",
"tank_name_not_found": "# Tank not found\nCould not find tank by the name \"{search}\".",
"tank_id_not_found": "# Tank not found\nCould not find tank by the ID \"{search}\". Try typing the name of the tank instead of a number.",
"tank_name_not_found": "# Танк не найден\nНе удалось найти танк с названием «{search}».",
"tank_id_not_found": "# Танк не найден\nНе удалось найти танк с ID «{search}». Попробуйте ввести название танка вместо числа.",
"no_tank_stats": "# Статистика танка недоступна\nУ этого игрока нет доступной статистики. Возможно, это не тот игрок, которого вы ищете.",
"get_help": "Получить помощь",
"uncaught_error": "# BlitzKit столкнулся с ошибкой!\nНам очень жаль. Не стесняйтесь и [присоединяйтесь к официальному серверу Discord](https://discord.gg/nDt7AjGJQH), чтобы получить помощь.",
@@ -284,19 +284,19 @@
"name": "уровень",
"description": "Уровень",
"choices": {
"tier": "Tier {tier_1} - {tier_2}"
"tier": "Уровень {tier_1} - {tier_2}"
}
}
},
"periods": {
"career": "Карьера",
"today": "Cегодня",
"days": "{days} days",
"custom": "{day_1} - {day_2} days"
"days": "{days} дней",
"custom": "{day_1} - {day_2} дней"
},
"filters": {
"none": "Без фильтров",
"tier": "Tier {tier}"
"tier": " {tier} уровня"
},
"no_data": {
"battles_in_period": "За этот период боёв не было",
@@ -339,19 +339,19 @@
"body": {
"subtitle": "Исследование",
"total": "Всего",
"research": "Research: {cost}",
"upgrades": "Upgrades: {cost}",
"purchase": "Purchase: {cost}",
"equipment": "Equipment: {cost}",
"research": "Исследование: {cost}",
"upgrades": "Улучшения: {cost}",
"purchase": "Покупка: {cost}",
"equipment": "Снаряжение: {cost}",
"estimation": "# Это приблизительная оценка!\n\nВ этот список могут входить уже исследованные танки из-за неточной информации, предоставляемой Wargaming. Попробуйте указать «стартовый-танк» в строке при использовании команды, если сможете."
},
"errors": {
"non_tech_tree": "# {tank} is not on the tech tree\n\nYou cannot research a premium/collector tank.",
"tier_1": "# {tank} is a tier I\n\nTier I tanks are always unlocked for free for all players.",
"already_researched": "# {tank} is already researched\n\nTry providing a `starting-tank` when using the command to view the totals for a line you have already researched.",
"start_end_equal": "# {tank} was provided twice\n\nMake sure `starting-tank` and `target-tank` are different.",
"tanks_not_on_line": "# {tank_1} and {tank_2} are not on the same line\n\nMake sure `starting-tank` and `target-tank` are on the same tech-tree line.",
"unordered": "# {tank_1} higher tiered to {tank_2}\n\nMake sure to provide {tank_2} as the `starting-tank` instead as it is the lower tiered tank."
"non_tech_tree": "# {tank} отсутствует в дереве танков\n\nВы не можете исследовать премиумный / коллекционный танк.",
"tier_1": "# {tank} — танк I уровня\n\nУровень I всегда открыт бесплатно для всех игроков.",
"already_researched": "# {tank} уже исследован\n\nПопробуйте предоставить «starting-tank» при использовании команды для просмотра итогов уже исследованной ветки.",
"start_end_equal": "# {tank} был предоставлен дважды\n\nУбедитесь, что «starting-tank» и «target-tank» различаются.",
"tanks_not_on_line": "# {tank_1} и {tank_2} находятся не в одной ветке\n\nУбедитесь, что «starting-tank» и «target-tank» находятся на той же ветке дерева танков.",
"unordered": "# У {tank_1} более высокий уровень чем у {tank_2}\n\nОбязательно укажите {tank_2} в качестве «starting-tank», так как это танк более низкого уровня."
}
},
"about": {
@@ -394,7 +394,7 @@
"wn8": "WN8",
"winrate": "Коэффициент побед",
"damage": "Урон",
"unknown_tank": "Unknown tank {id}"
"unknown_tank": "Неизвестный танк {id}"
}
},
"debug": {
@@ -430,12 +430,12 @@
"options": {
"threshold": {
"name": "порог",
"description": "The number of days inactive (default: {days} days)"
"description": "Количество дней не активности (по умолчанию: {days} дней)"
}
},
"body": {
"subtitle": "Inactive for {days}+ days",
"listing": "{days} days"
"subtitle": "Неактивен {days}+ дней",
"listing": "{days} дней"
}
},
"full_stats": {
@@ -478,7 +478,7 @@
"body": {
"accounts_linked": "Аккаунты привязаны",
"no_role_permissions": {
"title": "{name} failed to verify",
"title": "{name} не удалось проверить",
"description": "У меня нет разрешения на управление ролями."
}
},
@@ -493,11 +493,11 @@
"options": {
"limit": {
"name": "лимит",
"description": "The max number of clan results (default: {limit})"
"description": "Максимальное количество результатов клана (по умолчанию: {limit})"
}
},
"body": {
"title": "Clan search for {search} in region {region}",
"title": "Поиск клана {search} в регионе {region}",
"no_results": "Кланов не найдено"
}
},
@@ -507,11 +507,11 @@
"options": {
"limit": {
"name": "лимит",
"description": "The max number of player results (default: {limit})"
"description": "Максимальное число результатов игрока (по умолчанию: {limit})"
}
},
"body": {
"title": "Player search for {search} in region {region}",
"title": "Поиск игрока {search} в регионе {region}",
"no_results": "Игроков не найдено"
}
},
@@ -531,13 +531,13 @@
"options": {
"limit": {
"name": "лимит",
"description": "How many neighbors to display (default: {count})"
"description": "Количество отображаемых ближайших игроков (по умолчанию: {count})"
},
"season": {
"name": "сезон",
"description": "Номер сезона (по умолчанию: текущий)",
"choices": {
"current": "{season} (current)"
"current": "{season} (текущий)"
}
},
"league": {
@@ -546,12 +546,12 @@
}
},
"body": {
"top_players": "Top {count} players",
"no_participation": "# {player} didn't play rating in season {season}\n\nThis player did not participate in this season or did not get past calibration.",
"top_players": "Топ {count} игроков",
"no_participation": "# {player} не играл в рейтинг в сезоне {season}\n\nЭтот игрок не участвовал в этом сезоне или не получил прошлую калибровку.",
"no_ongoing_season": "# Нет текущего сезона\n\nВ данный момент нет рейтингового сезона.",
"deleted_player": "Deleted {id}",
"deleted_player": "Удаленный {id}",
"neighbors": "Рейтинг ближайших игроков",
"more": "+ {count} more"
"more": "+ ещё {count}"
}
},
"today": {
@@ -566,14 +566,14 @@
"name": "cобственные-танки",
"description": "Показывает все принадлежащие танки на уровне",
"body": {
"title": "# {name}'s owned tier {tier} tanks\n\n"
"title": "# {name} принадлежат танки {tier} уровня\n\n"
}
},
"permissions": {
"name": "разрешения",
"description": "Проверяет, есть ли у бота необходимые разрешения для работы",
"body": {
"title": "# Permissions\n\n{body}",
"title": "# Разрешения\n\n{body}",
"view_channels": "Просмотр каналов: необходимо найти сообщение, на котором была использована кнопка обновления",
"read_message_history": "Просмотр истории сообщений: необходимо найти сообщение для обновления",
"attach_files": "Прикрепить файлы: необходимо для добавления изображений в команды на основе изображения",
@@ -585,7 +585,7 @@
"description": "Проверьте, что бот жив.",
"body": {
"pong": "Понг 🏓",
"pong_with_time": "Pong 🏓 - {time}ms"
"pong_with_time": "Понг 🏓 — {time}мс"
},
"subcommands": {
"blitzkit": {
@@ -602,7 +602,7 @@
"name": "информация-об-игроке",
"description": "Основная информация о игроке",
"body": {
"title": "{name}'s information",
"title": "Информация о {name}",
"nickname": "Никнейм",
"battles": "Боёв",
"winrate": "Коэффициент побед",
@@ -631,7 +631,7 @@
}
},
"errors": {
"no_participation": "# {name} hasn't played rating\n\nThis player hasn't participated in the rating gamemode this season.",
"no_participation": "# {name} не получил рейтинга\n\nЭтот игрок в этом сезоне не участвовал в рейтинговом режиме.",
"unrecorded_stats": "# Статистика недоступна в настоящее время\n\nВ настоящее время Wargaming, возможно, сталкивается с простоями сервера. Если сезон продолжается, статистика должна быть доступна в течение 24 часов."
}
}
@@ -643,6 +643,8 @@
"body": "Эта страница перемещена. Перенаправление..."
},
"settings": {
"title": "Настройки",
"description": "Изменить настройки BlitzKit",
"dev_mode": "Режим разработчика",
"language": "Язык"
},
@@ -659,13 +661,13 @@
"select_dialog_title": "Поиск танка",
"swap_dialog_title": "Заменить танк",
"clear_filters": "Сбросить фильтры",
"login": "Login to use this",
"login": "Войти, чтобы воспользоваться",
"search_bar_hint": "Поиск танков...",
"recent": "Недавние",
"select_all": "Выбрать всё",
"count_singular": "1 танк",
"count_plural": "{count} tanks",
"sorting_by": "Sorting by {name}",
"count_plural": "Танков: {count}",
"sorting_by": "Сортировать по {name}",
"no_tanks_found": {
"body": "Танков не найдено.",
"search_again": "Попробуйте повторить поиск.",
@@ -741,16 +743,16 @@
"action": "Discord"
},
"hero": {
"credit": "By {name} ❤️"
"credit": "От {name} ❤️"
},
"hot_tanks": {
"title": "Популярные танки",
"subtitle": "Last {days} days"
"subtitle": "За последнее {days} дней"
},
"other_projects": {
"title": "Другие классные проекты"
},
"help_translate": "Please help translate {name} to {language}!",
"help_translate": "Пожалуйста, помогите перевести {name} на {language}!",
"seo_description": "Инструменты для World of Tanks Blitz"
},
"docs": {
@@ -761,7 +763,7 @@
},
"tools": {
"mixer": {
"name": "Смешиватель",
"name": "Смешать",
"button": "Смешать и собрать",
"description": "Модули смешанного танка",
"seo_description": "Смешивание и сбор корпусов, башен и пушек танков из World of Tanks Blitz",
@@ -769,7 +771,7 @@
"randomize": "Случайно"
},
"guess": {
"name": "Угадайте танк",
"name": "Угадай танк",
"button": "Угадать",
"description": "Мини-игра «Силуэт»",
"seo_description": "Играйте угадывая силуэт танка из World of Tanks Blitz",
@@ -780,7 +782,7 @@
"next": "Следующий",
"no_results": "Ничего не найденo"
},
"stats": "{correct} / {total} guessed correctly"
"stats": "{correct} / {total} угадано верно"
},
"tankopedia": {
"search": "Поиск характеристик...",
@@ -788,8 +790,8 @@
"button": "Поиск танков",
"description": "Танковая энциклопедия Blitz",
"seo_description": "Статистика, броня и многое другое по всем танкам World of Tanks Blitz",
"tank_seo_title": "{name} - Tier {tier} {nationality} {class} | {website} Tankopedia | World of Tanks Blitz (WoTB)",
"tank_seo_description": "{name} armor, statistics, equipment, provisions, and more. {dpm} DPM, {alpha}hp alpha, {penetration}mm penetration, {speed}kph top speed, {health}hp health.",
"tank_seo_title": "{name} — {class} {nationality} {tier} уровня | Танкопедия {website} | World of Tanks Blitz (WoTB)",
"tank_seo_description": "Броня, статистика, оборудование, снабжение {name} и многое другое. DPM {dpm}, альфа {alpha}оп, пробитие{penetration}мм, лучшая скорость{speed}км/ч, здоровье {health}оп.",
"visualizers": {
"reload": {
"skip": "Пропуск"
@@ -867,15 +869,15 @@
"track": "Гусеницы"
},
"status": {
"penetration": "{damage}hp penetration",
"penetration": "Пробитие на {damage}оп",
"blocked": "Не пробил",
"ricochet": "Рикошет",
"splash": "{damage}hp splash"
"splash": "Урон осколками на {damage}оп"
},
"stats": {
"thickness_and_angle": "{thickness}mm {angle}°",
"nominal": "{thickness}mm nominal",
"ricochet_loss": "{loss}% penetration"
"thickness_and_angle": "{thickness}мм {angle}°",
"nominal": "{thickness}1мм номинала",
"ricochet_loss": "{loss}% пробития"
}
}
},
@@ -913,15 +915,15 @@
"tech_tree": {
"title": "Дерево танков",
"battle": "1 бой",
"battles": "{count} battles",
"route": "Route {index} of {count}"
"battles": "{count} боёв",
"route": "Ветка {index} из {count}"
},
"game_modes": {
"title": "Способности в игровых режимах"
},
"review": {
"title": "Видеообзоры",
"join": "Apply to {name} YouTuber program"
"join": "Предложить ютубера для программы {name}"
},
"configuration": {
"title": "Конфигурация",
@@ -957,15 +959,15 @@
"title": "Характеристики",
"compare": {
"label": "Сравнивать с",
"class": "Tier {tier} {class}",
"tier": "All of tier {tier}",
"class": "{class} {tier} уровня",
"tier": "Все {tier} уровня",
"all": "Все танки"
},
"values": {
"shell_index": "Shell {index}",
"at_distance": "At {distance}m",
"shell_index": "Снаряд {index}",
"at_distance": "На {distance}м",
"at_distance_slider_label": "Дистанция",
"dispersion_at_distance": "Dispersion at {distance}m",
"dispersion_at_distance": "Разброс на {distance}м",
"gun_flexibility": "Углы наводки",
"speed": "Скорость",
"terrain_coefficients": "Сопротивление грунтам",
@@ -1114,9 +1116,9 @@
"description": "Статистика эффективности танков",
"seo_description": "Лучшие танки и их эффективность в World of Tanks Blitz",
"estimation": {
"body": "Estimated stats based on {count} players. Updated {age} ago.",
"hours": "{count} hours",
"minutes": "{count} minutes"
"body": "Примерная статистика на основе {count} игроков. Обновлено {age} назад.",
"hours": "{count} часов",
"minutes": "{count} минут"
},
"player_count": {
"label": "Количество игроков"
@@ -1148,10 +1150,10 @@
"button": "Просмотреть",
"description": "Аватары игрока Blitz",
"seo_description": "Все аватары игрока World of Tanks Blitz",
"last_updated": "Last updated on {time}",
"last_updated": "Последнее обновление {time}",
"search": {
"hint": "Поиск аватаров...",
"results": "{count} avatars"
"results": "Аватаров: {count}"
}
},
"session": {
@@ -1166,8 +1168,8 @@
"no_results": "Игроков не найдено"
},
"controls": {
"title": "Tracking {name}",
"subtitle": "Since {time}",
"title": "Отслеживание {name}",
"subtitle": "Начиная с {time}",
"reset": "Сброс",
"change": "Изменить"
},
@@ -1227,7 +1229,7 @@
"cancel": "Отмена",
"success": {
"title": "Скопировать URL",
"info": "Generated the URL for {name}. The embed will start tracking as soon as the URL is pasted. Reset at any time by right-clicking on PC or long-pressing on mobile and then selecting \"Reset\".",
"info": "Сгенерирован URL для {name}. Встройка начнет отслеживание, как только URL будет вставлен. Можно сбросить, щелкнув правой кнопкой мыши на ПК или долгим нажатием на мобильном телефоне и выбором «Сброс».",
"back": "Назад",
"copy": "Скопировать URL"
}
+2
View File
@@ -643,6 +643,8 @@
"body": "This page has moved. Redirecting..."
},
"settings": {
"title": "Settings",
"description": "Change BlitzKit settings",
"dev_mode": "Development mode",
"language": "Мова"
},
+2
View File
@@ -643,6 +643,8 @@
"body": "此页面已被移动。正在重定向……"
},
"settings": {
"title": "Settings",
"description": "Change BlitzKit settings",
"dev_mode": "开发者模式",
"language": "语言"
},
+4
View File
@@ -16,14 +16,18 @@
},
"dependencies": {
"@blitzkit/core": "workspace:*",
"@blitzkit/closed": "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"
},
+28 -28
View File
@@ -1,20 +1,20 @@
import { assertSecret } from '@blitzkit/core';
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 { dvp } from '../../../submodules/blitzkit-closed/src/dava/dvp';
import { readStringDVPL } from '../src/core/blitz/readStringDVPL';
import { DATA } from './buildAssets/constants';
import { readYAMLDVPL } from './core/blitz/readYAMLDVPL';
import { writeDVPL } from './core/blitz/writeDVPL';
import { dvp } from "@blitzkit/closed";
import { assertSecret } from "@blitzkit/core";
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 { readStringDVPL } from "../src/core/blitz/readStringDVPL";
import { DATA } from "./buildAssets/constants";
import { readYAMLDVPL } from "./core/blitz/readYAMLDVPL";
import { writeDVPL } from "./core/blitz/writeDVPL";
const versionTextFile = await readStringDVPL(`${DATA}/version.txt`);
const currentVersion = versionTextFile
.split(' ')[0]
.split('.')
.split(" ")[0]
.split(".")
.slice(0, 3)
.join('.');
.join(".");
console.log(`Installing patches for ${currentVersion}...`);
@@ -22,8 +22,8 @@ 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) {
@@ -31,18 +31,18 @@ while (true) {
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',
)}`,
".dvpm",
".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) {
@@ -56,35 +56,35 @@ while (true) {
console.warn(`Failed to make directory "${dir}"`);
}
const isDvpl = path.endsWith('.dvpl');
const isDvpl = path.endsWith(".dvpl");
const buffer = Buffer.from(data);
await writeFile(
`${DATA}/${path}${isDvpl ? '' : '.dvpl'}`,
new Uint8Array(isDvpl ? buffer : writeDVPL(buffer)),
`${DATA}/${path}${isDvpl ? "" : ".dvpl"}`,
new Uint8Array(isDvpl ? buffer : writeDVPL(buffer))
);
bar.tick();
}
if ('dynamicContentLocalizationsDir' in data) {
console.log('Found dynamic content localizations; patching...');
if ("dynamicContentLocalizationsDir" in data) {
console.log("Found dynamic content localizations; patching...");
const localizationsResponse = await fetch(
`${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${
data.dynamicContentLocalizationsDir
}/en.yaml`,
}/en.yaml`
);
const newStrings = parseYaml(await localizationsResponse.text());
const oldStrings = await readYAMLDVPL<Record<string, string>>(
`${DATA}/Strings/en.yaml`,
`${DATA}/Strings/en.yaml`
);
const patchedStrings = { ...oldStrings, ...newStrings };
const patchedContent = stringifyYaml(patchedStrings);
await writeFile(
`${DATA}/Strings/en.yaml`,
new Uint8Array(writeDVPL(Buffer.from(patchedContent))),
new Uint8Array(writeDVPL(Buffer.from(patchedContent)))
);
}
+20 -20
View File
@@ -1,13 +1,13 @@
import { build } from 'esbuild';
import { cp, readdir, rm } from 'fs/promises';
import { argv } from 'process';
import { build } from "esbuild";
import { cp, readdir, rm } from "fs/promises";
import { argv } from "process";
const projectDir = '../..';
const projectDir = "../..";
const srcRoot = `${projectDir}/packages/bot`;
const distRoot = `${projectDir}/dist/bot`;
const modulesRoot = `${projectDir}/node_modules`;
const modulesRoot = `${projectDir}/packages/bot/node_modules`;
const workers = await readdir(`${srcRoot}/src/workers`);
const dev = argv.includes('--dev');
const dev = argv.includes("--dev");
await rm(distRoot, { recursive: true, force: true });
@@ -17,33 +17,33 @@ build({
...workers.map((worker) => `${srcRoot}/src/workers/${worker}`),
],
bundle: true,
outdir: '../../dist/bot',
platform: 'node',
format: 'esm',
outdir: "../../dist/bot",
platform: "node",
format: "esm",
loader: {
'.ttf': 'file',
'.node': 'empty',
'.json': 'json',
".ttf": "file",
".node": "empty",
".json": "json",
},
external: ['sharp'],
external: ["sharp"],
minifyIdentifiers: false, // causes goofy ahh issues
minifySyntax: !dev,
minifyWhitespace: !dev,
sourcemap: !dev,
jsxImportSource: 'react',
jsx: 'automatic',
jsxImportSource: "react",
jsx: "automatic",
});
for (const module of await readdir(`${modulesRoot}/@resvg`)) {
readdir(`${modulesRoot}/@resvg/${module}`).then((files) =>
files
.filter((file) => file.endsWith('.node'))
.filter((file) => file.endsWith(".node"))
.map((file) =>
cp(
`${modulesRoot}/@resvg/${module}/${file}`,
`${distRoot}/workers/${file}`,
),
),
`${distRoot}/workers/${file}`
)
)
);
}
@@ -51,7 +51,7 @@ if (!dev) {
await cp(`${projectDir}/prisma`, `${distRoot}/prisma`, { recursive: true });
for (const file of await readdir(`${modulesRoot}/prisma`).then((files) =>
files.filter((file) => file.endsWith('.node')),
files.filter((file) => file.endsWith(".node"))
)) {
cp(`${modulesRoot}/prisma/${file}`, `${distRoot}/prisma/${file}`);
}
+1
View File
@@ -3,6 +3,7 @@
"type": "module",
"main": "src/index.ts",
"dependencies": {
"immer": "^10.1.3",
"react": "^19.1.1"
}
}
+3
View File
@@ -13,6 +13,9 @@
"@astrojs/node": "^9.4.4",
"@astrojs/react": "^4.4.0",
"@astrolib/seo": "^1.0.0-beta.8",
"@blitzkit/core": "workspace:*",
"@blitzkit/i18n": "workspace:*",
"varuna": "workspace:*",
"@fontsource/inter": "^5.2.8",
"@radix-ui/colors": "^3.0.0",
"@radix-ui/react-icons": "^1.3.2",