mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-25 11:39:51 +01:00
Compare commits
419
Commits
v1.29.12
...
4e9c3df5eb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e9c3df5eb | ||
|
|
c100a1e655 | ||
|
|
26cc0cc723 | ||
|
|
f697f94bd5 | ||
|
|
30fa18f0fd | ||
|
|
c45af8e156 | ||
|
|
f95a6e3495 | ||
|
|
0e637d772e | ||
|
|
a834d48a38 | ||
|
|
f550386fd9 | ||
|
|
0a4b81cde4 | ||
|
|
e1cc60ea5e | ||
|
|
a40860901b | ||
|
|
f3e96718eb | ||
|
|
a00411919d | ||
|
|
b298874f0d | ||
|
|
7011d4d20f | ||
|
|
d9ce16b41a | ||
|
|
f0e0d849d5 | ||
|
|
6d2573ee95 | ||
|
|
4c77cc2282 | ||
|
|
32f6916266 | ||
|
|
3a91e082d5 | ||
|
|
2184c1c703 | ||
|
|
95ad6bade7 | ||
|
|
8bda4a5331 | ||
|
|
16c77f587a | ||
|
|
a218c791a9 | ||
|
|
dccdf55bfc | ||
|
|
1ba6e70c56 | ||
|
|
0e76184813 | ||
|
|
c674da29d5 | ||
|
|
ba4e6dfd68 | ||
|
|
980fd6e50e | ||
|
|
44e7cd7505 | ||
|
|
3a60535564 | ||
|
|
9abfeb749c | ||
|
|
0442c789f1 | ||
|
|
76dc9f0742 | ||
|
|
ff56f1441e | ||
|
|
e3db886923 | ||
|
|
249f62759e | ||
|
|
7767481633 | ||
|
|
a97b1383d8 | ||
|
|
1b224b3949 | ||
|
|
018aa33a7f | ||
|
|
4b7b8b3392 | ||
|
|
272824a72f | ||
|
|
ac02d65db0 | ||
|
|
9bcaff9fd3 | ||
|
|
7b650bf39b | ||
|
|
ee1ecb83b7 | ||
|
|
d6e37119a8 | ||
|
|
385cc3b6d2 | ||
|
|
b4936bf13b | ||
|
|
e1e9403c60 | ||
|
|
0828d50830 | ||
|
|
0817ba18bd | ||
|
|
121a80d079 | ||
|
|
932c414b0c | ||
|
|
3a38441d42 | ||
|
|
3e039d34c2 | ||
|
|
2bae132d18 | ||
|
|
bc0004574a | ||
|
|
2e208507c3 | ||
|
|
33209a6d31 | ||
|
|
13311245a5 | ||
|
|
4067357b54 | ||
|
|
fd6b69edc1 | ||
|
|
2504833a29 | ||
|
|
6d31dcb74b | ||
|
|
a149af50fd | ||
|
|
13927927b3 | ||
|
|
68edf520c5 | ||
|
|
f7933a1295 | ||
|
|
9a1c09490f | ||
|
|
c8b5c216e3 | ||
|
|
344954513a | ||
|
|
f8029bdf67 | ||
|
|
d9c7d31017 | ||
|
|
1920be28d8 | ||
|
|
8b00772958 | ||
|
|
e2e38dc4b3 | ||
|
|
455f1be041 | ||
|
|
3e37368038 | ||
|
|
4b86e20a13 | ||
|
|
d9a14924eb | ||
|
|
7d9d322405 | ||
|
|
5365044017 | ||
|
|
069edf0847 | ||
|
|
2cdcf95822 | ||
|
|
e43231aa97 | ||
|
|
0df2acd5e6 | ||
|
|
3f0b3f190a | ||
|
|
504f143ff7 | ||
|
|
7cfc30c7a1 | ||
|
|
79dba0fe2c | ||
|
|
c0376182f8 | ||
|
|
f3ed687f00 | ||
|
|
e37575148c | ||
|
|
2df9979f08 | ||
|
|
c8ce26d6a7 | ||
|
|
898fd4bbf6 | ||
|
|
744f7195dd | ||
|
|
bc4f51846d | ||
|
|
ab8dc131b8 | ||
|
|
684d33071e | ||
|
|
146e68fc53 | ||
|
|
655b87d876 | ||
|
|
71caa2f703 | ||
|
|
99c95a4c15 | ||
|
|
93632a7073 | ||
|
|
297265822b | ||
|
|
a7f799b5b6 | ||
|
|
b176ec6c96 | ||
|
|
1a008a4852 | ||
|
|
145de2bbbc | ||
|
|
77c516a6eb | ||
|
|
6835004945 | ||
|
|
e36823c159 | ||
|
|
ec6ac128f2 | ||
|
|
d80f47a6c8 | ||
|
|
3a9af7505f | ||
|
|
34ee954502 | ||
|
|
b9878a05a1 | ||
|
|
e9412bc404 | ||
|
|
6755115c8a | ||
|
|
e8ed4615fe | ||
|
|
c55f4c311f | ||
|
|
e063970c58 | ||
|
|
fdf8580f5f | ||
|
|
cffd37c6f1 | ||
|
|
7419b3f29e | ||
|
|
e2f50871ec | ||
|
|
bdea9fdab3 | ||
|
|
ae793c1c28 | ||
|
|
3d912036a7 | ||
|
|
1866077a82 | ||
|
|
8345f99603 | ||
|
|
2ab576a37c | ||
|
|
5b9ff7acb3 | ||
|
|
4cdb712013 | ||
|
|
e6fcfdb514 | ||
|
|
9df1800e10 | ||
|
|
95ba925d27 | ||
|
|
41882ddf23 | ||
|
|
fe9b543a75 | ||
|
|
191843f972 | ||
|
|
c1fde44809 | ||
|
|
1a3517e035 | ||
|
|
afec6d9851 | ||
|
|
e3f2fd70ad | ||
|
|
5adbec25c4 | ||
|
|
4ff8d77460 | ||
|
|
22faa6d294 | ||
|
|
a2abfa7f85 | ||
|
|
7b93b12fcb | ||
|
|
8e3b5de249 | ||
|
|
ed252d5dfe | ||
|
|
44711a58c7 | ||
|
|
e7337145d2 | ||
|
|
c116b40dfc | ||
|
|
d88f7ad539 | ||
|
|
b5d61cebb3 | ||
|
|
551108e047 | ||
|
|
5feec9bf1e | ||
|
|
313691d3e9 | ||
|
|
950c99d3d7 | ||
|
|
80cc74a945 | ||
|
|
4e586253c0 | ||
|
|
08980158e4 | ||
|
|
1e917c7b89 | ||
|
|
8d3678ddcb | ||
|
|
6a58c5ea1d | ||
|
|
b9bbf22f2c | ||
|
|
c99ed0cb53 | ||
|
|
cef18d4f64 | ||
|
|
824169fc25 | ||
|
|
c365993541 | ||
|
|
30f9475208 | ||
|
|
841b5708ae | ||
|
|
8ad110f73b | ||
|
|
0869ea09c8 | ||
|
|
454c526666 | ||
|
|
e67970d2b9 | ||
|
|
0e57943d33 | ||
|
|
8b01b7c192 | ||
|
|
a7bd671309 | ||
|
|
406ad52c8d | ||
|
|
0f1c03d1e5 | ||
|
|
b6c4c4e852 | ||
|
|
8394f2ec1e | ||
|
|
f14e73d811 | ||
|
|
f193d5c503 | ||
|
|
23e00b4199 | ||
|
|
6a06cb17a3 | ||
|
|
427b189a34 | ||
|
|
bf218b0975 | ||
|
|
eab4266fd1 | ||
|
|
86b4b63a7c | ||
|
|
5412c479c8 | ||
|
|
547614fa89 | ||
|
|
e803d96f20 | ||
|
|
009caeeaf1 | ||
|
|
bfa80cd549 | ||
|
|
987c798b7e | ||
|
|
8dbe7cb155 | ||
|
|
053f1e3ac8 | ||
|
|
588c0a809b | ||
|
|
dde059b1f9 | ||
|
|
102072746a | ||
|
|
10d7fe1e75 | ||
|
|
4cc4e664df | ||
|
|
d5269e763b | ||
|
|
bae7ca2720 | ||
|
|
a0b81bfb83 | ||
|
|
629e9f814e | ||
|
|
f39d1bab4e | ||
|
|
ccb86ae824 | ||
|
|
001709c25c | ||
|
|
e50b8d11bf | ||
|
|
ea782af079 | ||
|
|
0ebf9f6c3d | ||
|
|
6fec467ec8 | ||
|
|
8b0f1cdfed | ||
|
|
f6008bd288 | ||
|
|
1776c8fc15 | ||
|
|
99f41b9805 | ||
|
|
d4f11fc52a | ||
|
|
750aeb39c9 | ||
|
|
0f355bc2fc | ||
|
|
6ebd3063ed | ||
|
|
b070cad92a | ||
|
|
204fbbff59 | ||
|
|
98e7760142 | ||
|
|
6c1c088d44 | ||
|
|
0b7f717057 | ||
|
|
728cb43f05 | ||
|
|
ff02f06cbc | ||
|
|
7a817cbe8c | ||
|
|
58e0876aa0 | ||
|
|
f84f846e76 | ||
|
|
ddb869e767 | ||
|
|
015d457d23 | ||
|
|
ba6a83a9cb | ||
|
|
689985ed93 | ||
|
|
bf9262f1f1 | ||
|
|
821bd363ad | ||
|
|
4a9fc65e71 | ||
|
|
81877f5abd | ||
|
|
01eed3e045 | ||
|
|
7bc423b570 | ||
|
|
dba56f8946 | ||
|
|
c1f765d5f7 | ||
|
|
7f5b5b614f | ||
|
|
5cd149b2b9 | ||
|
|
0bc2d0aaf6 | ||
|
|
1dc9a341d1 | ||
|
|
2ad1e71176 | ||
|
|
ca6973f529 | ||
|
|
323d624ec7 | ||
|
|
49f84db473 | ||
|
|
7399c402af | ||
|
|
cbfcb29691 | ||
|
|
ae616fbaf3 | ||
|
|
35275d4aa8 | ||
|
|
dda63830ec | ||
|
|
79b4f05809 | ||
|
|
b50c47b744 | ||
|
|
f7c6fdd861 | ||
|
|
47b583821e | ||
|
|
369ac113fa | ||
|
|
fc4d8b5ad0 | ||
|
|
72e1cf7d6a | ||
|
|
dd96556e2a | ||
|
|
a7ee51526a | ||
|
|
610b59f4c6 | ||
|
|
63ce327458 | ||
|
|
6ec7a50320 | ||
|
|
60a29ef2e7 | ||
|
|
52c3a0abe0 | ||
|
|
5bbe5c2720 | ||
|
|
c0c6a21e43 | ||
|
|
a7f93698a6 | ||
|
|
1a18058228 | ||
|
|
67024daa25 | ||
|
|
de6137d1a5 | ||
|
|
11e87bd519 | ||
|
|
3b4e089756 | ||
|
|
4a6f5845f9 | ||
|
|
e9684ce033 | ||
|
|
27abf1b0de | ||
|
|
f5f3f70e35 | ||
|
|
2d282a3261 | ||
|
|
a2d0d2d8c0 | ||
|
|
ea412086d4 | ||
|
|
455679a981 | ||
|
|
a21bc6174d | ||
|
|
fae1a89402 | ||
|
|
5a1a0c59f1 | ||
|
|
c98271f783 | ||
|
|
033660c2d9 | ||
|
|
1a639c51e1 | ||
|
|
1366579dd1 | ||
|
|
f5ed2c2c40 | ||
|
|
1598de9f5f | ||
|
|
6f47f5cc99 | ||
|
|
1117dcb935 | ||
|
|
01a58f9aa8 | ||
|
|
9096644d51 | ||
|
|
d42fc0e3f6 | ||
|
|
17d1526b6f | ||
|
|
db8ac195d4 | ||
|
|
c5f5f69fd6 | ||
|
|
44203223fd | ||
|
|
bdabadcd49 | ||
|
|
220e4388d4 | ||
|
|
51b2d1ce86 | ||
|
|
f3c1825c57 | ||
|
|
359dfcd102 | ||
|
|
649cdd893f | ||
|
|
0cb974acf5 | ||
|
|
9bca5dccc7 | ||
|
|
d707f1cc5d | ||
|
|
4ed4395535 | ||
|
|
0209d48475 | ||
|
|
437bee4a85 | ||
|
|
4b8e73fa57 | ||
|
|
b96f925d9a | ||
|
|
1551dc50fd | ||
|
|
daf4cef61c | ||
|
|
496e127f64 | ||
|
|
da1af66c77 | ||
|
|
01409985a2 | ||
|
|
a86ac0619a | ||
|
|
385d165512 | ||
|
|
fcfc97b964 | ||
|
|
53d05e73a6 | ||
|
|
40a1eb861d | ||
|
|
1d3cb95b89 | ||
|
|
010303a818 | ||
|
|
7281b9fed0 | ||
|
|
c5785c7ae6 | ||
|
|
698731cb9a | ||
|
|
99bae8f2c5 | ||
|
|
5034ec1aa0 | ||
|
|
be821c1f8b | ||
|
|
a364b79a9b | ||
|
|
0aa6e1e79a | ||
|
|
d2a6379131 | ||
|
|
07ce61d19f | ||
|
|
ad9f2d8609 | ||
|
|
57702d8a43 | ||
|
|
9a30af3818 | ||
|
|
23751fbdf3 | ||
|
|
db6d181f78 | ||
|
|
56ca4dcc61 | ||
|
|
d08b537721 | ||
|
|
c1a2edb489 | ||
|
|
164b7fa454 | ||
|
|
428483cf4c | ||
|
|
89f02eb399 | ||
|
|
4ce127516c | ||
|
|
6f4f487dfe | ||
|
|
57dd60e804 | ||
|
|
d24fd2250c | ||
|
|
e00bcdfc06 | ||
|
|
67dd204ee6 | ||
|
|
e130583fa4 | ||
|
|
6ad20a0fcf | ||
|
|
9fad644d7a | ||
|
|
8cb523dd06 | ||
|
|
b50ee23a26 | ||
|
|
a973cf699b | ||
|
|
102abf49c4 | ||
|
|
8929e503ea | ||
|
|
a2a794eb74 | ||
|
|
2e95f5dd95 | ||
|
|
23a42230cb | ||
|
|
e66daed7ae | ||
|
|
f2d0f68f07 | ||
|
|
be4af0bf84 | ||
|
|
15172e8b33 | ||
|
|
c6b7918525 | ||
|
|
4f1c4421e5 | ||
|
|
7b830f5a71 | ||
|
|
6ce1135835 | ||
|
|
66eaaef6de | ||
|
|
48fbf59036 | ||
|
|
0e0f4fbe9f | ||
|
|
6ba6e10108 | ||
|
|
cf8fa4ffb4 | ||
|
|
2b0180dce2 | ||
|
|
caee848a47 | ||
|
|
d01b7cf707 | ||
|
|
8921f84c38 | ||
|
|
6830df01fa | ||
|
|
67da59ef41 | ||
|
|
036cc9915d | ||
|
|
57b6ba19f0 | ||
|
|
32b5593d07 | ||
|
|
3b757562d2 | ||
|
|
4c8c2d0868 | ||
|
|
b2f266401f | ||
|
|
5541eca23d | ||
|
|
122d65840e | ||
|
|
ed4b72d85c | ||
|
|
4033e8618f | ||
|
|
42cada1811 | ||
|
|
ff7ed213c8 | ||
|
|
a0367af06b | ||
|
|
58c2965c53 | ||
|
|
edae41409a | ||
|
|
383d3a36ef | ||
|
|
6a958da390 | ||
|
|
ef154f99d5 | ||
|
|
4a20102de3 | ||
|
|
4e170f2917 | ||
|
|
a70d788f6b |
No files matched your search
@@ -1,82 +0,0 @@
|
|||||||
name: Assets
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: main
|
|
||||||
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
asset_repo:
|
|
||||||
type: choice
|
|
||||||
required: false
|
|
||||||
description: What asset repo to write to
|
|
||||||
options:
|
|
||||||
- blitzkit/assets
|
|
||||||
- blitzkit/assets-preview
|
|
||||||
- blitzkit/assets-dev
|
|
||||||
default: blitzkit/assets
|
|
||||||
|
|
||||||
asset_source:
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
description: "Archive URL or Steam to download (example: steam:APP_ID/DEPOT_ID or zip:URL_TO_ZIP)"
|
|
||||||
default: "steam:444200/444202"
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
- cron: "0 2 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.asset_repo }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
VIDEOS_SHEET: ${{ secrets.VIDEOS_SHEET }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
|
||||||
WOTB_DLC_CDN: ${{ secrets.WOTB_DLC_CDN }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
PUBLIC_ASSET_REPO: ${{ github.event.inputs.asset_repo != '' && github.event.inputs.asset_repo || secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
|
|
||||||
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
|
||||||
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
|
||||||
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
|
||||||
ALLOW_ROBOTS: true
|
|
||||||
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
|
||||||
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
|
||||||
PUBLIC_PATREON_CLIENT_ID: ${{ secrets.PUBLIC_PATREON_CLIENT_ID }}
|
|
||||||
PUBLIC_PATREON_REDIRECT_URI: ${{ secrets.PUBLIC_PATREON_REDIRECT_URI }}
|
|
||||||
PATREON_CLIENT_SECRET: ${{ secrets.PATREON_CLIENT_SECRET }}
|
|
||||||
PUBLIC_NITROPAY_ID: ${{ secrets.PUBLIC_NITROPAY_ID }}
|
|
||||||
PUBLIC_DEBUG_MISSING_I18N: false
|
|
||||||
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
|
||||||
PUBLIC_ASSET_FAST_USER: blitzkit
|
|
||||||
PUBLIC_ASSET_FAST_REPO: assets
|
|
||||||
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
|
|
||||||
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_assets:
|
|
||||||
name: Build assets
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
- run: bun run setup
|
|
||||||
|
|
||||||
- name: AppArmor hack
|
|
||||||
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
|
|
||||||
|
|
||||||
- name: Build assets
|
|
||||||
run: bun run build:assets --all-targets --source=${{ github.event.inputs.asset_source || 'steam:444200/444202' }}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
name: Averages
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 8 * * *"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
|
||||||
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
|
||||||
ALLOW_ROBOTS: "true"
|
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
|
||||||
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
|
||||||
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
|
||||||
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
|
||||||
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
|
||||||
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
|
||||||
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
- uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- run: bun run setup
|
|
||||||
|
|
||||||
- name: Build averages
|
|
||||||
env:
|
|
||||||
PUBLIC_ASSET_BRANCH: main
|
|
||||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
|
||||||
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
VIDEOS_SHEET: ${{ secrets.VIDEOS_SHEET }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
run: bun run build:averages --production
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
name: Bot
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Build bot
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
- uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- run: bun run setup
|
|
||||||
|
|
||||||
- name: Build bot
|
|
||||||
run: bun run build:bot
|
|
||||||
|
|
||||||
- name: Archive build
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: bot
|
|
||||||
path: dist/bot
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
name: IDs
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 0 * * 1"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
- uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- run: bun run setup
|
|
||||||
|
|
||||||
- name: Discover IDs
|
|
||||||
run: bun build:ids --production
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
name: Host
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: main
|
|
||||||
schedule:
|
|
||||||
- cron: "0 */5 * * *"
|
|
||||||
workflow_dispatch:
|
|
||||||
release:
|
|
||||||
types: [created, published, released, edited]
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
|
||||||
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
|
||||||
ALLOW_ROBOTS: ${{ secrets.ALLOW_ROBOTS }}
|
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
|
||||||
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
|
||||||
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
|
||||||
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
|
||||||
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
|
||||||
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
|
||||||
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
|
|
||||||
PUBLIC_GUIDE_WEBSITE: ${{ secrets.PUBLIC_GUIDE_WEBSITE }}
|
|
||||||
SERVICING: ${{ secrets.SERVICING }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
host:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
- uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GH_TOKEN }}
|
|
||||||
|
|
||||||
- name: Download release assets
|
|
||||||
run: |
|
|
||||||
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/blitzkit/blitzkit/releases/latest \
|
|
||||||
| grep "browser_download_url.*bot.zip" \
|
|
||||||
| cut -d : -f 2,3 \
|
|
||||||
| tr -d \")
|
|
||||||
curl -L -o bot.zip $DOWNLOAD_URL
|
|
||||||
mkdir -p dist/bot
|
|
||||||
unzip bot.zip -d dist/bot
|
|
||||||
|
|
||||||
- name: Install sharp
|
|
||||||
run: bun init -y && bun add sharp
|
|
||||||
|
|
||||||
- name: Move directories
|
|
||||||
run: mv dist/bot/prisma .
|
|
||||||
|
|
||||||
- name: Run bot
|
|
||||||
run: bun run dist/bot/main.js
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
name: Rating Asia
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 17 * * *"
|
|
||||||
|
|
||||||
env:
|
|
||||||
PUBLIC_ASSET_BRANCH: main
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
|
||||||
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
|
||||||
ALLOW_ROBOTS: "true"
|
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
|
||||||
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
|
||||||
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
|
||||||
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
|
||||||
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
|
||||||
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
|
||||||
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
host:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
- uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- run: bun run setup
|
|
||||||
|
|
||||||
- name: Generate leaderboard
|
|
||||||
run: bun build:ratingleaderboard --region=asia
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
name: Rating Europe
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 23 * * *"
|
|
||||||
|
|
||||||
env:
|
|
||||||
PUBLIC_ASSET_BRANCH: main
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
|
||||||
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
|
||||||
ALLOW_ROBOTS: "true"
|
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
|
||||||
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
|
||||||
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
|
||||||
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
|
||||||
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
|
||||||
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
|
||||||
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
host:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
- uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- run: bun run setup
|
|
||||||
|
|
||||||
- name: Generate leaderboard
|
|
||||||
run: bun build:ratingleaderboard --region=eu
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
name: Rating North America
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 5 * * *"
|
|
||||||
|
|
||||||
env:
|
|
||||||
PUBLIC_ASSET_BRANCH: main
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
|
||||||
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
|
||||||
ALLOW_ROBOTS: "true"
|
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
|
||||||
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
|
||||||
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
|
||||||
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
|
||||||
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
|
||||||
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
|
||||||
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
host:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
- uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- run: bun run setup
|
|
||||||
|
|
||||||
- name: Generate leaderboard
|
|
||||||
run: bun build:ratingleaderboard --region=com
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
name: Reviews
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: 0 0 * * 2
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
|
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
- uses: arduino/setup-protoc@v3
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GH_TOKEN }}
|
|
||||||
- run: bun run setup
|
|
||||||
|
|
||||||
- name: Find reviews
|
|
||||||
run: bun run build:reviews
|
|
||||||
@@ -17,36 +17,30 @@ concurrency:
|
|||||||
cancel-in-progress: ${{ github.ref == 'refs/heads/main' }}
|
cancel-in-progress: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
WOTB_SERVER: ${{ secrets.WOTB_SERVER }}
|
||||||
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
|
||||||
ALLOW_ROBOTS: ${{ secrets.ALLOW_ROBOTS }}
|
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
|
||||||
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
|
||||||
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
|
||||||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
|
||||||
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
|
||||||
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
|
||||||
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
|
||||||
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
|
||||||
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
|
|
||||||
PUBLIC_GUIDE_WEBSITE: ${{ secrets.PUBLIC_GUIDE_WEBSITE }}
|
|
||||||
SERVICING: ${{ secrets.SERVICING }}
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build website
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
token: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: latest
|
||||||
|
|
||||||
- uses: arduino/setup-protoc@v3
|
- uses: arduino/setup-protoc@v3
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GH_TOKEN }}
|
repo-token: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
- uses: actions/configure-pages@v5
|
- uses: actions/configure-pages@v5
|
||||||
|
|
||||||
- run: bun run setup
|
- run: bun run setup
|
||||||
|
|
||||||
- name: Build website
|
- name: Build website
|
||||||
@@ -58,7 +52,7 @@ jobs:
|
|||||||
path: dist/website
|
path: dist/website
|
||||||
|
|
||||||
deploy-github-pages:
|
deploy-github-pages:
|
||||||
if: ${{ github.ref == 'refs/heads/main' }}
|
if: ${{ github.ref == 'refs/heads/ue' && github.repository == 'blitzkit/host-beta' }}
|
||||||
name: Deploy to GitHub Pages
|
name: Deploy to GitHub Pages
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
+2
-1
@@ -22,7 +22,7 @@ depots
|
|||||||
public/sitemap*
|
public/sitemap*
|
||||||
/firebase.json
|
/firebase.json
|
||||||
target
|
target
|
||||||
# packages/core/src/protos/*.ts
|
packages/website-ue/src/protos/*.ts
|
||||||
/.vercel
|
/.vercel
|
||||||
.astro
|
.astro
|
||||||
.vercel
|
.vercel
|
||||||
@@ -53,3 +53,4 @@ dist-ssr
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
*.lscache
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
[submodule "packages/closed"]
|
[submodule "packages/closed"]
|
||||||
path = packages/closed
|
path = packages/closed
|
||||||
url = https://github.com/blitzkit/closed.git
|
url = https://github.com/blitzkit/closed.git
|
||||||
|
[submodule "packages/cue4parse"]
|
||||||
|
path = packages/cue4parse
|
||||||
|
url = https://github.com/FabianFG/CUE4Parse.git
|
||||||
Vendored
+15
-2
@@ -1,4 +1,6 @@
|
|||||||
{
|
{
|
||||||
|
// "js/ts.experimental.useTsgo": true,
|
||||||
|
"protobuf.includes": ["${workspaceFolder}/path/to/protos"],
|
||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
"AABBOX",
|
"AABBOX",
|
||||||
"Abhi",
|
"Abhi",
|
||||||
@@ -17,6 +19,7 @@
|
|||||||
"astrojs",
|
"astrojs",
|
||||||
"astrolib",
|
"astrolib",
|
||||||
"atgm",
|
"atgm",
|
||||||
|
"autocrop",
|
||||||
"Autoloader",
|
"Autoloader",
|
||||||
"Autoreloader",
|
"Autoreloader",
|
||||||
"AYUV",
|
"AYUV",
|
||||||
@@ -61,8 +64,10 @@
|
|||||||
"Ddpf",
|
"Ddpf",
|
||||||
"Ddsd",
|
"Ddsd",
|
||||||
"deadrail",
|
"deadrail",
|
||||||
|
"DEBUFF",
|
||||||
"debugflags",
|
"debugflags",
|
||||||
"deburr",
|
"deburr",
|
||||||
|
"deburred",
|
||||||
"decalmask",
|
"decalmask",
|
||||||
"decompressor",
|
"decompressor",
|
||||||
"décor",
|
"décor",
|
||||||
@@ -146,6 +151,7 @@
|
|||||||
"noout",
|
"noout",
|
||||||
"normalmap",
|
"normalmap",
|
||||||
"oneof",
|
"oneof",
|
||||||
|
"Oodle",
|
||||||
"oopsies",
|
"oopsies",
|
||||||
"Oopsy",
|
"Oopsy",
|
||||||
"opentest",
|
"opentest",
|
||||||
@@ -161,6 +167,7 @@
|
|||||||
"playerachievements",
|
"playerachievements",
|
||||||
"playerinfo",
|
"playerinfo",
|
||||||
"playform",
|
"playform",
|
||||||
|
"Playtest",
|
||||||
"pngjs",
|
"pngjs",
|
||||||
"POSITIVEX",
|
"POSITIVEX",
|
||||||
"POSITIVEY",
|
"POSITIVEY",
|
||||||
@@ -177,6 +184,7 @@
|
|||||||
"ratingleaderboard",
|
"ratingleaderboard",
|
||||||
"raycaster",
|
"raycaster",
|
||||||
"Redirector",
|
"Redirector",
|
||||||
|
"REGEN",
|
||||||
"Relogin",
|
"Relogin",
|
||||||
"researchable",
|
"researchable",
|
||||||
"Resvg",
|
"Resvg",
|
||||||
@@ -190,11 +198,14 @@
|
|||||||
"searchplayers",
|
"searchplayers",
|
||||||
"searchtanks",
|
"searchtanks",
|
||||||
"SHAREDEXP",
|
"SHAREDEXP",
|
||||||
|
"Skia",
|
||||||
"SKLLD",
|
"SKLLD",
|
||||||
|
"sluggify",
|
||||||
"smoothstep",
|
"smoothstep",
|
||||||
"Smri",
|
"Smri",
|
||||||
"Specularity",
|
"Specularity",
|
||||||
"SSAO",
|
"SSAO",
|
||||||
|
"stackable",
|
||||||
"startcase",
|
"startcase",
|
||||||
"statkit",
|
"statkit",
|
||||||
"statsfull",
|
"statsfull",
|
||||||
@@ -218,6 +229,7 @@
|
|||||||
"tungstentip",
|
"tungstentip",
|
||||||
"Turretless",
|
"Turretless",
|
||||||
"TYPELESS",
|
"TYPELESS",
|
||||||
|
"uasset",
|
||||||
"ubjson",
|
"ubjson",
|
||||||
"Unicum",
|
"Unicum",
|
||||||
"UNLOCALIZED",
|
"UNLOCALIZED",
|
||||||
@@ -227,6 +239,7 @@
|
|||||||
"unrotate",
|
"unrotate",
|
||||||
"unwrapper",
|
"unwrapper",
|
||||||
"userns",
|
"userns",
|
||||||
|
"usmap",
|
||||||
"vercel",
|
"vercel",
|
||||||
"vickers",
|
"vickers",
|
||||||
"vitepress",
|
"vitepress",
|
||||||
@@ -239,6 +252,7 @@
|
|||||||
"winrate",
|
"winrate",
|
||||||
"wireframe",
|
"wireframe",
|
||||||
"Woah",
|
"Woah",
|
||||||
|
"wooorm",
|
||||||
"WOTB",
|
"WOTB",
|
||||||
"wotblitz",
|
"wotblitz",
|
||||||
"wotbreplay",
|
"wotbreplay",
|
||||||
@@ -251,6 +265,5 @@
|
|||||||
"youtuber",
|
"youtuber",
|
||||||
"youtubers",
|
"youtubers",
|
||||||
"zoomable"
|
"zoomable"
|
||||||
],
|
]
|
||||||
"typescript.tsdk": "node_modules\\typescript\\lib"
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"folders": [
|
|
||||||
{
|
|
||||||
"path": ".",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "C:/Program Files/WindowsApps/7458BE2C.WorldofTanksBlitz_11.1.256.0_x64__x4tje2y229k00/Data",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# BlitzKit 1.29.13
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- The screenshot button now automatically crops your image so you don't have excessive blank space all around
|
||||||
|
- Increased the max zoom out distance in Tankopedia to 50m
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Turrets in Tankopedia now stay within a range of -180 and +180 degrees
|
||||||
|
- Tanks with transparency like the T34 and Herdbreaker are now properly rendered
|
||||||
|
- This will take a few days to roll out for all tanks (see screenshots below for the fixed models)
|
||||||
|
- High End Consumables now give a 33% boost instead of 70%
|
||||||
|
- Static Armor now properly deselects all irrelevant armor plates
|
||||||
|
- Removed a few debug loggers left behind
|
||||||
|
- Static Armor now properly rerenders armor plates when their thicknesses are changed
|
||||||
|
- The Ricochet Visualizer now stays in place when dragging around on mobile
|
||||||
|
- Reduced the text in the Tankopedia Compare segmented display to fit on smaller screens
|
||||||
|
- Sorting by tertiary shells no longer crashes for some tanks
|
||||||
|
- The Tank Filters are now left aligned on smaller screens for readability
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# BlitzKit 1.29.14
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- BlitzStars has enabled aggressive Cloudflare protections; hence, disabling BlitzKit from using BlitzStar's API
|
||||||
|
- Disabled the following commands:
|
||||||
|
- `/stats`
|
||||||
|
- `/today`
|
||||||
|
- `/breakdown`
|
||||||
|
- `/evolution`
|
||||||
|
- `/full-stats`
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# BlitzKit 1.29.15
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Tanks now use alpha clipping to render translucency, fixing a lot of "ghostly" looking tanks
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# BlitzKit 1.29.16
|
||||||
|
|
||||||
|
Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions this update.
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- [GonnaHetzMe] The turret for Centurion I is no longer offset from the body
|
||||||
|
- Please allow up to 24 hours for the model to update
|
||||||
|
- Vertical Stabilizers now give the correct 12% buff instead of 15%
|
||||||
|
- Re-ordering tanks in Compare now works once again
|
||||||
|
- Fixed review videos from being about the Object 452K across all tanks
|
||||||
|
- Please allow up to 2 weeks for all tanks to refresh their videos
|
||||||
|
- Tanks in Mixer with oscillating turrets are not handled properly
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Headings in the Compare tool are now even more compact for mobile devices
|
||||||
|
- Enabled all tiers for the randomizer in Mixer
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# BlitzKit 1.30.0
|
||||||
|
|
||||||
|
Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions this update.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added an equalizer mode for Tankopedia and Compare to preview what tank stats will look like in the upcoming Equalizer game mode
|
||||||
|
- This feature is in Beta and the stats are subject to change
|
||||||
|
- Thanks to WoTB News for sourcing data well ahead of the release of the gamemode
|
||||||
|
- Added a toggle in Tankopedia, right beneath Provisions
|
||||||
|
- Added button under the shell selector in the Tank Sandbox
|
||||||
|
- Added another toggle in the Compare table to enable equalizer for all tanks
|
||||||
|
|
||||||
|
## Technical Features
|
||||||
|
|
||||||
|
- [GonnaHetzMe] Enabling dev mode now displays the tank's non-numerical id
|
||||||
|
- [GonnaHetzMe] The dev id and the new dev name are now copyable on click
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- [GonnaHetzMe] Tech trees that start at tiers higher than tier 1 like the Blitz Nation ones now properly render their trees in Tankopedia
|
||||||
|
- [GonnaHetzMe] The tank pitch/yaw inputs in the Tank Sandbox now initialize with the correct values instead of 0
|
||||||
|
- [GonnaHetzMe] Large Repair Kits once again use the correct modern icon
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# BlitzKit 1.30.1
|
||||||
|
|
||||||
|
Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions this update.
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- [GonnaHetzMe] Tank hit points in Equalizer mode is now accurate to the game
|
||||||
|
- Armor highlighting now reflects the actual thicknesses of tanks in Equalizer mode
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# BlitzKit 1.30.2
|
||||||
|
|
||||||
|
Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions this update.
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- [GonnaHetzMe] Tungsten shells are now properly cropped
|
||||||
|
- Equalizer no longer gives insanely high penetration values
|
||||||
|
- The tank reveal animation no longer repeats when you scroll away and back to the tank sandbox
|
||||||
|
- [GonnaHetzMe] The RHM. Pzw.'s turret no longer has the floating plate
|
||||||
|
- Please give BlitzKit up to 1 hour to update the model
|
||||||
|
- [GonnaHetzMe] Tanks with inclined turret rings like the Minotauro now display the correct pitch in the tank sandbox inputs
|
||||||
+9
-35
@@ -1,51 +1,25 @@
|
|||||||
{
|
{
|
||||||
"name": "blitzkit",
|
"name": "blitzkit",
|
||||||
"version": "1.29.12",
|
"version": "2.0.0-beta.3",
|
||||||
"license": "BlitzKit License",
|
"license": "BlitzKit License",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:assets": "cd packages/scripts && bun run build:assets",
|
"setup": "bun install && bun run build:protos && bun run build:proxyclient && bun run build:catalogitemaccessor",
|
||||||
"build:averages": "bun --filter=@blitzkit/scripts run build:averages",
|
|
||||||
"build:bot": "cd packages/scripts && bun run build:bot",
|
|
||||||
"build:website": "cd packages/website && bun run build",
|
|
||||||
"build:prisma": "prisma generate",
|
|
||||||
"build:proxyclient": "cd packages/scripts && bun run build:proxyclient",
|
|
||||||
"build:catalogitemaccesssor": "cd packages/scripts && bun run build:catalogitemaccesssor",
|
|
||||||
"build:ratingleaderboard": "cd packages/scripts && bun run build:ratingleaderboard",
|
|
||||||
"build:app": "cd packages/app && bun run build",
|
|
||||||
"dev:bot": "bun run build:bot --dev && bun start:bot --dev",
|
|
||||||
"start:bot": "bun dist/bot/main.js",
|
|
||||||
"dev:docs": "vitepress dev docs",
|
|
||||||
"dev:website": "cd packages/website && bun run dev",
|
|
||||||
"dev:app": "cd packages/app && bun run dev",
|
|
||||||
"dev": "bun run dev:website",
|
"dev": "bun run dev:website",
|
||||||
"dev:api": "bun --filter=@blitzkit/api run dev",
|
"dev:website": "cd packages/website-ue && bun run dev",
|
||||||
"setup:depotdownloader": "bun --filter=@blitzkit/scripts run setup:depotdownloader",
|
"build:game": "cd packages/game && bun run build",
|
||||||
"setup:patches": "bun --filter=@blitzkit/scripts run setup:patches",
|
"build:website": "cd packages/website-ue && bun run build",
|
||||||
"start:website": "bun --filter=@blitzkit/website run start",
|
"build:proxyclient": "cd packages/scripts && bun run build:proxyclient",
|
||||||
"host:docs": "vitepress preview docs",
|
"build:catalogitemaccessor": "cd packages/scripts && bun run build:catalogitemaccessor",
|
||||||
"lint": "tsc",
|
|
||||||
"lint:website": "cd packages/website && bun run lint",
|
|
||||||
"format": "prettier --write \"**/*.@(json|js|jsx|css|md|ts|tsx|html|xml|yml|gltf)\"",
|
|
||||||
"update": "yarn upgrade --latest",
|
|
||||||
"tunnel": "cloudflared tunnel --url http://localhost:3000",
|
|
||||||
"discoverids": "scripts/discoverIds.ts",
|
|
||||||
"build:protos": "cd packages/scripts && bun run build:protos",
|
"build:protos": "cd packages/scripts && bun run build:protos",
|
||||||
"preview:website": "cd packages/website && bun run preview",
|
"lint": "tsc",
|
||||||
"build:reviews": "cd packages/scripts && bun build:reviews",
|
"lint:website": "cd packages/website-ue && bun run lint"
|
||||||
"build:ids": "cd packages/scripts && bun build:ids",
|
|
||||||
"prunestrings": "cd packages/scripts && bun prunestrings",
|
|
||||||
"setup": "bun install && bun run build:prisma && bun run build:protos && bun run build:proxyclient",
|
|
||||||
"patchnotes": "cd packages/scripts && bun run patchnotes"
|
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@prisma/client": "^6.18.0",
|
|
||||||
"prisma": "^6.18.0",
|
|
||||||
"sharp": "^0.34.5",
|
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,49 +1,46 @@
|
|||||||
import { getBlitzStarsLinkButton } from '../../core/blitzstars/getBlitzStarsLinkButton';
|
import { addPeriodicFilterOptions } from "../../core/discord/addPeriodicFilterOptions";
|
||||||
import { addPeriodicFilterOptions } from '../../core/discord/addPeriodicFilterOptions';
|
import { addUsernameChoices } from "../../core/discord/addUsernameChoices";
|
||||||
import { addUsernameChoices } from '../../core/discord/addUsernameChoices';
|
import { autocompleteTanks } from "../../core/discord/autocompleteTanks";
|
||||||
import { autocompleteTanks } from '../../core/discord/autocompleteTanks';
|
import { autocompleteUsername } from "../../core/discord/autocompleteUsername";
|
||||||
import { autocompleteUsername } from '../../core/discord/autocompleteUsername';
|
import { createLocalizedCommand } from "../../core/discord/createLocalizedCommand";
|
||||||
import { buttonRefresh } from '../../core/discord/buttonRefresh';
|
import { getFiltersFromButton } from "../../core/discord/getFiltersFromButton";
|
||||||
import { commandToURL } from '../../core/discord/commandToURL';
|
import { resolvePeriodFromButton } from "../../core/discord/resolvePeriodFromButton";
|
||||||
import { createLocalizedCommand } from '../../core/discord/createLocalizedCommand';
|
import { resolvePlayerFromButton } from "../../core/discord/resolvePlayerFromButton";
|
||||||
import { getCustomPeriodParams } from '../../core/discord/getCustomPeriodParams';
|
import { translator } from "../../core/localization/translator";
|
||||||
import { getFiltersFromButton } from '../../core/discord/getFiltersFromButton';
|
import type { CommandRegistry } from "../../events/interactionCreate";
|
||||||
import { getFiltersFromCommand } from '../../core/discord/getFiltersFromCommand';
|
import { renderBreakdown } from "./render";
|
||||||
import { resolvePeriodFromButton } from '../../core/discord/resolvePeriodFromButton';
|
|
||||||
import { resolvePeriodFromCommand } from '../../core/discord/resolvePeriodFromCommand';
|
|
||||||
import { resolvePlayerFromButton } from '../../core/discord/resolvePlayerFromButton';
|
|
||||||
import { resolvePlayerFromCommand } from '../../core/discord/resolvePlayerFromCommand';
|
|
||||||
import type { CommandRegistry } from '../../events/interactionCreate';
|
|
||||||
import { renderBreakdown } from './render';
|
|
||||||
|
|
||||||
export const breakdownCommand = new Promise<CommandRegistry>(
|
export const breakdownCommand = new Promise<CommandRegistry>(
|
||||||
async (resolve) => {
|
async (resolve) => {
|
||||||
resolve({
|
resolve({
|
||||||
command: await addPeriodicFilterOptions(
|
command: await addPeriodicFilterOptions(
|
||||||
createLocalizedCommand('breakdown'),
|
createLocalizedCommand("breakdown"),
|
||||||
(option) => option.addStringOption(addUsernameChoices),
|
(option) => option.addStringOption(addUsernameChoices),
|
||||||
),
|
),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const player = await resolvePlayerFromCommand(interaction);
|
const { strings } = translator(interaction.locale);
|
||||||
const period = resolvePeriodFromCommand(player.region, interaction);
|
return strings.bot.commands.dead;
|
||||||
const filters = await getFiltersFromCommand(interaction);
|
|
||||||
const path = commandToURL(interaction, {
|
|
||||||
...player,
|
|
||||||
...getCustomPeriodParams(interaction),
|
|
||||||
...filters,
|
|
||||||
});
|
|
||||||
|
|
||||||
return [
|
// const player = await resolvePlayerFromCommand(interaction);
|
||||||
...(await renderBreakdown(
|
// const period = resolvePeriodFromCommand(player.region, interaction);
|
||||||
player,
|
// const filters = await getFiltersFromCommand(interaction);
|
||||||
period,
|
// const path = commandToURL(interaction, {
|
||||||
filters,
|
// ...player,
|
||||||
interaction.locale,
|
// ...getCustomPeriodParams(interaction),
|
||||||
)),
|
// ...filters,
|
||||||
buttonRefresh(interaction, path),
|
// });
|
||||||
await getBlitzStarsLinkButton(player.region, player.id),
|
|
||||||
];
|
// return [
|
||||||
|
// ...(await renderBreakdown(
|
||||||
|
// player,
|
||||||
|
// period,
|
||||||
|
// filters,
|
||||||
|
// interaction.locale,
|
||||||
|
// )),
|
||||||
|
// buttonRefresh(interaction, path),
|
||||||
|
// await getBlitzStarsLinkButton(player.region, player.id),
|
||||||
|
// ];
|
||||||
},
|
},
|
||||||
|
|
||||||
autocomplete: (interaction) => {
|
autocomplete: (interaction) => {
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import * as Graph from "../components/Graph";
|
|||||||
import { LineColor } from "../components/Graph/components/Line/constants";
|
import { LineColor } from "../components/Graph/components/Line/constants";
|
||||||
import { NoData } from "../components/NoData";
|
import { NoData } from "../components/NoData";
|
||||||
import { TitleBar } from "../components/TitleBar";
|
import { TitleBar } from "../components/TitleBar";
|
||||||
import { resolveTankId } from "../core/blitz/resolveTankId";
|
|
||||||
import { getBlitzStarsLinkButton } from "../core/blitzstars/getBlitzStarsLinkButton";
|
|
||||||
import { getPlayerHistories } from "../core/blitzstars/getPlayerHistories";
|
import { getPlayerHistories } from "../core/blitzstars/getPlayerHistories";
|
||||||
import { getTankHistories } from "../core/blitzstars/getTankHistories";
|
import { getTankHistories } from "../core/blitzstars/getTankHistories";
|
||||||
import { addPeriodSubCommands } from "../core/discord/addPeriodSubCommands";
|
import { addPeriodSubCommands } from "../core/discord/addPeriodSubCommands";
|
||||||
@@ -14,20 +12,12 @@ import { addTankChoices } from "../core/discord/addTankChoices";
|
|||||||
import { addUsernameChoices } from "../core/discord/addUsernameChoices";
|
import { addUsernameChoices } from "../core/discord/addUsernameChoices";
|
||||||
import { autocompleteTanks } from "../core/discord/autocompleteTanks";
|
import { autocompleteTanks } from "../core/discord/autocompleteTanks";
|
||||||
import { autocompleteUsername } from "../core/discord/autocompleteUsername";
|
import { autocompleteUsername } from "../core/discord/autocompleteUsername";
|
||||||
import { buttonRefresh } from "../core/discord/buttonRefresh";
|
|
||||||
import { commandToURL } from "../core/discord/commandToURL";
|
|
||||||
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||||
import { getCustomPeriodParams } from "../core/discord/getCustomPeriodParams";
|
|
||||||
import { resolvePeriodFromButton } from "../core/discord/resolvePeriodFromButton";
|
import { resolvePeriodFromButton } from "../core/discord/resolvePeriodFromButton";
|
||||||
import {
|
import { type ResolvedPeriod } from "../core/discord/resolvePeriodFromCommand";
|
||||||
type ResolvedPeriod,
|
|
||||||
resolvePeriodFromCommand,
|
|
||||||
} from "../core/discord/resolvePeriodFromCommand";
|
|
||||||
import { resolvePlayerFromButton } from "../core/discord/resolvePlayerFromButton";
|
import { resolvePlayerFromButton } from "../core/discord/resolvePlayerFromButton";
|
||||||
import {
|
import { type ResolvedPlayer } from "../core/discord/resolvePlayerFromCommand";
|
||||||
type ResolvedPlayer,
|
import { translator } from "../core/localization/translator";
|
||||||
resolvePlayerFromCommand,
|
|
||||||
} from "../core/discord/resolvePlayerFromCommand";
|
|
||||||
import type { CommandRegistry } from "../events/interactionCreate";
|
import type { CommandRegistry } from "../events/interactionCreate";
|
||||||
|
|
||||||
type EvolutionStatType = "player" | "tank";
|
type EvolutionStatType = "player" | "tank";
|
||||||
@@ -37,7 +27,7 @@ async function render(
|
|||||||
{ start, end, name }: ResolvedPeriod,
|
{ start, end, name }: ResolvedPeriod,
|
||||||
type: "player" | "tank",
|
type: "player" | "tank",
|
||||||
tankId: number | null,
|
tankId: number | null,
|
||||||
locale: Locale
|
locale: Locale,
|
||||||
) {
|
) {
|
||||||
const accountInfo = await getAccountInfo(region, id);
|
const accountInfo = await getAccountInfo(region, id);
|
||||||
const clan = (await getClanAccountInfo(region, id, ["clan"]))?.clan;
|
const clan = (await getClanAccountInfo(region, id, ["clan"]))?.clan;
|
||||||
@@ -61,7 +51,7 @@ async function render(
|
|||||||
[
|
[
|
||||||
history.all.battles,
|
history.all.battles,
|
||||||
(history.all.wins / history.all.battles) * 100,
|
(history.all.wins / history.all.battles) * 100,
|
||||||
] as Graph.PlotItem
|
] as Graph.PlotItem,
|
||||||
);
|
);
|
||||||
const times = histories.map((history) => history.last_battle_time);
|
const times = histories.map((history) => history.last_battle_time);
|
||||||
const minTime = Math.min(...times);
|
const minTime = Math.min(...times);
|
||||||
@@ -115,7 +105,7 @@ export const evolutionCommand = new Promise<CommandRegistry>(
|
|||||||
group: "player",
|
group: "player",
|
||||||
modify(option: SlashCommandSubcommandGroupBuilder) {
|
modify(option: SlashCommandSubcommandGroupBuilder) {
|
||||||
addPeriodSubCommands(option, (option) =>
|
addPeriodSubCommands(option, (option) =>
|
||||||
option.addStringOption(addUsernameChoices)
|
option.addStringOption(addUsernameChoices),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -125,43 +115,46 @@ export const evolutionCommand = new Promise<CommandRegistry>(
|
|||||||
addPeriodSubCommands(option, (option) =>
|
addPeriodSubCommands(option, (option) =>
|
||||||
option
|
option
|
||||||
.addStringOption(addTankChoices)
|
.addStringOption(addTankChoices)
|
||||||
.addStringOption(addUsernameChoices)
|
.addStringOption(addUsernameChoices),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const commandGroup =
|
const { strings } = translator(interaction.locale);
|
||||||
interaction.options.getSubcommandGroup() as EvolutionStatType;
|
return strings.bot.commands.dead;
|
||||||
const player = await resolvePlayerFromCommand(interaction);
|
|
||||||
const period = resolvePeriodFromCommand(player.region, interaction);
|
|
||||||
const tankIdRaw = interaction.options.getString("tank")!;
|
|
||||||
const tankId =
|
|
||||||
commandGroup === "tank"
|
|
||||||
? await resolveTankId(tankIdRaw, interaction.locale)
|
|
||||||
: null;
|
|
||||||
const path = commandToURL(interaction, {
|
|
||||||
...player,
|
|
||||||
...getCustomPeriodParams(interaction),
|
|
||||||
tankId,
|
|
||||||
});
|
|
||||||
|
|
||||||
return [
|
// const commandGroup =
|
||||||
await render(
|
// interaction.options.getSubcommandGroup() as EvolutionStatType;
|
||||||
player,
|
// const player = await resolvePlayerFromCommand(interaction);
|
||||||
period,
|
// const period = resolvePeriodFromCommand(player.region, interaction);
|
||||||
commandGroup,
|
// const tankIdRaw = interaction.options.getString("tank")!;
|
||||||
tankId,
|
// const tankId =
|
||||||
interaction.locale
|
// commandGroup === "tank"
|
||||||
),
|
// ? await resolveTankId(tankIdRaw, interaction.locale)
|
||||||
buttonRefresh(interaction, path),
|
// : null;
|
||||||
await getBlitzStarsLinkButton(
|
// const path = commandToURL(interaction, {
|
||||||
player.region,
|
// ...player,
|
||||||
player.id,
|
// ...getCustomPeriodParams(interaction),
|
||||||
tankId ?? undefined
|
// tankId,
|
||||||
),
|
// });
|
||||||
];
|
|
||||||
|
// return [
|
||||||
|
// await render(
|
||||||
|
// player,
|
||||||
|
// period,
|
||||||
|
// commandGroup,
|
||||||
|
// tankId,
|
||||||
|
// interaction.locale
|
||||||
|
// ),
|
||||||
|
// buttonRefresh(interaction, path),
|
||||||
|
// await getBlitzStarsLinkButton(
|
||||||
|
// player.region,
|
||||||
|
// player.id,
|
||||||
|
// tankId ?? undefined
|
||||||
|
// ),
|
||||||
|
// ];
|
||||||
},
|
},
|
||||||
|
|
||||||
autocomplete: (interaction) => {
|
autocomplete: (interaction) => {
|
||||||
@@ -181,9 +174,9 @@ export const evolutionCommand = new Promise<CommandRegistry>(
|
|||||||
period,
|
period,
|
||||||
commandGroup,
|
commandGroup,
|
||||||
parseInt(url.searchParams.get("tankId") ?? "0") || null,
|
parseInt(url.searchParams.get("tankId") ?? "0") || null,
|
||||||
interaction.locale
|
interaction.locale,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
@@ -3,38 +3,28 @@ import {
|
|||||||
getAccountInfo,
|
getAccountInfo,
|
||||||
getClanAccountInfo,
|
getClanAccountInfo,
|
||||||
getTierWeights,
|
getTierWeights,
|
||||||
} from '@blitzkit/core';
|
} from "@blitzkit/core";
|
||||||
import { Locale } from 'discord.js';
|
import { Locale } from "discord.js";
|
||||||
import { CommandWrapper } from '../components/CommandWrapper';
|
import { CommandWrapper } from "../components/CommandWrapper";
|
||||||
import { GenericAllStats } from '../components/GenericAllStats';
|
import { GenericAllStats } from "../components/GenericAllStats";
|
||||||
import { NoData } from '../components/NoData';
|
import { NoData } from "../components/NoData";
|
||||||
import { TierWeights } from '../components/TierWeights';
|
import { TierWeights } from "../components/TierWeights";
|
||||||
import { TitleBar } from '../components/TitleBar';
|
import { TitleBar } from "../components/TitleBar";
|
||||||
import { filtersToDescription } from '../core/blitzkit/filtersToDescription';
|
import { filtersToDescription } from "../core/blitzkit/filtersToDescription";
|
||||||
import { filterStats, type StatFilters } from '../core/blitzstars/filterStats';
|
import { filterStats, type StatFilters } from "../core/blitzstars/filterStats";
|
||||||
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
|
import { getStatsInPeriod } from "../core/blitzstars/getStatsInPeriod";
|
||||||
import { getStatsInPeriod } from '../core/blitzstars/getStatsInPeriod';
|
import { addPeriodicFilterOptions } from "../core/discord/addPeriodicFilterOptions";
|
||||||
import { addPeriodicFilterOptions } from '../core/discord/addPeriodicFilterOptions';
|
import { addUsernameChoices } from "../core/discord/addUsernameChoices";
|
||||||
import { addUsernameChoices } from '../core/discord/addUsernameChoices';
|
import { autocompleteTanks } from "../core/discord/autocompleteTanks";
|
||||||
import { autocompleteTanks } from '../core/discord/autocompleteTanks';
|
import { autocompleteUsername } from "../core/discord/autocompleteUsername";
|
||||||
import { autocompleteUsername } from '../core/discord/autocompleteUsername';
|
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||||
import { buttonRefresh } from '../core/discord/buttonRefresh';
|
import { getFiltersFromButton } from "../core/discord/getFiltersFromButton";
|
||||||
import { commandToURL } from '../core/discord/commandToURL';
|
import { resolvePeriodFromButton } from "../core/discord/resolvePeriodFromButton";
|
||||||
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
import { type ResolvedPeriod } from "../core/discord/resolvePeriodFromCommand";
|
||||||
import { getCustomPeriodParams } from '../core/discord/getCustomPeriodParams';
|
import { resolvePlayerFromButton } from "../core/discord/resolvePlayerFromButton";
|
||||||
import { getFiltersFromButton } from '../core/discord/getFiltersFromButton';
|
import { type ResolvedPlayer } from "../core/discord/resolvePlayerFromCommand";
|
||||||
import { getFiltersFromCommand } from '../core/discord/getFiltersFromCommand';
|
import { translator } from "../core/localization/translator";
|
||||||
import { resolvePeriodFromButton } from '../core/discord/resolvePeriodFromButton';
|
import type { CommandRegistry } from "../events/interactionCreate";
|
||||||
import {
|
|
||||||
type ResolvedPeriod,
|
|
||||||
resolvePeriodFromCommand,
|
|
||||||
} from '../core/discord/resolvePeriodFromCommand';
|
|
||||||
import { resolvePlayerFromButton } from '../core/discord/resolvePlayerFromButton';
|
|
||||||
import {
|
|
||||||
type ResolvedPlayer,
|
|
||||||
resolvePlayerFromCommand,
|
|
||||||
} from '../core/discord/resolvePlayerFromCommand';
|
|
||||||
import type { CommandRegistry } from '../events/interactionCreate';
|
|
||||||
|
|
||||||
async function render(
|
async function render(
|
||||||
{ region, id }: ResolvedPlayer,
|
{ region, id }: ResolvedPlayer,
|
||||||
@@ -43,7 +33,7 @@ async function render(
|
|||||||
locale: Locale,
|
locale: Locale,
|
||||||
) {
|
) {
|
||||||
const { nickname } = await getAccountInfo(region, id);
|
const { nickname } = await getAccountInfo(region, id);
|
||||||
const clan = (await getClanAccountInfo(region, id, ['clan']))?.clan;
|
const clan = (await getClanAccountInfo(region, id, ["clan"]))?.clan;
|
||||||
const clanImage = clan ? emblemURL(clan.emblem_set_id) : undefined;
|
const clanImage = clan ? emblemURL(clan.emblem_set_id) : undefined;
|
||||||
const diffedTankStats = await getStatsInPeriod(
|
const diffedTankStats = await getStatsInPeriod(
|
||||||
region,
|
region,
|
||||||
@@ -86,25 +76,28 @@ export const fullStatsCommand = new Promise<CommandRegistry>(
|
|||||||
async (resolve) => {
|
async (resolve) => {
|
||||||
resolve({
|
resolve({
|
||||||
command: await addPeriodicFilterOptions(
|
command: await addPeriodicFilterOptions(
|
||||||
createLocalizedCommand('full-stats'),
|
createLocalizedCommand("full-stats"),
|
||||||
(option) => option.addStringOption(addUsernameChoices),
|
(option) => option.addStringOption(addUsernameChoices),
|
||||||
),
|
),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const player = await resolvePlayerFromCommand(interaction);
|
const { strings } = translator(interaction.locale);
|
||||||
const period = resolvePeriodFromCommand(player.region, interaction);
|
return strings.bot.commands.dead;
|
||||||
const filters = await getFiltersFromCommand(interaction);
|
|
||||||
const path = commandToURL(interaction, {
|
|
||||||
...player,
|
|
||||||
...getCustomPeriodParams(interaction),
|
|
||||||
...filters,
|
|
||||||
});
|
|
||||||
|
|
||||||
return Promise.all([
|
// const player = await resolvePlayerFromCommand(interaction);
|
||||||
render(player, period, filters, interaction.locale),
|
// const period = resolvePeriodFromCommand(player.region, interaction);
|
||||||
buttonRefresh(interaction, path),
|
// const filters = await getFiltersFromCommand(interaction);
|
||||||
getBlitzStarsLinkButton(player.region, player.id),
|
// const path = commandToURL(interaction, {
|
||||||
]);
|
// ...player,
|
||||||
|
// ...getCustomPeriodParams(interaction),
|
||||||
|
// ...filters,
|
||||||
|
// });
|
||||||
|
|
||||||
|
// return Promise.all([
|
||||||
|
// render(player, period, filters, interaction.locale),
|
||||||
|
// buttonRefresh(interaction, path),
|
||||||
|
// getBlitzStarsLinkButton(player.region, player.id),
|
||||||
|
// ]);
|
||||||
},
|
},
|
||||||
|
|
||||||
autocomplete: (interaction) => {
|
autocomplete: (interaction) => {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export const ownedTanksCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
tankStats.map(async (tankData) => ({
|
tankStats.map(async (tankData) => ({
|
||||||
tankDefinitions: (await tankDefinitions).tanks[tankData.tank_id]!,
|
tankDefinitions: (await tankDefinitions).tanks[tankData.tank_id]!,
|
||||||
id: tankData.tank_id,
|
id: tankData.tank_id,
|
||||||
}))
|
})),
|
||||||
)
|
)
|
||||||
).filter((tank) => tank.tankDefinitions?.tier === tier);
|
).filter((tank) => tank.tankDefinitions?.tier === tier);
|
||||||
const groupedTanks: Record<string, TankDefinition[]> = {};
|
const groupedTanks: Record<string, TankDefinition[]> = {};
|
||||||
@@ -69,16 +69,16 @@ export const ownedTanksCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
.filter((tank) => tank.tier === tier)
|
.filter((tank) => tank.tier === tier)
|
||||||
.sort(
|
.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
TANK_CLASSES.indexOf(a.class) - TANK_CLASSES.indexOf(b.class)
|
TANK_CLASSES.indexOf(a.class) - TANK_CLASSES.indexOf(b.class),
|
||||||
)
|
)
|
||||||
.sort(
|
.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
awaitedGameDefinitions.nations.indexOf(a.nation) -
|
awaitedGameDefinitions.nations.indexOf(a.nation) -
|
||||||
awaitedGameDefinitions.nations.indexOf(b.nation)
|
awaitedGameDefinitions.nations.indexOf(b.nation),
|
||||||
)
|
)
|
||||||
.map(
|
.map(
|
||||||
(tank) =>
|
(tank) =>
|
||||||
`[${flags[tank.nation]} ${markdownEscape(unwrap(tank.name))}](<https://blitzkit.app/tanks/${tank.slug}>)`
|
`[${flags[tank.nation]} ${markdownEscape(unwrap(tank.name!))}](<https://blitzkit.app/tanks/${tank.slug}>)`,
|
||||||
);
|
);
|
||||||
const lines = [title, ...tankList];
|
const lines = [title, ...tankList];
|
||||||
|
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ async function playerListing(
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
alt={unwrap(tank.name)}
|
alt={unwrap(tank.name!)}
|
||||||
src={await iconPng(tankIcon(tank.id))}
|
src={await iconPng(tankIcon(tank.id))}
|
||||||
style={{
|
style={{
|
||||||
width: 32,
|
width: 32,
|
||||||
@@ -317,7 +317,7 @@ async function playerListing(
|
|||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{unwrap(tank.name)}
|
{unwrap(tank.name!)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -35,49 +35,49 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
command: createLocalizedCommand("research")
|
command: createLocalizedCommand("research")
|
||||||
.addStringOption((option) =>
|
.addStringOption((option) =>
|
||||||
option
|
option
|
||||||
.setName(strings.bot.commands.research.options.target_tank.name)
|
.setName(strings.bot.commands.research.options.target_tank.name!)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
(strings) =>
|
(strings) =>
|
||||||
strings.bot.commands.research.options.target_tank.name,
|
strings.bot.commands.research.options.target_tank.name,
|
||||||
undefined,
|
undefined,
|
||||||
true
|
true,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
strings.bot.commands.research.options.target_tank.description
|
strings.bot.commands.research.options.target_tank.description,
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
(strings) =>
|
(strings) =>
|
||||||
strings.bot.commands.research.options.target_tank.description
|
strings.bot.commands.research.options.target_tank.description,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
.setAutocomplete(true)
|
.setAutocomplete(true)
|
||||||
.setRequired(true)
|
.setRequired(true),
|
||||||
)
|
)
|
||||||
.addStringOption((option) =>
|
.addStringOption((option) =>
|
||||||
option
|
option
|
||||||
.setName(strings.bot.commands.research.options.starting_tank.name)
|
.setName(strings.bot.commands.research.options.starting_tank.name!)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
(strings) =>
|
(strings) =>
|
||||||
strings.bot.commands.research.options.starting_tank.name,
|
strings.bot.commands.research.options.starting_tank.name,
|
||||||
undefined,
|
undefined,
|
||||||
true
|
true,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
strings.bot.commands.research.options.starting_tank.description
|
strings.bot.commands.research.options.starting_tank.description,
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
(strings) =>
|
(strings) =>
|
||||||
strings.bot.commands.research.options.starting_tank.description
|
strings.bot.commands.research.options.starting_tank.description,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
.setAutocomplete(true)
|
.setAutocomplete(true)
|
||||||
.setRequired(false)
|
.setRequired(false),
|
||||||
)
|
)
|
||||||
.addStringOption(addUsernameChoices),
|
.addStringOption(addUsernameChoices),
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
const targetTankId = await resolveTankId(
|
const targetTankId = await resolveTankId(
|
||||||
interaction.options.getString("target-tank", true),
|
interaction.options.getString("target-tank", true),
|
||||||
interaction.locale,
|
interaction.locale,
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
const startingTankRaw = interaction.options.getString("starting-tank");
|
const startingTankRaw = interaction.options.getString("starting-tank");
|
||||||
const targetTank = awaitedTankDefinitions.tanks[targetTankId];
|
const targetTank = awaitedTankDefinitions.tanks[targetTankId];
|
||||||
@@ -99,13 +99,13 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
startingTankId = await resolveTankId(
|
startingTankId = await resolveTankId(
|
||||||
startingTankRaw,
|
startingTankRaw,
|
||||||
interaction.locale,
|
interaction.locale,
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (targetTankId === startingTankId) {
|
if (targetTankId === startingTankId) {
|
||||||
return literals(
|
return literals(
|
||||||
strings.bot.commands.research.errors.start_end_equal,
|
strings.bot.commands.research.errors.start_end_equal,
|
||||||
{ tank: escapeMarkdown(unwrap(targetTank.name)) }
|
{ tank: escapeMarkdown(unwrap(targettank.name!)) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,8 +113,8 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
|
|
||||||
if (startingTank.tier > targetTank.tier) {
|
if (startingTank.tier > targetTank.tier) {
|
||||||
return literals(strings.bot.commands.research.errors.unordered, {
|
return literals(strings.bot.commands.research.errors.unordered, {
|
||||||
tank_1: escapeMarkdown(unwrap(startingTank.name)),
|
tank_1: escapeMarkdown(unwrap(startingtank.name!)),
|
||||||
tank_2: escapeMarkdown(unwrap(targetTank.name)),
|
tank_2: escapeMarkdown(unwrap(targettank.name!)),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,21 +122,21 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
return literals(
|
return literals(
|
||||||
strings.bot.commands.research.errors.tanks_not_on_line,
|
strings.bot.commands.research.errors.tanks_not_on_line,
|
||||||
{
|
{
|
||||||
tank_1: escapeMarkdown(unwrap(targetTank.name)),
|
tank_1: escapeMarkdown(unwrap(targettank.name!)),
|
||||||
tank_2: escapeMarkdown(unwrap(startingTank.name)),
|
tank_2: escapeMarkdown(unwrap(startingtank.name!)),
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (targetTank.type !== TankType.RESEARCHABLE) {
|
if (targetTank.type !== TankType.TANK_TYPE_RESEARCHABLE) {
|
||||||
return literals(strings.bot.commands.research.errors.non_tech_tree, {
|
return literals(strings.bot.commands.research.errors.non_tech_tree, {
|
||||||
tank: escapeMarkdown(unwrap(targetTank.name)),
|
tank: escapeMarkdown(unwrap(targettank.name!)),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetTank.tier === 1) {
|
if (targetTank.tier === 1) {
|
||||||
return literals(strings.bot.commands.research.errors.tier_1, {
|
return literals(strings.bot.commands.research.errors.tier_1, {
|
||||||
tank: escapeMarkdown(unwrap(targetTank.name)),
|
tank: escapeMarkdown(unwrap(targettank.name!)),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,14 +149,14 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
if (tankStats.some(({ tank_id }) => tank_id === targetTankId)) {
|
if (tankStats.some(({ tank_id }) => tank_id === targetTankId)) {
|
||||||
return literals(
|
return literals(
|
||||||
strings.bot.commands.research.errors.already_researched,
|
strings.bot.commands.research.errors.already_researched,
|
||||||
{ tank: escapeMarkdown(unwrap(targetTank.name)) }
|
{ tank: escapeMarkdown(unwrap(targettank.name!)) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const foundAncestor = targetTankAncestry.find(
|
const foundAncestor = targetTankAncestry.find(
|
||||||
(id) =>
|
(id) =>
|
||||||
awaitedTankDefinitions.tanks[id].tier === 1 ||
|
awaitedTankDefinitions.tanks[id].tier === 1 ||
|
||||||
tankStats.some(({ tank_id }) => tank_id === id)
|
tankStats.some(({ tank_id }) => tank_id === id),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (foundAncestor === undefined) {
|
if (foundAncestor === undefined) {
|
||||||
@@ -168,7 +168,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
|
|
||||||
const techTreeLine = await buildTechTreeLine(
|
const techTreeLine = await buildTechTreeLine(
|
||||||
startingTankId,
|
startingTankId,
|
||||||
targetTankId
|
targetTankId,
|
||||||
);
|
);
|
||||||
|
|
||||||
const line = [...techTreeLine, startingTankId].reverse();
|
const line = [...techTreeLine, startingTankId].reverse();
|
||||||
@@ -190,7 +190,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
) {
|
) {
|
||||||
turretXps.set(
|
turretXps.set(
|
||||||
turret.id,
|
turret.id,
|
||||||
turret.research_cost.research_cost_type!.value
|
turret.research_cost.research_cost_type!.value,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
) {
|
) {
|
||||||
engineXps.set(
|
engineXps.set(
|
||||||
engine.id,
|
engine.id,
|
||||||
engine.research_cost.research_cost_type!.value
|
engine.research_cost.research_cost_type!.value,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -223,7 +223,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
) {
|
) {
|
||||||
trackXps.set(
|
trackXps.set(
|
||||||
track.id,
|
track.id,
|
||||||
track.research_cost.research_cost_type!.value
|
track.research_cost.research_cost_type!.value,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -245,13 +245,13 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
return {
|
return {
|
||||||
research: tank.research_cost!.research_cost_type!.value as number,
|
research: tank.research_cost!.research_cost_type!.value as number,
|
||||||
upgrades: moduleXp,
|
upgrades: moduleXp,
|
||||||
purchase: tank.price.value,
|
purchase: tank.price!.value,
|
||||||
equipment: equipmentPriceMatrix[tank.tier].reduce(
|
equipment: equipmentPriceMatrix[tank.tier].reduce(
|
||||||
(a, b) => a + 3 * b,
|
(a, b) => a + 3 * b,
|
||||||
0
|
0,
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
const image = (
|
const image = (
|
||||||
@@ -456,7 +456,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
alt={unwrap(tank.name)}
|
alt={unwrap(tank.name!)}
|
||||||
src={TANK_ICONS[tank.class]}
|
src={TANK_ICONS[tank.class]}
|
||||||
width={16}
|
width={16}
|
||||||
height={16}
|
height={16}
|
||||||
@@ -467,7 +467,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
color: theme.colors.textHighContrast,
|
color: theme.colors.textHighContrast,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{unwrap(tank.name)}
|
{unwrap(tank.name!)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -505,9 +505,9 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
strings.bot.commands.research.body.research,
|
strings.bot.commands.research.body.research,
|
||||||
{
|
{
|
||||||
cost: costs[index].research?.toLocaleString(
|
cost: costs[index].research?.toLocaleString(
|
||||||
interaction.locale
|
interaction.locale,
|
||||||
),
|
),
|
||||||
}
|
},
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -523,7 +523,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
<img
|
<img
|
||||||
alt="Free XP icon"
|
alt="Free XP icon"
|
||||||
src={await iconPng(
|
src={await iconPng(
|
||||||
asset("icons/currencies/free-xp.webp")
|
asset("icons/currencies/free-xp.webp"),
|
||||||
)}
|
)}
|
||||||
width={16}
|
width={16}
|
||||||
height={16}
|
height={16}
|
||||||
@@ -536,7 +536,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
>
|
>
|
||||||
{literals(
|
{literals(
|
||||||
strings.bot.commands.research.body.upgrades,
|
strings.bot.commands.research.body.upgrades,
|
||||||
{ cost: costs[index].upgrades.toLocaleString() }
|
{ cost: costs[index].upgrades.toLocaleString() },
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -552,7 +552,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
<img
|
<img
|
||||||
alt="Silver icon"
|
alt="Silver icon"
|
||||||
src={await iconPng(
|
src={await iconPng(
|
||||||
asset("icons/currencies/silver.webp")
|
asset("icons/currencies/silver.webp"),
|
||||||
)}
|
)}
|
||||||
width={16}
|
width={16}
|
||||||
height={16}
|
height={16}
|
||||||
@@ -567,9 +567,9 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
strings.bot.commands.research.body.purchase,
|
strings.bot.commands.research.body.purchase,
|
||||||
{
|
{
|
||||||
cost: costs[index].purchase.toLocaleString(
|
cost: costs[index].purchase.toLocaleString(
|
||||||
interaction.locale
|
interaction.locale,
|
||||||
),
|
),
|
||||||
}
|
},
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -584,7 +584,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
<img
|
<img
|
||||||
alt="Silver icon"
|
alt="Silver icon"
|
||||||
src={await iconPng(
|
src={await iconPng(
|
||||||
asset("icons/currencies/silver.webp")
|
asset("icons/currencies/silver.webp"),
|
||||||
)}
|
)}
|
||||||
width={16}
|
width={16}
|
||||||
height={16}
|
height={16}
|
||||||
@@ -599,16 +599,16 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
strings.bot.commands.research.body.equipment,
|
strings.bot.commands.research.body.equipment,
|
||||||
{
|
{
|
||||||
cost: costs[index].equipment.toLocaleString(
|
cost: costs[index].equipment.toLocaleString(
|
||||||
interaction.locale
|
interaction.locale,
|
||||||
),
|
),
|
||||||
}
|
},
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})
|
}),
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</CommandWrapper>
|
</CommandWrapper>
|
||||||
|
|||||||
@@ -6,35 +6,25 @@ import { NoData } from "../components/NoData";
|
|||||||
import { TitleBar } from "../components/TitleBar";
|
import { TitleBar } from "../components/TitleBar";
|
||||||
import { filtersToDescription } from "../core/blitzkit/filtersToDescription";
|
import { filtersToDescription } from "../core/blitzkit/filtersToDescription";
|
||||||
import { filterStats, type StatFilters } from "../core/blitzstars/filterStats";
|
import { filterStats, type StatFilters } from "../core/blitzstars/filterStats";
|
||||||
import { getBlitzStarsLinkButton } from "../core/blitzstars/getBlitzStarsLinkButton";
|
|
||||||
import { getStatsInPeriod } from "../core/blitzstars/getStatsInPeriod";
|
import { getStatsInPeriod } from "../core/blitzstars/getStatsInPeriod";
|
||||||
import { addPeriodicFilterOptions } from "../core/discord/addPeriodicFilterOptions";
|
import { addPeriodicFilterOptions } from "../core/discord/addPeriodicFilterOptions";
|
||||||
import { addUsernameChoices } from "../core/discord/addUsernameChoices";
|
import { addUsernameChoices } from "../core/discord/addUsernameChoices";
|
||||||
import { autocompleteTanks } from "../core/discord/autocompleteTanks";
|
import { autocompleteTanks } from "../core/discord/autocompleteTanks";
|
||||||
import { autocompleteUsername } from "../core/discord/autocompleteUsername";
|
import { autocompleteUsername } from "../core/discord/autocompleteUsername";
|
||||||
import { buttonRefresh } from "../core/discord/buttonRefresh";
|
|
||||||
import { commandToURL } from "../core/discord/commandToURL";
|
|
||||||
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||||
import { getCustomPeriodParams } from "../core/discord/getCustomPeriodParams";
|
|
||||||
import { getFiltersFromButton } from "../core/discord/getFiltersFromButton";
|
import { getFiltersFromButton } from "../core/discord/getFiltersFromButton";
|
||||||
import { getFiltersFromCommand } from "../core/discord/getFiltersFromCommand";
|
|
||||||
import { resolvePeriodFromButton } from "../core/discord/resolvePeriodFromButton";
|
import { resolvePeriodFromButton } from "../core/discord/resolvePeriodFromButton";
|
||||||
import {
|
import { type ResolvedPeriod } from "../core/discord/resolvePeriodFromCommand";
|
||||||
type ResolvedPeriod,
|
|
||||||
resolvePeriodFromCommand,
|
|
||||||
} from "../core/discord/resolvePeriodFromCommand";
|
|
||||||
import { resolvePlayerFromButton } from "../core/discord/resolvePlayerFromButton";
|
import { resolvePlayerFromButton } from "../core/discord/resolvePlayerFromButton";
|
||||||
import {
|
import { type ResolvedPlayer } from "../core/discord/resolvePlayerFromCommand";
|
||||||
type ResolvedPlayer,
|
import { translator } from "../core/localization/translator";
|
||||||
resolvePlayerFromCommand,
|
|
||||||
} from "../core/discord/resolvePlayerFromCommand";
|
|
||||||
import type { CommandRegistry } from "../events/interactionCreate";
|
import type { CommandRegistry } from "../events/interactionCreate";
|
||||||
|
|
||||||
async function render(
|
async function render(
|
||||||
{ region, id }: ResolvedPlayer,
|
{ region, id }: ResolvedPlayer,
|
||||||
{ start, end, name }: ResolvedPeriod,
|
{ start, end, name }: ResolvedPeriod,
|
||||||
filters: StatFilters,
|
filters: StatFilters,
|
||||||
locale: Locale
|
locale: Locale,
|
||||||
) {
|
) {
|
||||||
const { nickname } = await getAccountInfo(region, id);
|
const { nickname } = await getAccountInfo(region, id);
|
||||||
const clan = (await getClanAccountInfo(region, id, ["clan"]))?.clan;
|
const clan = (await getClanAccountInfo(region, id, ["clan"]))?.clan;
|
||||||
@@ -44,7 +34,7 @@ async function render(
|
|||||||
id,
|
id,
|
||||||
start,
|
start,
|
||||||
end,
|
end,
|
||||||
locale
|
locale,
|
||||||
);
|
);
|
||||||
const { stats, supplementary } = await filterStats(diffedTankStats, filters);
|
const { stats, supplementary } = await filterStats(diffedTankStats, filters);
|
||||||
const filterDescriptions = await filtersToDescription(filters, locale);
|
const filterDescriptions = await filtersToDescription(filters, locale);
|
||||||
@@ -73,24 +63,27 @@ export const statsCommand = new Promise<CommandRegistry>(async (resolve) => {
|
|||||||
resolve({
|
resolve({
|
||||||
command: await addPeriodicFilterOptions(
|
command: await addPeriodicFilterOptions(
|
||||||
createLocalizedCommand("stats"),
|
createLocalizedCommand("stats"),
|
||||||
(option) => option.addStringOption(addUsernameChoices)
|
(option) => option.addStringOption(addUsernameChoices),
|
||||||
),
|
),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const player = await resolvePlayerFromCommand(interaction);
|
const { strings } = translator(interaction.locale);
|
||||||
const period = resolvePeriodFromCommand(player.region, interaction);
|
return strings.bot.commands.dead;
|
||||||
const filters = await getFiltersFromCommand(interaction);
|
|
||||||
const path = commandToURL(interaction, {
|
|
||||||
...player,
|
|
||||||
...getCustomPeriodParams(interaction),
|
|
||||||
...filters,
|
|
||||||
});
|
|
||||||
|
|
||||||
return Promise.all([
|
// const player = await resolvePlayerFromCommand(interaction);
|
||||||
render(player, period, filters, interaction.locale),
|
// const period = resolvePeriodFromCommand(player.region, interaction);
|
||||||
buttonRefresh(interaction, path),
|
// const filters = await getFiltersFromCommand(interaction);
|
||||||
getBlitzStarsLinkButton(player.region, player.id),
|
// const path = commandToURL(interaction, {
|
||||||
]);
|
// ...player,
|
||||||
|
// ...getCustomPeriodParams(interaction),
|
||||||
|
// ...filters,
|
||||||
|
// });
|
||||||
|
|
||||||
|
// return Promise.all([
|
||||||
|
// render(player, period, filters, interaction.locale),
|
||||||
|
// buttonRefresh(interaction, path),
|
||||||
|
// getBlitzStarsLinkButton(player.region, player.id),
|
||||||
|
// ]);
|
||||||
},
|
},
|
||||||
|
|
||||||
autocomplete: (interaction) => {
|
autocomplete: (interaction) => {
|
||||||
|
|||||||
@@ -1,50 +1,47 @@
|
|||||||
import { gameDefinitions } from '../core/blitzkit/nonBlockingPromises';
|
import { gameDefinitions } from "../core/blitzkit/nonBlockingPromises";
|
||||||
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
|
import { addFilterOptions } from "../core/discord/addFilterOptions";
|
||||||
import { addFilterOptions } from '../core/discord/addFilterOptions';
|
import { addUsernameChoices } from "../core/discord/addUsernameChoices";
|
||||||
import { addUsernameChoices } from '../core/discord/addUsernameChoices';
|
import { autocompleteTanks } from "../core/discord/autocompleteTanks";
|
||||||
import { autocompleteTanks } from '../core/discord/autocompleteTanks';
|
import { autocompleteUsername } from "../core/discord/autocompleteUsername";
|
||||||
import { autocompleteUsername } from '../core/discord/autocompleteUsername';
|
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||||
import { buttonRefresh } from '../core/discord/buttonRefresh';
|
import { getFiltersFromButton } from "../core/discord/getFiltersFromButton";
|
||||||
import { commandToURL } from '../core/discord/commandToURL';
|
import { resolvePeriodFromButton } from "../core/discord/resolvePeriodFromButton";
|
||||||
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
import { resolvePlayerFromButton } from "../core/discord/resolvePlayerFromButton";
|
||||||
import { getCustomPeriodParams } from '../core/discord/getCustomPeriodParams';
|
import { translator } from "../core/localization/translator";
|
||||||
import { getFiltersFromButton } from '../core/discord/getFiltersFromButton';
|
import { type CommandRegistry } from "../events/interactionCreate";
|
||||||
import { getFiltersFromCommand } from '../core/discord/getFiltersFromCommand';
|
import { renderBreakdown } from "./breakdown/render";
|
||||||
import { resolvePeriodFromButton } from '../core/discord/resolvePeriodFromButton';
|
|
||||||
import { resolvePeriodFromCommand } from '../core/discord/resolvePeriodFromCommand';
|
|
||||||
import { resolvePlayerFromButton } from '../core/discord/resolvePlayerFromButton';
|
|
||||||
import { resolvePlayerFromCommand } from '../core/discord/resolvePlayerFromCommand';
|
|
||||||
import { type CommandRegistry } from '../events/interactionCreate';
|
|
||||||
import { renderBreakdown } from './breakdown/render';
|
|
||||||
|
|
||||||
export const todayCommand = new Promise<CommandRegistry>(async (resolve) => {
|
export const todayCommand = new Promise<CommandRegistry>(async (resolve) => {
|
||||||
const awaitedGameDefinitions = await gameDefinitions;
|
const awaitedGameDefinitions = await gameDefinitions;
|
||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
command: addFilterOptions(
|
command: addFilterOptions(
|
||||||
createLocalizedCommand('today'),
|
createLocalizedCommand("today"),
|
||||||
awaitedGameDefinitions.nations,
|
awaitedGameDefinitions.nations,
|
||||||
).addStringOption(addUsernameChoices),
|
).addStringOption(addUsernameChoices),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const player = await resolvePlayerFromCommand(interaction);
|
const { strings } = translator(interaction.locale);
|
||||||
const period = resolvePeriodFromCommand(
|
return strings.bot.commands.dead;
|
||||||
player.region,
|
|
||||||
interaction,
|
|
||||||
'today',
|
|
||||||
);
|
|
||||||
const filters = await getFiltersFromCommand(interaction);
|
|
||||||
const path = commandToURL(interaction, {
|
|
||||||
...player,
|
|
||||||
...getCustomPeriodParams(interaction, true),
|
|
||||||
...filters,
|
|
||||||
});
|
|
||||||
|
|
||||||
return [
|
// const player = await resolvePlayerFromCommand(interaction);
|
||||||
...(await renderBreakdown(player, period, filters, interaction.locale)),
|
// const period = resolvePeriodFromCommand(
|
||||||
buttonRefresh(interaction, path),
|
// player.region,
|
||||||
await getBlitzStarsLinkButton(player.region, player.id),
|
// interaction,
|
||||||
];
|
// 'today',
|
||||||
|
// );
|
||||||
|
// const filters = await getFiltersFromCommand(interaction);
|
||||||
|
// const path = commandToURL(interaction, {
|
||||||
|
// ...player,
|
||||||
|
// ...getCustomPeriodParams(interaction, true),
|
||||||
|
// ...filters,
|
||||||
|
// });
|
||||||
|
|
||||||
|
// return [
|
||||||
|
// ...(await renderBreakdown(player, period, filters, interaction.locale)),
|
||||||
|
// buttonRefresh(interaction, path),
|
||||||
|
// await getBlitzStarsLinkButton(player.region, player.id),
|
||||||
|
// ];
|
||||||
},
|
},
|
||||||
|
|
||||||
autocomplete: (interaction) => {
|
autocomplete: (interaction) => {
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import {
|
|||||||
TankClass,
|
TankClass,
|
||||||
TankType,
|
TankType,
|
||||||
TREE_TYPE_ICONS,
|
TREE_TYPE_ICONS,
|
||||||
} from '@blitzkit/core';
|
} from "@blitzkit/core";
|
||||||
import { createColors } from 'bepaint';
|
import { createColors } from "bepaint";
|
||||||
import {
|
import {
|
||||||
type AccentColor,
|
type AccentColor,
|
||||||
type GrayColor,
|
type GrayColor,
|
||||||
PALETTES,
|
PALETTES,
|
||||||
} from '../../../core/radix/radixColors';
|
} from "../../../core/radix/radixColors";
|
||||||
import { RowStat } from './RowStat';
|
import { RowStat } from "./RowStat";
|
||||||
|
|
||||||
export interface RowStatItem {
|
export interface RowStatItem {
|
||||||
title: string;
|
title: string;
|
||||||
@@ -21,7 +21,7 @@ export interface RowStatItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface RowProps {
|
interface RowProps {
|
||||||
displayType?: 'tank' | 'summary';
|
displayType?: "tank" | "summary";
|
||||||
naked?: boolean;
|
naked?: boolean;
|
||||||
title: string;
|
title: string;
|
||||||
minimized?: boolean;
|
minimized?: boolean;
|
||||||
@@ -32,7 +32,7 @@ interface RowProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function Row({
|
export function Row({
|
||||||
color = 'slate',
|
color = "slate",
|
||||||
stats,
|
stats,
|
||||||
title,
|
title,
|
||||||
minimized,
|
minimized,
|
||||||
@@ -49,20 +49,20 @@ export function Row({
|
|||||||
className="session-tracker-row"
|
className="session-tracker-row"
|
||||||
style={{
|
style={{
|
||||||
maxWidth: naked ? 600 : Infinity,
|
maxWidth: naked ? 600 : Infinity,
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
flexDirection: 'column',
|
flexDirection: "column",
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
backgroundColor: naked
|
backgroundColor: naked
|
||||||
? `${theme.appBackground2}c0`
|
? `${theme.appBackground2}c0`
|
||||||
: theme.appBackground2,
|
: theme.appBackground2,
|
||||||
overflow: 'hidden',
|
overflow: "hidden",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
justifyContent: 'center',
|
justifyContent: "center",
|
||||||
padding: 8,
|
padding: 8,
|
||||||
gap: 4,
|
gap: 4,
|
||||||
backgroundColor: naked
|
backgroundColor: naked
|
||||||
@@ -70,10 +70,14 @@ export function Row({
|
|||||||
: theme.componentInteractive,
|
: theme.componentInteractive,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{displayType === 'tank' && tankClass !== undefined && (
|
{displayType === "tank" && tankClass !== undefined && (
|
||||||
<img
|
<img
|
||||||
alt={TankClass[tankClass]}
|
alt={TankClass[tankClass]}
|
||||||
src={TREE_TYPE_ICONS[type ?? TankType.RESEARCHABLE][tankClass]}
|
src={
|
||||||
|
TREE_TYPE_ICONS[type ?? TankType.TANK_TYPE_RESEARCHABLE][
|
||||||
|
tankClass
|
||||||
|
]
|
||||||
|
}
|
||||||
style={{ width: 16, height: 16 }}
|
style={{ width: 16, height: 16 }}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -81,10 +85,10 @@ export function Row({
|
|||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
color:
|
color:
|
||||||
displayType === 'tank'
|
displayType === "tank"
|
||||||
? type === TankType.COLLECTOR
|
? type === TankType.TANK_TYPE_COLLECTOR
|
||||||
? theme.textLowContrast_blue
|
? theme.textLowContrast_blue
|
||||||
: type === TankType.PREMIUM
|
: type === TankType.TANK_TYPE_PREMIUM
|
||||||
? theme.textLowContrast_amber
|
? theme.textLowContrast_amber
|
||||||
: theme.textHighContrast
|
: theme.textHighContrast
|
||||||
: theme.textLowContrast,
|
: theme.textLowContrast,
|
||||||
@@ -98,7 +102,7 @@ export function Row({
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
paddingTop: 8,
|
paddingTop: 8,
|
||||||
paddingBottom: 8,
|
paddingBottom: 8,
|
||||||
}}
|
}}
|
||||||
@@ -109,8 +113,8 @@ export function Row({
|
|||||||
<RowStat
|
<RowStat
|
||||||
minimized={minimized}
|
minimized={minimized}
|
||||||
key={index}
|
key={index}
|
||||||
name={`${row.title} • ${row.career ?? '--'}`}
|
name={`${row.title} • ${row.career ?? "--"}`}
|
||||||
value={row.current ?? '--'}
|
value={row.current ?? "--"}
|
||||||
delta={row.delta}
|
delta={row.delta}
|
||||||
percentile={row.percentile}
|
percentile={row.percentile}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { TankClass, TankType, TREE_TYPE_ICONS } from '@blitzkit/core';
|
import { TankClass, TankType, TREE_TYPE_ICONS } from "@blitzkit/core";
|
||||||
import { theme } from '../../../../stitches.config';
|
import { theme } from "../../../../stitches.config";
|
||||||
|
|
||||||
export interface ItemProps {
|
export interface ItemProps {
|
||||||
tankClass?: TankClass;
|
tankClass?: TankClass;
|
||||||
@@ -8,9 +8,9 @@ export interface ItemProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const TREE_TYPE_COLOR = {
|
const TREE_TYPE_COLOR = {
|
||||||
[TankType.RESEARCHABLE]: '',
|
[TankType.TANK_TYPE_RESEARCHABLE]: "",
|
||||||
[TankType.PREMIUM]: '_amber',
|
[TankType.TANK_TYPE_PREMIUM]: "_amber",
|
||||||
[TankType.COLLECTOR]: '_blue',
|
[TankType.TANK_TYPE_COLLECTOR]: "_blue",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export function Item({
|
export function Item({
|
||||||
@@ -21,12 +21,12 @@ export function Item({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
height: 32,
|
height: 32,
|
||||||
paddingLeft: 8,
|
paddingLeft: 8,
|
||||||
paddingRight: 8,
|
paddingRight: 8,
|
||||||
overflow: 'hidden',
|
overflow: "hidden",
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
theme.colors[`componentInteractive${TREE_TYPE_COLOR[treeType]}`],
|
theme.colors[`componentInteractive${TREE_TYPE_COLOR[treeType]}`],
|
||||||
@@ -34,12 +34,12 @@ export function Item({
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
gap: 4,
|
gap: 4,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
justifyContent: 'flex-start',
|
justifyContent: "flex-start",
|
||||||
overflow: 'hidden',
|
overflow: "hidden",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{tankType && (
|
{tankType && (
|
||||||
@@ -52,7 +52,7 @@ export function Item({
|
|||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: "nowrap",
|
||||||
color: theme.colors[`textLowContrast${TREE_TYPE_COLOR[treeType]}`],
|
color: theme.colors[`textLowContrast${TREE_TYPE_COLOR[treeType]}`],
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -6,21 +6,21 @@ import { translator } from "../localization/translator";
|
|||||||
|
|
||||||
export async function filtersToDescription(
|
export async function filtersToDescription(
|
||||||
{ nation, tier, type, class: tankClass, tank }: StatFilters,
|
{ nation, tier, type, class: tankClass, tank }: StatFilters,
|
||||||
locale: Locale
|
locale: Locale,
|
||||||
) {
|
) {
|
||||||
const { strings, bkLocale } = translator(locale);
|
const { strings, bkLocale } = translator(locale);
|
||||||
const awaitedTankDefinitions = await fetchTankDefinitions();
|
const awaitedTankDefinitions = await fetchTankDefinitions();
|
||||||
const info: string[] = [];
|
const info: string[] = [];
|
||||||
|
|
||||||
// TODO: somehow localize tank names?
|
// TODO: somehow localize tank names?
|
||||||
if (tank) return awaitedTankDefinitions.tanks[tank].name.locales[bkLocale];
|
if (tank) return awaitedTankDefinitions.tanks[tank].name!.locales[bkLocale];
|
||||||
if (nation)
|
if (nation)
|
||||||
info.push((strings.common.nations as Record<string, string>)[nation]);
|
info.push((strings.common.nations as Record<string, string>)[nation]);
|
||||||
if (tier) {
|
if (tier) {
|
||||||
info.push(
|
info.push(
|
||||||
literals(strings.bot.common.filters.tier, {
|
literals(strings.bot.common.filters.tier, {
|
||||||
tier: TIER_ROMAN_NUMERALS[tier],
|
tier: TIER_ROMAN_NUMERALS[tier],
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (tankClass) info.push(strings.common.tank_class_short[tankClass]);
|
if (tankClass) info.push(strings.common.tank_class_short[tankClass]);
|
||||||
|
|||||||
@@ -34,12 +34,12 @@ export async function filterStats(
|
|||||||
(filters.tier === undefined || entry.tier === filters.tier) &&
|
(filters.tier === undefined || entry.tier === filters.tier) &&
|
||||||
(filters.class === undefined || entry.class === filters.class) &&
|
(filters.class === undefined || entry.class === filters.class) &&
|
||||||
(filters.type === undefined ||
|
(filters.type === undefined ||
|
||||||
(filters.type === TankType.COLLECTOR &&
|
(filters.type === TankType.TANK_TYPE_COLLECTOR &&
|
||||||
entry.type === TankType.COLLECTOR) ||
|
entry.type === TankType.TANK_TYPE_COLLECTOR) ||
|
||||||
(filters.type === TankType.PREMIUM &&
|
(filters.type === TankType.TANK_TYPE_PREMIUM &&
|
||||||
entry.type === TankType.PREMIUM) ||
|
entry.type === TankType.TANK_TYPE_PREMIUM) ||
|
||||||
(filters.type === TankType.RESEARCHABLE &&
|
(filters.type === TankType.TANK_TYPE_RESEARCHABLE &&
|
||||||
entry.type === TankType.RESEARCHABLE)) &&
|
entry.type === TankType.TANK_TYPE_RESEARCHABLE)) &&
|
||||||
(filters.tank === undefined || entry.id === filters.tank)
|
(filters.tank === undefined || entry.id === filters.tank)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { Locale, SlashCommandStringOption } from 'discord.js';
|
import { Locale, SlashCommandStringOption } from "discord.js";
|
||||||
import { translator } from '../localization/translator';
|
import { translator } from "../localization/translator";
|
||||||
import { localizationObject } from './localizationObject';
|
import { localizationObject } from "./localizationObject";
|
||||||
|
|
||||||
export function addTankChoices(option: SlashCommandStringOption) {
|
export function addTankChoices(option: SlashCommandStringOption) {
|
||||||
const { strings } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
return option
|
return option
|
||||||
.setName(strings.bot.common.options.tank.name)
|
.setName(strings.bot.common.options.tank.name!)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
(strings) => strings.bot.common.options.tank.name,
|
(strings) => strings.bot.common.options.tank.name,
|
||||||
|
|||||||
@@ -13,13 +13,13 @@ import {
|
|||||||
} from "./autocompleteClan/constants";
|
} from "./autocompleteClan/constants";
|
||||||
|
|
||||||
export const tankNamesTechTreeOnly = fetchTankNames().then((names) =>
|
export const tankNamesTechTreeOnly = fetchTankNames().then((names) =>
|
||||||
names.filter((tank) => tank.treeType === TankType.RESEARCHABLE)
|
names.filter((tank) => tank.treeType === TankType.TANK_TYPE_RESEARCHABLE),
|
||||||
);
|
);
|
||||||
|
|
||||||
export async function autocompleteTanks(
|
export async function autocompleteTanks(
|
||||||
interaction: AutocompleteInteraction<CacheType>,
|
interaction: AutocompleteInteraction<CacheType>,
|
||||||
techTreeOnly = false,
|
techTreeOnly = false,
|
||||||
fields = ["tank"]
|
fields = ["tank"],
|
||||||
) {
|
) {
|
||||||
const { unwrap } = translator(interaction.locale);
|
const { unwrap } = translator(interaction.locale);
|
||||||
const focusedOption = interaction.options.getFocused(true);
|
const focusedOption = interaction.options.getFocused(true);
|
||||||
@@ -31,7 +31,7 @@ export async function autocompleteTanks(
|
|||||||
go(
|
go(
|
||||||
focusedOption.value,
|
focusedOption.value,
|
||||||
await (techTreeOnly ? tankNamesTechTreeOnly : tankNames),
|
await (techTreeOnly ? tankNamesTechTreeOnly : tankNames),
|
||||||
{ keys: SEARCH_KEYS, limit: 10 }
|
{ keys: SEARCH_KEYS, limit: 10 },
|
||||||
).map(async (item) => {
|
).map(async (item) => {
|
||||||
let name = unwrap(item.obj.searchableName);
|
let name = unwrap(item.obj.searchableName);
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ export async function autocompleteTanks(
|
|||||||
0,
|
0,
|
||||||
unwrap(item.obj.searchableName).length -
|
unwrap(item.obj.searchableName).length -
|
||||||
overSize -
|
overSize -
|
||||||
OVERFLOW_SUFFIX.length
|
OVERFLOW_SUFFIX.length,
|
||||||
)}${OVERFLOW_SUFFIX}`;
|
)}${OVERFLOW_SUFFIX}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,8 +50,8 @@ export async function autocompleteTanks(
|
|||||||
name,
|
name,
|
||||||
value: `${item.obj.id}`,
|
value: `${item.obj.id}`,
|
||||||
} satisfies ApplicationCommandOptionChoiceData<string>;
|
} satisfies ApplicationCommandOptionChoiceData<string>;
|
||||||
})
|
}),
|
||||||
)
|
)
|
||||||
: []
|
: [],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -5,13 +5,13 @@ import {
|
|||||||
tankDefinitions,
|
tankDefinitions,
|
||||||
} from "./core/blitzkit/nonBlockingPromises";
|
} from "./core/blitzkit/nonBlockingPromises";
|
||||||
|
|
||||||
|
let manager: ShardingManager;
|
||||||
let iteration = 0;
|
let iteration = 0;
|
||||||
const interval = setInterval(async () => {
|
const interval = setInterval(async () => {
|
||||||
iteration++;
|
console.log(`Attempting launch on iteration ${++iteration}`);
|
||||||
|
|
||||||
console.log(`Attempting launch on iteration ${iteration}`);
|
manager?.respawnAll();
|
||||||
|
manager = new ShardingManager("dist/bot/workers/bot.js", {
|
||||||
const manager = new ShardingManager("dist/bot/workers/bot.js", {
|
|
||||||
token: assertSecret(import.meta.env.DISCORD_TOKEN),
|
token: assertSecret(import.meta.env.DISCORD_TOKEN),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ const interval = setInterval(async () => {
|
|||||||
console.log(`🟡 Launching shard ${shard.id}`);
|
console.log(`🟡 Launching shard ${shard.id}`);
|
||||||
shard.on("ready", () => console.log(`🟢 Launched shard ${shard.id}`));
|
shard.on("ready", () => console.log(`🟢 Launched shard ${shard.id}`));
|
||||||
})
|
})
|
||||||
.spawn();
|
.spawn({ timeout: 60000 });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let servers = 0;
|
let servers = 0;
|
||||||
@@ -78,4 +78,4 @@ const interval = setInterval(async () => {
|
|||||||
error,
|
error,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, 5000);
|
}, 15000);
|
||||||
+1
-1
Submodule packages/closed updated: 5b4a85d503...c2175a1520.
@@ -1,5 +1,7 @@
|
|||||||
import { ShellDefinition, ShellType } from "../protos";
|
import { ShellDefinition, ShellType } from "../protos";
|
||||||
|
|
||||||
export function canSplash(type: ShellDefinition["type"]): type is ShellType.HE {
|
export function canSplash(
|
||||||
return type === ShellType.HE;
|
type: ShellDefinition["type"],
|
||||||
|
): type is ShellType.SHELL_TYPE_HE {
|
||||||
|
return type === ShellType.SHELL_TYPE_HE;
|
||||||
}
|
}
|
||||||
@@ -2,22 +2,22 @@ import { TankClass, TankType } from "../protos";
|
|||||||
import type { BlitzStats } from "../statistics";
|
import type { BlitzStats } from "../statistics";
|
||||||
|
|
||||||
export const TANK_TYPES = [
|
export const TANK_TYPES = [
|
||||||
TankType.RESEARCHABLE,
|
TankType.TANK_TYPE_RESEARCHABLE,
|
||||||
TankType.PREMIUM,
|
TankType.TANK_TYPE_PREMIUM,
|
||||||
TankType.COLLECTOR,
|
TankType.TANK_TYPE_COLLECTOR,
|
||||||
];
|
];
|
||||||
|
|
||||||
export const TANK_TYPE_COMMAND_NAMES = {
|
export const TANK_TYPE_COMMAND_NAMES = {
|
||||||
[TankType.RESEARCHABLE]: "researchable",
|
[TankType.TANK_TYPE_RESEARCHABLE]: "researchable",
|
||||||
[TankType.PREMIUM]: "premium",
|
[TankType.TANK_TYPE_PREMIUM]: "premium",
|
||||||
[TankType.COLLECTOR]: "collector",
|
[TankType.TANK_TYPE_COLLECTOR]: "collector",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const TANK_CLASSES = [
|
export const TANK_CLASSES = [
|
||||||
TankClass.LIGHT,
|
TankClass.TANK_CLASS_LIGHT,
|
||||||
TankClass.MEDIUM,
|
TankClass.TANK_CLASS_MEDIUM,
|
||||||
TankClass.HEAVY,
|
TankClass.TANK_CLASS_HEAVY,
|
||||||
TankClass.TANK_DESTROYER,
|
TankClass.TANK_CLASS_TANK_DESTROYER,
|
||||||
];
|
];
|
||||||
|
|
||||||
export const emptyAllStats: BlitzStats = {
|
export const emptyAllStats: BlitzStats = {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
export function checkConsumableProvisionInclusivity(
|
export function checkConsumableProvisionInclusivity(
|
||||||
consumableProvision: Consumable | Provision,
|
consumableProvision: Consumable | Provision,
|
||||||
tank: TankDefinition,
|
tank: TankDefinition,
|
||||||
gun: GunDefinition
|
gun: GunDefinition,
|
||||||
) {
|
) {
|
||||||
const included = consumableProvision.include?.every((rule) => {
|
const included = consumableProvision.include?.every((rule) => {
|
||||||
switch (rule.filter_type!.$case) {
|
switch (rule.filter_type!.$case) {
|
||||||
@@ -46,7 +46,7 @@ export function checkConsumableProvisionInclusivity(
|
|||||||
case "categories":
|
case "categories":
|
||||||
return rule.filter_type!.value.categories.some((category) => {
|
return rule.filter_type!.value.categories.some((category) => {
|
||||||
switch (category) {
|
switch (category) {
|
||||||
case ConsumableTankCategoryFilterCategory.CLIP:
|
case ConsumableTankCategoryFilterCategory.CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP:
|
||||||
return gun.gun_type!.$case !== "regular";
|
return gun.gun_type!.$case !== "regular";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,49 +1,50 @@
|
|||||||
export * from './assertSecret';
|
export * from "./assertSecret";
|
||||||
export * from './asset';
|
export * from "./asset";
|
||||||
export * from './availableProvisions';
|
export * from "./availableProvisions";
|
||||||
export * from './averageDefinitions';
|
export * from "./averageDefinitions";
|
||||||
// export * from './camouflageDefinitions';
|
// export * from './camouflageDefinitions';
|
||||||
// export * from './checkConsumableProvisionInclusivity';
|
// export * from './checkConsumableProvisionInclusivity';
|
||||||
export * from './coefficient';
|
export * from "./coefficient";
|
||||||
export * from './consumableDefinitions';
|
export * from "./consumableDefinitions";
|
||||||
// export * from './context';
|
// export * from './context';
|
||||||
export * from './createDefaultSkills';
|
export * from "./createDefaultSkills";
|
||||||
export * from './degressiveStat';
|
export * from "./degressiveStat";
|
||||||
export * from './discoveredIdDefinitions';
|
export * from "./discoveredIdDefinitions";
|
||||||
export * from './emblemURL';
|
export * from "./emblemURL";
|
||||||
export * from './equipmentDefinitions';
|
export * from "./equipmentDefinitions";
|
||||||
export * from './eventManager';
|
export * from "./eventManager";
|
||||||
export * from './gameDefinitions';
|
export * from "./gameDefinitions";
|
||||||
export * from './getArchivedLatestSeasonNumber';
|
export * from "./getArchivedLatestSeasonNumber";
|
||||||
// export * from './getArchivedRatingInfo';
|
// export * from './getArchivedRatingInfo';
|
||||||
export * from './getArchivedRatingLeaderboard';
|
export * from "./getArchivedRatingLeaderboard";
|
||||||
// export * from './getArchivedRatingMidnightLeaderboard';
|
// export * from './getArchivedRatingMidnightLeaderboard';
|
||||||
export * from './getTimeDaysAgo';
|
export * from "./getTimeDaysAgo";
|
||||||
export * from './isExplosive';
|
export * from "./isExplosive";
|
||||||
export * from './mapDefinitions';
|
export * from "./mapDefinitions";
|
||||||
export * from './modelDefinitions';
|
export * from "./modelDefinitions";
|
||||||
export * from './normalizeBoundingBox';
|
export * from "./normalizeBoundingBox";
|
||||||
// export * from './parseBkni';
|
// export * from './parseBkni';
|
||||||
// export * from './patientFetch';
|
// export * from './patientFetch';
|
||||||
export * from './patientFetchJSON';
|
export * from "./patientFetchJSON";
|
||||||
export * from './progressiveStat';
|
export * from "./progressiveStat";
|
||||||
export * from './provisionDefinitions';
|
export * from "./provisionDefinitions";
|
||||||
export * from './resolveDpm';
|
export * from "./resolveDpm";
|
||||||
export * from './resolvePenetrationCoefficient';
|
export * from "./resolvePenetrationCoefficient";
|
||||||
export * from './reviews';
|
export * from "./reviews";
|
||||||
export * from './skillDefinitions';
|
export * from "./skillDefinitions";
|
||||||
export * from './sum';
|
export * from "./sum";
|
||||||
export * from './tankDefinitions';
|
export * from "./tankDefinitions";
|
||||||
export * from './tankIcon';
|
export * from "./tankIcon";
|
||||||
export * from './tankNames';
|
export * from "./tankNames";
|
||||||
export * from './unionBoundingBox';
|
export * from "./unionBoundingBox";
|
||||||
export * from './uniqueGuns';
|
export * from "./uniqueGuns";
|
||||||
export * from './unwrapBlitzkitResponse';
|
export * from "./unwrapBlitzkitResponse";
|
||||||
export * from './votes';
|
export * from "./votes";
|
||||||
// export * from './withCORSProxy';
|
// export * from './withCORSProxy';
|
||||||
export * from './createDefaultProvisions';
|
export * from "./createDefaultProvisions";
|
||||||
export * from './gallery';
|
export * from "./gallery";
|
||||||
export * from './metaSortTank';
|
export * from "./metaSortTank";
|
||||||
export * from './popularTanks';
|
export * from "./popularTanks";
|
||||||
export * from './romanize';
|
export * from "./romanize";
|
||||||
export * from './youtubers';
|
export * from "./sluggify.ts";
|
||||||
|
export * from "./youtubers";
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ShellDefinition, ShellType } from "../protos";
|
import { ShellDefinition, ShellType } from "../protos";
|
||||||
|
|
||||||
export function isExplosive(
|
export function isExplosive(
|
||||||
type: ShellDefinition["type"]
|
type: ShellDefinition["type"],
|
||||||
): type is ShellType.HEAT | ShellType.HE {
|
): type is ShellType.SHELL_TYPE_HEAT | ShellType.SHELL_TYPE_HE {
|
||||||
return type === ShellType.HEAT || type === ShellType.HE;
|
return type === ShellType.SHELL_TYPE_HEAT || type === ShellType.SHELL_TYPE_HE;
|
||||||
}
|
}
|
||||||
@@ -2,27 +2,27 @@ import { TANK_CLASSES } from "../blitz/constants";
|
|||||||
import { GameDefinitions, TankDefinition, TankType } from "../protos";
|
import { GameDefinitions, TankDefinition, TankType } from "../protos";
|
||||||
|
|
||||||
const treeTypeOrder = [
|
const treeTypeOrder = [
|
||||||
TankType.RESEARCHABLE,
|
TankType.TANK_TYPE_RESEARCHABLE,
|
||||||
TankType.PREMIUM,
|
TankType.TANK_TYPE_PREMIUM,
|
||||||
TankType.COLLECTOR,
|
TankType.TANK_TYPE_COLLECTOR,
|
||||||
];
|
];
|
||||||
|
|
||||||
export function metaSortTank(
|
export function metaSortTank(
|
||||||
tanks: TankDefinition[],
|
tanks: TankDefinition[],
|
||||||
gameDefinitions: GameDefinitions
|
gameDefinitions: GameDefinitions,
|
||||||
) {
|
) {
|
||||||
return tanks
|
return tanks
|
||||||
.sort((a, b) => b.tier - a.tier)
|
.sort((a, b) => b.tier - a.tier)
|
||||||
.sort(
|
.sort(
|
||||||
(a, b) => treeTypeOrder.indexOf(b.type) - treeTypeOrder.indexOf(a.type)
|
(a, b) => treeTypeOrder.indexOf(b.type) - treeTypeOrder.indexOf(a.type),
|
||||||
)
|
)
|
||||||
.sort(
|
.sort(
|
||||||
(a, b) => TANK_CLASSES.indexOf(b.class) - TANK_CLASSES.indexOf(a.class)
|
(a, b) => TANK_CLASSES.indexOf(b.class) - TANK_CLASSES.indexOf(a.class),
|
||||||
)
|
)
|
||||||
.sort(
|
.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
gameDefinitions.nations.indexOf(b.nation) -
|
gameDefinitions.nations.indexOf(b.nation) -
|
||||||
gameDefinitions.nations.indexOf(a.nation)
|
gameDefinitions.nations.indexOf(a.nation),
|
||||||
)
|
)
|
||||||
.sort((a, b) => a.tier - b.tier);
|
.sort((a, b) => a.tier - b.tier);
|
||||||
}
|
}
|
||||||
@@ -2,8 +2,8 @@ import { BoundingBox, Vector3 } from "../protos";
|
|||||||
|
|
||||||
export function normalizeBoundingBox(boundingBox: BoundingBox) {
|
export function normalizeBoundingBox(boundingBox: BoundingBox) {
|
||||||
return {
|
return {
|
||||||
x: boundingBox.max.x - boundingBox.min.x,
|
x: boundingBox.max!.x - boundingBox.min!.x,
|
||||||
y: boundingBox.max.y - boundingBox.min.y,
|
y: boundingBox.max!.y - boundingBox.min!.y,
|
||||||
z: boundingBox.max.z - boundingBox.min.z,
|
z: boundingBox.max!.z - boundingBox.min!.z,
|
||||||
} satisfies Vector3;
|
} satisfies Vector3;
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,21 @@
|
|||||||
import { ShellType } from '../protos';
|
import { Equalizer, ShellType } from "../protos";
|
||||||
|
|
||||||
export function resolvePenetrationCoefficient(
|
export function resolvePenetrationCoefficient(
|
||||||
calibratedShells: boolean,
|
calibratedShells: boolean,
|
||||||
|
equalize: boolean,
|
||||||
type: ShellType,
|
type: ShellType,
|
||||||
|
equalizerObj?: Equalizer,
|
||||||
) {
|
) {
|
||||||
if (!calibratedShells) return 1;
|
const calibrated = calibratedShells
|
||||||
|
? type === ShellType.SHELL_TYPE_AP
|
||||||
|
? 1.08
|
||||||
|
: type === ShellType.SHELL_TYPE_APCR
|
||||||
|
? 1.05
|
||||||
|
: type === ShellType.SHELL_TYPE_HEAT
|
||||||
|
? 1.13
|
||||||
|
: 1.08
|
||||||
|
: 1;
|
||||||
|
const equalizer = (equalize ? equalizerObj?.penetration : undefined) ?? 1;
|
||||||
|
|
||||||
return type === ShellType.AP
|
return calibrated * equalizer;
|
||||||
? 1.08
|
|
||||||
: type === ShellType.APCR
|
|
||||||
? 1.05
|
|
||||||
: type === ShellType.HEAT
|
|
||||||
? 1.13
|
|
||||||
: 1.08;
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { deburr } from "lodash-es";
|
||||||
|
|
||||||
|
const nonAlphanumericRegex = /[^a-z0-9]/g;
|
||||||
|
const multipleDashesRegex = /--+/g;
|
||||||
|
const trailingDashRegex = /-$/g;
|
||||||
|
const leadingDashRegex = /^-/g;
|
||||||
|
|
||||||
|
export function sluggify(value: string) {
|
||||||
|
let slug = deburr(value).toLowerCase();
|
||||||
|
slug = slug.replaceAll(nonAlphanumericRegex, "-");
|
||||||
|
slug = slug.replaceAll(multipleDashesRegex, "-");
|
||||||
|
slug = slug.replaceAll(trailingDashRegex, "");
|
||||||
|
slug = slug.replaceAll(leadingDashRegex, "");
|
||||||
|
|
||||||
|
return slug;
|
||||||
|
}
|
||||||
@@ -1,74 +1,74 @@
|
|||||||
import { times } from 'lodash-es';
|
import { times } from "lodash-es";
|
||||||
import { CrewType, ShellType, TankClass, TankType } from '../../protos';
|
import { CrewType, ShellType, TankClass, TankType } from "../../protos";
|
||||||
|
|
||||||
export const SHELL_NAMES: Record<ShellType, string> = {
|
export const SHELL_NAMES: Record<ShellType, string> = {
|
||||||
[ShellType.AP]: 'AP',
|
[ShellType.SHELL_TYPE_AP]: "AP",
|
||||||
[ShellType.APCR]: 'APCR',
|
[ShellType.SHELL_TYPE_APCR]: "APCR",
|
||||||
[ShellType.HEAT]: 'HEAT',
|
[ShellType.SHELL_TYPE_HEAT]: "HEAT",
|
||||||
[ShellType.HE]: 'HE',
|
[ShellType.SHELL_TYPE_HE]: "HE",
|
||||||
};
|
};
|
||||||
export const CREW_MEMBER_NAMES = {
|
export const CREW_MEMBER_NAMES = {
|
||||||
[CrewType.COMMANDER]: 'commander',
|
[CrewType.CREW_TYPE_COMMANDER]: "commander",
|
||||||
[CrewType.DRIVER]: 'driver',
|
[CrewType.CREW_TYPE_DRIVER]: "driver",
|
||||||
[CrewType.GUNNER]: 'gunner',
|
[CrewType.CREW_TYPE_GUNNER]: "gunner",
|
||||||
[CrewType.LOADER]: 'loader',
|
[CrewType.CREW_TYPE_LOADER]: "loader",
|
||||||
[CrewType.RADIOMAN]: 'radioman',
|
[CrewType.CREW_TYPE_RADIOMAN]: "radioman",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated use svg
|
* @deprecated use svg
|
||||||
*/
|
*/
|
||||||
export const TANK_ICONS: Record<TankClass, string> = {
|
export const TANK_ICONS: Record<TankClass, string> = {
|
||||||
[TankClass.TANK_DESTROYER]: 'https://i.imgur.com/BIHSEH0.png',
|
[TankClass.TANK_CLASS_TANK_DESTROYER]: "https://i.imgur.com/BIHSEH0.png",
|
||||||
[TankClass.LIGHT]: 'https://i.imgur.com/CSNha5V.png',
|
[TankClass.TANK_CLASS_LIGHT]: "https://i.imgur.com/CSNha5V.png",
|
||||||
[TankClass.MEDIUM]: 'https://i.imgur.com/wvf3ltm.png',
|
[TankClass.TANK_CLASS_MEDIUM]: "https://i.imgur.com/wvf3ltm.png",
|
||||||
[TankClass.HEAVY]: 'https://i.imgur.com/ECeqlZa.png',
|
[TankClass.TANK_CLASS_HEAVY]: "https://i.imgur.com/ECeqlZa.png",
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* @deprecated use svg
|
* @deprecated use svg
|
||||||
*/
|
*/
|
||||||
export const TANK_ICONS_PREMIUM: Record<TankClass, string> = {
|
export const TANK_ICONS_PREMIUM: Record<TankClass, string> = {
|
||||||
[TankClass.TANK_DESTROYER]: 'https://i.imgur.com/TCu3EdR.png',
|
[TankClass.TANK_CLASS_TANK_DESTROYER]: "https://i.imgur.com/TCu3EdR.png",
|
||||||
[TankClass.LIGHT]: 'https://i.imgur.com/zdkpTRb.png',
|
[TankClass.TANK_CLASS_LIGHT]: "https://i.imgur.com/zdkpTRb.png",
|
||||||
[TankClass.MEDIUM]: 'https://i.imgur.com/3z7eHX6.png',
|
[TankClass.TANK_CLASS_MEDIUM]: "https://i.imgur.com/3z7eHX6.png",
|
||||||
[TankClass.HEAVY]: 'https://i.imgur.com/P3vbmyA.png',
|
[TankClass.TANK_CLASS_HEAVY]: "https://i.imgur.com/P3vbmyA.png",
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* @deprecated use svg
|
* @deprecated use svg
|
||||||
*/
|
*/
|
||||||
export const TANK_ICONS_COLLECTOR: Record<TankClass, string> = {
|
export const TANK_ICONS_COLLECTOR: Record<TankClass, string> = {
|
||||||
[TankClass.TANK_DESTROYER]: 'https://i.imgur.com/WTjeirB.png',
|
[TankClass.TANK_CLASS_TANK_DESTROYER]: "https://i.imgur.com/WTjeirB.png",
|
||||||
[TankClass.LIGHT]: 'https://i.imgur.com/EwhtKkU.png',
|
[TankClass.TANK_CLASS_LIGHT]: "https://i.imgur.com/EwhtKkU.png",
|
||||||
[TankClass.MEDIUM]: 'https://i.imgur.com/u8YDMBh.png',
|
[TankClass.TANK_CLASS_MEDIUM]: "https://i.imgur.com/u8YDMBh.png",
|
||||||
[TankClass.HEAVY]: 'https://i.imgur.com/8xRf3nc.png',
|
[TankClass.TANK_CLASS_HEAVY]: "https://i.imgur.com/8xRf3nc.png",
|
||||||
};
|
};
|
||||||
export const TIERS = times(10, (index) => index + 1);
|
export const TIERS = times(10, (index) => index + 1);
|
||||||
export const TIER_ROMAN_NUMERALS: Record<number, string> = {
|
export const TIER_ROMAN_NUMERALS: Record<number, string> = {
|
||||||
1: 'I',
|
1: "I",
|
||||||
2: 'II',
|
2: "II",
|
||||||
3: 'III',
|
3: "III",
|
||||||
4: 'IV',
|
4: "IV",
|
||||||
5: 'V',
|
5: "V",
|
||||||
6: 'VI',
|
6: "VI",
|
||||||
7: 'VII',
|
7: "VII",
|
||||||
8: 'VIII',
|
8: "VIII",
|
||||||
9: 'IX',
|
9: "IX",
|
||||||
10: 'X',
|
10: "X",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const flags: Record<string, string> = {
|
export const flags: Record<string, string> = {
|
||||||
ussr: '<:ussr:1218421042033197197>',
|
ussr: "<:ussr:1218421042033197197>",
|
||||||
germany: '🇩🇪',
|
germany: "🇩🇪",
|
||||||
usa: '🇺🇸',
|
usa: "🇺🇸",
|
||||||
china: '🇨🇳',
|
china: "🇨🇳",
|
||||||
uk: '🇬🇧',
|
uk: "🇬🇧",
|
||||||
france: '🇫🇷',
|
france: "🇫🇷",
|
||||||
japan: '🇯🇵',
|
japan: "🇯🇵",
|
||||||
european: '🇪🇺',
|
european: "🇪🇺",
|
||||||
other: '<:other:1218421572243558482>',
|
other: "<:other:1218421572243558482>",
|
||||||
};
|
};
|
||||||
export const TREE_TYPE_ICONS: Record<TankType, Record<TankClass, string>> = {
|
export const TREE_TYPE_ICONS: Record<TankType, Record<TankClass, string>> = {
|
||||||
[TankType.RESEARCHABLE]: TANK_ICONS,
|
[TankType.TANK_TYPE_RESEARCHABLE]: TANK_ICONS,
|
||||||
[TankType.PREMIUM]: TANK_ICONS_PREMIUM,
|
[TankType.TANK_TYPE_PREMIUM]: TANK_ICONS_PREMIUM,
|
||||||
[TankType.COLLECTOR]: TANK_ICONS_COLLECTOR,
|
[TankType.TANK_TYPE_COLLECTOR]: TANK_ICONS_COLLECTOR,
|
||||||
};
|
};
|
||||||
@@ -15,7 +15,7 @@ export async function fetchTankNames() {
|
|||||||
tankDefinitionsArray.map(async (tank) => {
|
tankDefinitionsArray.map(async (tank) => {
|
||||||
const searchableNameDeburr: I18nString = { locales: {} };
|
const searchableNameDeburr: I18nString = { locales: {} };
|
||||||
|
|
||||||
Object.entries(tank.name).forEach(([key, value]) => {
|
Object.entries(tank.name!).forEach(([key, value]) => {
|
||||||
searchableNameDeburr.locales[key] = deburr(value);
|
searchableNameDeburr.locales[key] = deburr(value);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -28,8 +28,8 @@ export async function fetchTankNames() {
|
|||||||
?.map((id) =>
|
?.map((id) =>
|
||||||
locales.supported.map(
|
locales.supported.map(
|
||||||
({ locale }) =>
|
({ locale }) =>
|
||||||
camouflageDefinitions.camouflages[id]?.name.locales[locale]
|
camouflageDefinitions.camouflages[id]?.name!.locales[locale],
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
.flat()
|
.flat()
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
@@ -37,7 +37,7 @@ export async function fetchTankNames() {
|
|||||||
.join(" "),
|
.join(" "),
|
||||||
treeType: tank.type,
|
treeType: tank.type,
|
||||||
};
|
};
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import { BoundingBox } from "../protos";
|
|||||||
export function unionBoundingBox(a: BoundingBox, b: BoundingBox) {
|
export function unionBoundingBox(a: BoundingBox, b: BoundingBox) {
|
||||||
return {
|
return {
|
||||||
min: {
|
min: {
|
||||||
x: Math.min(a.min.x, b.min.x),
|
x: Math.min(a.min!.x, b.min!.x),
|
||||||
y: Math.min(a.min.y, b.min.y),
|
y: Math.min(a.min!.y, b.min!.y),
|
||||||
z: Math.min(a.min.z, b.min.z),
|
z: Math.min(a.min!.z, b.min!.z),
|
||||||
},
|
},
|
||||||
max: {
|
max: {
|
||||||
x: Math.max(a.max.x, b.max.x),
|
x: Math.max(a.max!.x, b.max!.x),
|
||||||
y: Math.max(a.max.y, b.max.y),
|
y: Math.max(a.max!.y, b.max!.y),
|
||||||
z: Math.max(a.max.z, b.max.z),
|
z: Math.max(a.max!.z, b.max!.z),
|
||||||
},
|
},
|
||||||
} satisfies BoundingBox;
|
} satisfies BoundingBox;
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,6 @@ export * from "./imgur";
|
|||||||
export * from "./math";
|
export * from "./math";
|
||||||
export * from "./patreon";
|
export * from "./patreon";
|
||||||
export * from "./protobuf";
|
export * from "./protobuf";
|
||||||
export * from "./protos";
|
|
||||||
export * from "./statistics";
|
export * from "./statistics";
|
||||||
export * from "./streams";
|
export * from "./streams";
|
||||||
export * from "./types";
|
export * from "./types";
|
||||||
@@ -3,6 +3,7 @@ export * from "./fisherYates";
|
|||||||
export * from "./formatCompact";
|
export * from "./formatCompact";
|
||||||
export * from "./isNumber";
|
export * from "./isNumber";
|
||||||
export * from "./NaNFallback";
|
export * from "./NaNFallback";
|
||||||
|
export * from "./normalizeAngleDeg";
|
||||||
export * from "./normalizeAngleRad";
|
export * from "./normalizeAngleRad";
|
||||||
export * from "./normalToEuler";
|
export * from "./normalToEuler";
|
||||||
export * from "./numberToRomanNumeral";
|
export * from "./numberToRomanNumeral";
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
export function normalizeAngleDeg(angle: number) {
|
||||||
|
const newAngle = angle % 360;
|
||||||
|
if (newAngle > 360) return newAngle - 360;
|
||||||
|
if (newAngle < -360) return newAngle + 360;
|
||||||
|
return newAngle;
|
||||||
|
}
|
||||||
@@ -4,44 +4,44 @@ package blitzkit;
|
|||||||
|
|
||||||
message AverageDefinitions {
|
message AverageDefinitions {
|
||||||
map<uint32, AverageDefinitionsEntry> averages = 1;
|
map<uint32, AverageDefinitionsEntry> averages = 1;
|
||||||
required Samples samples = 2;
|
required Samples samples = 2;
|
||||||
required uint64 time = 3;
|
required uint64 time = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AverageDefinitionsEntry {
|
message AverageDefinitionsEntry {
|
||||||
required AverageDefinitionsAllStats mu = 1;
|
required AverageDefinitionsAllStats mu = 1;
|
||||||
required AverageDefinitionsAllStats sigma = 2;
|
required AverageDefinitionsAllStats sigma = 2;
|
||||||
required AverageDefinitionsAllStats r = 3;
|
required AverageDefinitionsAllStats r = 3;
|
||||||
required Samples samples = 4;
|
required Samples samples = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AverageDefinitionsAllStats {
|
message AverageDefinitionsAllStats {
|
||||||
required float battles = 1;
|
required float battles = 1;
|
||||||
required float capture_points = 2;
|
required float capture_points = 2;
|
||||||
required float damage_dealt = 3;
|
required float damage_dealt = 3;
|
||||||
required float damage_received = 4;
|
required float damage_received = 4;
|
||||||
required float dropped_capture_points = 5;
|
required float dropped_capture_points = 5;
|
||||||
required float frags = 6;
|
required float frags = 6;
|
||||||
required float frags8p = 7;
|
required float frags8p = 7;
|
||||||
required float hits = 8;
|
required float hits = 8;
|
||||||
required float losses = 9;
|
required float losses = 9;
|
||||||
required float max_frags = 10;
|
required float max_frags = 10;
|
||||||
required float max_xp = 11;
|
required float max_xp = 11;
|
||||||
required float shots = 12;
|
required float shots = 12;
|
||||||
required float spotted = 13;
|
required float spotted = 13;
|
||||||
required float survived_battles = 14;
|
required float survived_battles = 14;
|
||||||
required float win_and_survived = 15;
|
required float win_and_survived = 15;
|
||||||
required float wins = 16;
|
required float wins = 16;
|
||||||
required float xp = 17;
|
required float xp = 17;
|
||||||
required float battle_life_time = 18;
|
required float battle_life_time = 18;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Samples {
|
message Samples {
|
||||||
required uint32 d_1 = 1;
|
required uint32 d_1 = 1;
|
||||||
required uint32 d_7 = 2;
|
required uint32 d_7 = 2;
|
||||||
required uint32 d_30 = 3;
|
required uint32 d_30 = 3;
|
||||||
required uint32 d_60 = 4;
|
required uint32 d_60 = 4;
|
||||||
required uint32 d_90 = 5;
|
required uint32 d_90 = 5;
|
||||||
required uint32 d_120 = 6;
|
required uint32 d_120 = 6;
|
||||||
required uint32 total = 7;
|
required uint32 total = 7;
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/average_definitions.proto
|
// source: average_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
@@ -11,7 +11,7 @@ export const protobufPackage = "blitzkit";
|
|||||||
|
|
||||||
export interface AverageDefinitions {
|
export interface AverageDefinitions {
|
||||||
averages: { [key: number]: AverageDefinitionsEntry };
|
averages: { [key: number]: AverageDefinitionsEntry };
|
||||||
samples: Samples;
|
samples: Samples | undefined;
|
||||||
time: number;
|
time: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,10 +21,10 @@ export interface AverageDefinitions_AveragesEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface AverageDefinitionsEntry {
|
export interface AverageDefinitionsEntry {
|
||||||
mu: AverageDefinitionsAllStats;
|
mu: AverageDefinitionsAllStats | undefined;
|
||||||
sigma: AverageDefinitionsAllStats;
|
sigma: AverageDefinitionsAllStats | undefined;
|
||||||
r: AverageDefinitionsAllStats;
|
r: AverageDefinitionsAllStats | undefined;
|
||||||
samples: Samples;
|
samples: Samples | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AverageDefinitionsAllStats {
|
export interface AverageDefinitionsAllStats {
|
||||||
@@ -58,13 +58,13 @@ export interface Samples {
|
|||||||
total: number;
|
total: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseAverageDefinitions(): AverageDefinitions {
|
function createBaseAverageDefinitions(): AverageDefinitions {
|
||||||
return { averages: {}, samples: createBaseSamples(), time: 0 };
|
return { averages: {}, samples: undefined, time: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AverageDefinitions: MessageFns<AverageDefinitions> = {
|
export const AverageDefinitions: MessageFns<AverageDefinitions> = {
|
||||||
encode(message: AverageDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: AverageDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
Object.entries(message.averages).forEach(([key, value]) => {
|
globalThis.Object.entries(message.averages).forEach(([key, value]: [string, AverageDefinitionsEntry]) => {
|
||||||
AverageDefinitions_AveragesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
AverageDefinitions_AveragesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
if (message.samples !== undefined) {
|
if (message.samples !== undefined) {
|
||||||
@@ -78,7 +78,7 @@ export const AverageDefinitions: MessageFns<AverageDefinitions> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): AverageDefinitions {
|
decode(input: BinaryReader | Uint8Array, length?: number): AverageDefinitions {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseAverageDefinitions();
|
const message = createBaseAverageDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -122,20 +122,23 @@ export const AverageDefinitions: MessageFns<AverageDefinitions> = {
|
|||||||
fromJSON(object: any): AverageDefinitions {
|
fromJSON(object: any): AverageDefinitions {
|
||||||
return {
|
return {
|
||||||
averages: isObject(object.averages)
|
averages: isObject(object.averages)
|
||||||
? Object.entries(object.averages).reduce<{ [key: number]: AverageDefinitionsEntry }>((acc, [key, value]) => {
|
? (globalThis.Object.entries(object.averages) as [string, any][]).reduce(
|
||||||
acc[globalThis.Number(key)] = AverageDefinitionsEntry.fromJSON(value);
|
(acc: { [key: number]: AverageDefinitionsEntry }, [key, value]: [string, any]) => {
|
||||||
return acc;
|
acc[globalThis.Number(key)] = AverageDefinitionsEntry.fromJSON(value);
|
||||||
}, {})
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
samples: Samples.fromJSON(assertSet("AverageDefinitions.samples", object.samples)),
|
samples: isSet(object.samples) ? Samples.fromJSON(object.samples) : undefined,
|
||||||
time: globalThis.Number(assertSet("AverageDefinitions.time", object.time)),
|
time: isSet(object.time) ? globalThis.Number(object.time) : 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: AverageDefinitions): unknown {
|
toJSON(message: AverageDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.averages) {
|
if (message.averages) {
|
||||||
const entries = Object.entries(message.averages);
|
const entries = globalThis.Object.entries(message.averages) as [string, AverageDefinitionsEntry][];
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.averages = {};
|
obj.averages = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -157,8 +160,8 @@ export const AverageDefinitions: MessageFns<AverageDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<AverageDefinitions>, I>>(object: I): AverageDefinitions {
|
fromPartial<I extends Exact<DeepPartial<AverageDefinitions>, I>>(object: I): AverageDefinitions {
|
||||||
const message = createBaseAverageDefinitions();
|
const message = createBaseAverageDefinitions();
|
||||||
message.averages = Object.entries(object.averages ?? {}).reduce<{ [key: number]: AverageDefinitionsEntry }>(
|
message.averages = (globalThis.Object.entries(object.averages ?? {}) as [string, AverageDefinitionsEntry][]).reduce(
|
||||||
(acc, [key, value]) => {
|
(acc: { [key: number]: AverageDefinitionsEntry }, [key, value]: [string, AverageDefinitionsEntry]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = AverageDefinitionsEntry.fromPartial(value);
|
acc[globalThis.Number(key)] = AverageDefinitionsEntry.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -168,19 +171,19 @@ export const AverageDefinitions: MessageFns<AverageDefinitions> = {
|
|||||||
);
|
);
|
||||||
message.samples = (object.samples !== undefined && object.samples !== null)
|
message.samples = (object.samples !== undefined && object.samples !== null)
|
||||||
? Samples.fromPartial(object.samples)
|
? Samples.fromPartial(object.samples)
|
||||||
: createBaseSamples();
|
: undefined;
|
||||||
message.time = object.time ?? 0;
|
message.time = object.time ?? 0;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseAverageDefinitions_AveragesEntry(): AverageDefinitions_AveragesEntry {
|
function createBaseAverageDefinitions_AveragesEntry(): AverageDefinitions_AveragesEntry {
|
||||||
return { key: 0, value: createBaseAverageDefinitionsEntry() };
|
return { key: 0, value: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AverageDefinitions_AveragesEntry: MessageFns<AverageDefinitions_AveragesEntry> = {
|
export const AverageDefinitions_AveragesEntry: MessageFns<AverageDefinitions_AveragesEntry> = {
|
||||||
encode(message: AverageDefinitions_AveragesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: AverageDefinitions_AveragesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -191,7 +194,7 @@ export const AverageDefinitions_AveragesEntry: MessageFns<AverageDefinitions_Ave
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): AverageDefinitions_AveragesEntry {
|
decode(input: BinaryReader | Uint8Array, length?: number): AverageDefinitions_AveragesEntry {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseAverageDefinitions_AveragesEntry();
|
const message = createBaseAverageDefinitions_AveragesEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -223,14 +226,14 @@ export const AverageDefinitions_AveragesEntry: MessageFns<AverageDefinitions_Ave
|
|||||||
|
|
||||||
fromJSON(object: any): AverageDefinitions_AveragesEntry {
|
fromJSON(object: any): AverageDefinitions_AveragesEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("AverageDefinitions_AveragesEntry.key", object.key)),
|
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||||
value: AverageDefinitionsEntry.fromJSON(assertSet("AverageDefinitions_AveragesEntry.value", object.value)),
|
value: isSet(object.value) ? AverageDefinitionsEntry.fromJSON(object.value) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: AverageDefinitions_AveragesEntry): unknown {
|
toJSON(message: AverageDefinitions_AveragesEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
obj.key = Math.round(message.key);
|
obj.key = Math.round(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -251,18 +254,13 @@ export const AverageDefinitions_AveragesEntry: MessageFns<AverageDefinitions_Ave
|
|||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value = (object.value !== undefined && object.value !== null)
|
||||||
? AverageDefinitionsEntry.fromPartial(object.value)
|
? AverageDefinitionsEntry.fromPartial(object.value)
|
||||||
: createBaseAverageDefinitionsEntry();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseAverageDefinitionsEntry(): AverageDefinitionsEntry {
|
function createBaseAverageDefinitionsEntry(): AverageDefinitionsEntry {
|
||||||
return {
|
return { mu: undefined, sigma: undefined, r: undefined, samples: undefined };
|
||||||
mu: createBaseAverageDefinitionsAllStats(),
|
|
||||||
sigma: createBaseAverageDefinitionsAllStats(),
|
|
||||||
r: createBaseAverageDefinitionsAllStats(),
|
|
||||||
samples: createBaseSamples(),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AverageDefinitionsEntry: MessageFns<AverageDefinitionsEntry> = {
|
export const AverageDefinitionsEntry: MessageFns<AverageDefinitionsEntry> = {
|
||||||
@@ -284,7 +282,7 @@ export const AverageDefinitionsEntry: MessageFns<AverageDefinitionsEntry> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): AverageDefinitionsEntry {
|
decode(input: BinaryReader | Uint8Array, length?: number): AverageDefinitionsEntry {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseAverageDefinitionsEntry();
|
const message = createBaseAverageDefinitionsEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -332,10 +330,10 @@ export const AverageDefinitionsEntry: MessageFns<AverageDefinitionsEntry> = {
|
|||||||
|
|
||||||
fromJSON(object: any): AverageDefinitionsEntry {
|
fromJSON(object: any): AverageDefinitionsEntry {
|
||||||
return {
|
return {
|
||||||
mu: AverageDefinitionsAllStats.fromJSON(assertSet("AverageDefinitionsEntry.mu", object.mu)),
|
mu: isSet(object.mu) ? AverageDefinitionsAllStats.fromJSON(object.mu) : undefined,
|
||||||
sigma: AverageDefinitionsAllStats.fromJSON(assertSet("AverageDefinitionsEntry.sigma", object.sigma)),
|
sigma: isSet(object.sigma) ? AverageDefinitionsAllStats.fromJSON(object.sigma) : undefined,
|
||||||
r: AverageDefinitionsAllStats.fromJSON(assertSet("AverageDefinitionsEntry.r", object.r)),
|
r: isSet(object.r) ? AverageDefinitionsAllStats.fromJSON(object.r) : undefined,
|
||||||
samples: Samples.fromJSON(assertSet("AverageDefinitionsEntry.samples", object.samples)),
|
samples: isSet(object.samples) ? Samples.fromJSON(object.samples) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -363,21 +361,21 @@ export const AverageDefinitionsEntry: MessageFns<AverageDefinitionsEntry> = {
|
|||||||
const message = createBaseAverageDefinitionsEntry();
|
const message = createBaseAverageDefinitionsEntry();
|
||||||
message.mu = (object.mu !== undefined && object.mu !== null)
|
message.mu = (object.mu !== undefined && object.mu !== null)
|
||||||
? AverageDefinitionsAllStats.fromPartial(object.mu)
|
? AverageDefinitionsAllStats.fromPartial(object.mu)
|
||||||
: createBaseAverageDefinitionsAllStats();
|
: undefined;
|
||||||
message.sigma = (object.sigma !== undefined && object.sigma !== null)
|
message.sigma = (object.sigma !== undefined && object.sigma !== null)
|
||||||
? AverageDefinitionsAllStats.fromPartial(object.sigma)
|
? AverageDefinitionsAllStats.fromPartial(object.sigma)
|
||||||
: createBaseAverageDefinitionsAllStats();
|
: undefined;
|
||||||
message.r = (object.r !== undefined && object.r !== null)
|
message.r = (object.r !== undefined && object.r !== null)
|
||||||
? AverageDefinitionsAllStats.fromPartial(object.r)
|
? AverageDefinitionsAllStats.fromPartial(object.r)
|
||||||
: createBaseAverageDefinitionsAllStats();
|
: undefined;
|
||||||
message.samples = (object.samples !== undefined && object.samples !== null)
|
message.samples = (object.samples !== undefined && object.samples !== null)
|
||||||
? Samples.fromPartial(object.samples)
|
? Samples.fromPartial(object.samples)
|
||||||
: createBaseSamples();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseAverageDefinitionsAllStats(): AverageDefinitionsAllStats {
|
function createBaseAverageDefinitionsAllStats(): AverageDefinitionsAllStats {
|
||||||
return {
|
return {
|
||||||
battles: 0,
|
battles: 0,
|
||||||
capture_points: 0,
|
capture_points: 0,
|
||||||
@@ -461,7 +459,7 @@ export const AverageDefinitionsAllStats: MessageFns<AverageDefinitionsAllStats>
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): AverageDefinitionsAllStats {
|
decode(input: BinaryReader | Uint8Array, length?: number): AverageDefinitionsAllStats {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseAverageDefinitionsAllStats();
|
const message = createBaseAverageDefinitionsAllStats();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -621,34 +619,60 @@ export const AverageDefinitionsAllStats: MessageFns<AverageDefinitionsAllStats>
|
|||||||
|
|
||||||
fromJSON(object: any): AverageDefinitionsAllStats {
|
fromJSON(object: any): AverageDefinitionsAllStats {
|
||||||
return {
|
return {
|
||||||
battles: globalThis.Number(assertSet("AverageDefinitionsAllStats.battles", object.battles)),
|
battles: isSet(object.battles) ? globalThis.Number(object.battles) : 0,
|
||||||
capture_points: globalThis.Number(assertSet("AverageDefinitionsAllStats.capture_points", object.capture_points)),
|
capture_points: isSet(object.capturePoints)
|
||||||
damage_dealt: globalThis.Number(assertSet("AverageDefinitionsAllStats.damage_dealt", object.damage_dealt)),
|
? globalThis.Number(object.capturePoints)
|
||||||
damage_received: globalThis.Number(
|
: isSet(object.capture_points)
|
||||||
assertSet("AverageDefinitionsAllStats.damage_received", object.damage_received),
|
? globalThis.Number(object.capture_points)
|
||||||
),
|
: 0,
|
||||||
dropped_capture_points: globalThis.Number(
|
damage_dealt: isSet(object.damageDealt)
|
||||||
assertSet("AverageDefinitionsAllStats.dropped_capture_points", object.dropped_capture_points),
|
? globalThis.Number(object.damageDealt)
|
||||||
),
|
: isSet(object.damage_dealt)
|
||||||
frags: globalThis.Number(assertSet("AverageDefinitionsAllStats.frags", object.frags)),
|
? globalThis.Number(object.damage_dealt)
|
||||||
frags8p: globalThis.Number(assertSet("AverageDefinitionsAllStats.frags8p", object.frags8p)),
|
: 0,
|
||||||
hits: globalThis.Number(assertSet("AverageDefinitionsAllStats.hits", object.hits)),
|
damage_received: isSet(object.damageReceived)
|
||||||
losses: globalThis.Number(assertSet("AverageDefinitionsAllStats.losses", object.losses)),
|
? globalThis.Number(object.damageReceived)
|
||||||
max_frags: globalThis.Number(assertSet("AverageDefinitionsAllStats.max_frags", object.max_frags)),
|
: isSet(object.damage_received)
|
||||||
max_xp: globalThis.Number(assertSet("AverageDefinitionsAllStats.max_xp", object.max_xp)),
|
? globalThis.Number(object.damage_received)
|
||||||
shots: globalThis.Number(assertSet("AverageDefinitionsAllStats.shots", object.shots)),
|
: 0,
|
||||||
spotted: globalThis.Number(assertSet("AverageDefinitionsAllStats.spotted", object.spotted)),
|
dropped_capture_points: isSet(object.droppedCapturePoints)
|
||||||
survived_battles: globalThis.Number(
|
? globalThis.Number(object.droppedCapturePoints)
|
||||||
assertSet("AverageDefinitionsAllStats.survived_battles", object.survived_battles),
|
: isSet(object.dropped_capture_points)
|
||||||
),
|
? globalThis.Number(object.dropped_capture_points)
|
||||||
win_and_survived: globalThis.Number(
|
: 0,
|
||||||
assertSet("AverageDefinitionsAllStats.win_and_survived", object.win_and_survived),
|
frags: isSet(object.frags) ? globalThis.Number(object.frags) : 0,
|
||||||
),
|
frags8p: isSet(object.frags8p) ? globalThis.Number(object.frags8p) : 0,
|
||||||
wins: globalThis.Number(assertSet("AverageDefinitionsAllStats.wins", object.wins)),
|
hits: isSet(object.hits) ? globalThis.Number(object.hits) : 0,
|
||||||
xp: globalThis.Number(assertSet("AverageDefinitionsAllStats.xp", object.xp)),
|
losses: isSet(object.losses) ? globalThis.Number(object.losses) : 0,
|
||||||
battle_life_time: globalThis.Number(
|
max_frags: isSet(object.maxFrags)
|
||||||
assertSet("AverageDefinitionsAllStats.battle_life_time", object.battle_life_time),
|
? globalThis.Number(object.maxFrags)
|
||||||
),
|
: isSet(object.max_frags)
|
||||||
|
? globalThis.Number(object.max_frags)
|
||||||
|
: 0,
|
||||||
|
max_xp: isSet(object.maxXp)
|
||||||
|
? globalThis.Number(object.maxXp)
|
||||||
|
: isSet(object.max_xp)
|
||||||
|
? globalThis.Number(object.max_xp)
|
||||||
|
: 0,
|
||||||
|
shots: isSet(object.shots) ? globalThis.Number(object.shots) : 0,
|
||||||
|
spotted: isSet(object.spotted) ? globalThis.Number(object.spotted) : 0,
|
||||||
|
survived_battles: isSet(object.survivedBattles)
|
||||||
|
? globalThis.Number(object.survivedBattles)
|
||||||
|
: isSet(object.survived_battles)
|
||||||
|
? globalThis.Number(object.survived_battles)
|
||||||
|
: 0,
|
||||||
|
win_and_survived: isSet(object.winAndSurvived)
|
||||||
|
? globalThis.Number(object.winAndSurvived)
|
||||||
|
: isSet(object.win_and_survived)
|
||||||
|
? globalThis.Number(object.win_and_survived)
|
||||||
|
: 0,
|
||||||
|
wins: isSet(object.wins) ? globalThis.Number(object.wins) : 0,
|
||||||
|
xp: isSet(object.xp) ? globalThis.Number(object.xp) : 0,
|
||||||
|
battle_life_time: isSet(object.battleLifeTime)
|
||||||
|
? globalThis.Number(object.battleLifeTime)
|
||||||
|
: isSet(object.battle_life_time)
|
||||||
|
? globalThis.Number(object.battle_life_time)
|
||||||
|
: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -658,16 +682,16 @@ export const AverageDefinitionsAllStats: MessageFns<AverageDefinitionsAllStats>
|
|||||||
obj.battles = message.battles;
|
obj.battles = message.battles;
|
||||||
}
|
}
|
||||||
if (message.capture_points !== 0) {
|
if (message.capture_points !== 0) {
|
||||||
obj.capture_points = message.capture_points;
|
obj.capturePoints = message.capture_points;
|
||||||
}
|
}
|
||||||
if (message.damage_dealt !== 0) {
|
if (message.damage_dealt !== 0) {
|
||||||
obj.damage_dealt = message.damage_dealt;
|
obj.damageDealt = message.damage_dealt;
|
||||||
}
|
}
|
||||||
if (message.damage_received !== 0) {
|
if (message.damage_received !== 0) {
|
||||||
obj.damage_received = message.damage_received;
|
obj.damageReceived = message.damage_received;
|
||||||
}
|
}
|
||||||
if (message.dropped_capture_points !== 0) {
|
if (message.dropped_capture_points !== 0) {
|
||||||
obj.dropped_capture_points = message.dropped_capture_points;
|
obj.droppedCapturePoints = message.dropped_capture_points;
|
||||||
}
|
}
|
||||||
if (message.frags !== 0) {
|
if (message.frags !== 0) {
|
||||||
obj.frags = message.frags;
|
obj.frags = message.frags;
|
||||||
@@ -682,10 +706,10 @@ export const AverageDefinitionsAllStats: MessageFns<AverageDefinitionsAllStats>
|
|||||||
obj.losses = message.losses;
|
obj.losses = message.losses;
|
||||||
}
|
}
|
||||||
if (message.max_frags !== 0) {
|
if (message.max_frags !== 0) {
|
||||||
obj.max_frags = message.max_frags;
|
obj.maxFrags = message.max_frags;
|
||||||
}
|
}
|
||||||
if (message.max_xp !== 0) {
|
if (message.max_xp !== 0) {
|
||||||
obj.max_xp = message.max_xp;
|
obj.maxXp = message.max_xp;
|
||||||
}
|
}
|
||||||
if (message.shots !== 0) {
|
if (message.shots !== 0) {
|
||||||
obj.shots = message.shots;
|
obj.shots = message.shots;
|
||||||
@@ -694,10 +718,10 @@ export const AverageDefinitionsAllStats: MessageFns<AverageDefinitionsAllStats>
|
|||||||
obj.spotted = message.spotted;
|
obj.spotted = message.spotted;
|
||||||
}
|
}
|
||||||
if (message.survived_battles !== 0) {
|
if (message.survived_battles !== 0) {
|
||||||
obj.survived_battles = message.survived_battles;
|
obj.survivedBattles = message.survived_battles;
|
||||||
}
|
}
|
||||||
if (message.win_and_survived !== 0) {
|
if (message.win_and_survived !== 0) {
|
||||||
obj.win_and_survived = message.win_and_survived;
|
obj.winAndSurvived = message.win_and_survived;
|
||||||
}
|
}
|
||||||
if (message.wins !== 0) {
|
if (message.wins !== 0) {
|
||||||
obj.wins = message.wins;
|
obj.wins = message.wins;
|
||||||
@@ -706,7 +730,7 @@ export const AverageDefinitionsAllStats: MessageFns<AverageDefinitionsAllStats>
|
|||||||
obj.xp = message.xp;
|
obj.xp = message.xp;
|
||||||
}
|
}
|
||||||
if (message.battle_life_time !== 0) {
|
if (message.battle_life_time !== 0) {
|
||||||
obj.battle_life_time = message.battle_life_time;
|
obj.battleLifeTime = message.battle_life_time;
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
@@ -738,7 +762,7 @@ export const AverageDefinitionsAllStats: MessageFns<AverageDefinitionsAllStats>
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseSamples(): Samples {
|
function createBaseSamples(): Samples {
|
||||||
return { d_1: 0, d_7: 0, d_30: 0, d_60: 0, d_90: 0, d_120: 0, total: 0 };
|
return { d_1: 0, d_7: 0, d_30: 0, d_60: 0, d_90: 0, d_120: 0, total: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -770,7 +794,7 @@ export const Samples: MessageFns<Samples> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Samples {
|
decode(input: BinaryReader | Uint8Array, length?: number): Samples {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseSamples();
|
const message = createBaseSamples();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -842,35 +866,39 @@ export const Samples: MessageFns<Samples> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Samples {
|
fromJSON(object: any): Samples {
|
||||||
return {
|
return {
|
||||||
d_1: globalThis.Number(assertSet("Samples.d_1", object.d_1)),
|
d_1: isSet(object.d1) ? globalThis.Number(object.d1) : isSet(object.d_1) ? globalThis.Number(object.d_1) : 0,
|
||||||
d_7: globalThis.Number(assertSet("Samples.d_7", object.d_7)),
|
d_7: isSet(object.d7) ? globalThis.Number(object.d7) : isSet(object.d_7) ? globalThis.Number(object.d_7) : 0,
|
||||||
d_30: globalThis.Number(assertSet("Samples.d_30", object.d_30)),
|
d_30: isSet(object.d30) ? globalThis.Number(object.d30) : isSet(object.d_30) ? globalThis.Number(object.d_30) : 0,
|
||||||
d_60: globalThis.Number(assertSet("Samples.d_60", object.d_60)),
|
d_60: isSet(object.d60) ? globalThis.Number(object.d60) : isSet(object.d_60) ? globalThis.Number(object.d_60) : 0,
|
||||||
d_90: globalThis.Number(assertSet("Samples.d_90", object.d_90)),
|
d_90: isSet(object.d90) ? globalThis.Number(object.d90) : isSet(object.d_90) ? globalThis.Number(object.d_90) : 0,
|
||||||
d_120: globalThis.Number(assertSet("Samples.d_120", object.d_120)),
|
d_120: isSet(object.d120)
|
||||||
total: globalThis.Number(assertSet("Samples.total", object.total)),
|
? globalThis.Number(object.d120)
|
||||||
|
: isSet(object.d_120)
|
||||||
|
? globalThis.Number(object.d_120)
|
||||||
|
: 0,
|
||||||
|
total: isSet(object.total) ? globalThis.Number(object.total) : 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: Samples): unknown {
|
toJSON(message: Samples): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.d_1 !== 0) {
|
if (message.d_1 !== 0) {
|
||||||
obj.d_1 = Math.round(message.d_1);
|
obj.d1 = Math.round(message.d_1);
|
||||||
}
|
}
|
||||||
if (message.d_7 !== 0) {
|
if (message.d_7 !== 0) {
|
||||||
obj.d_7 = Math.round(message.d_7);
|
obj.d7 = Math.round(message.d_7);
|
||||||
}
|
}
|
||||||
if (message.d_30 !== 0) {
|
if (message.d_30 !== 0) {
|
||||||
obj.d_30 = Math.round(message.d_30);
|
obj.d30 = Math.round(message.d_30);
|
||||||
}
|
}
|
||||||
if (message.d_60 !== 0) {
|
if (message.d_60 !== 0) {
|
||||||
obj.d_60 = Math.round(message.d_60);
|
obj.d60 = Math.round(message.d_60);
|
||||||
}
|
}
|
||||||
if (message.d_90 !== 0) {
|
if (message.d_90 !== 0) {
|
||||||
obj.d_90 = Math.round(message.d_90);
|
obj.d90 = Math.round(message.d_90);
|
||||||
}
|
}
|
||||||
if (message.d_120 !== 0) {
|
if (message.d_120 !== 0) {
|
||||||
obj.d_120 = Math.round(message.d_120);
|
obj.d120 = Math.round(message.d_120);
|
||||||
}
|
}
|
||||||
if (message.total !== 0) {
|
if (message.total !== 0) {
|
||||||
obj.total = Math.round(message.total);
|
obj.total = Math.round(message.total);
|
||||||
@@ -926,14 +954,6 @@ function isSet(value: any): boolean {
|
|||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -2,15 +2,15 @@ syntax = "proto2";
|
|||||||
|
|
||||||
package blitzkit;
|
package blitzkit;
|
||||||
|
|
||||||
import "packages/core/src/protos/i18n.proto";
|
import "i18n.proto";
|
||||||
|
|
||||||
message CamouflageDefinitions {
|
message CamouflageDefinitions {
|
||||||
map<uint32, Camouflage> camouflages = 1;
|
map<uint32, Camouflage> camouflages = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Camouflage {
|
message Camouflage {
|
||||||
required uint32 id = 1;
|
required uint32 id = 1;
|
||||||
required I18nString name = 2;
|
required I18nString name = 2;
|
||||||
optional I18nString tank_name = 3;
|
optional I18nString tank_name = 3;
|
||||||
optional I18nString tank_name_full = 4;
|
optional I18nString tank_name_full = 4;
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/camouflage_definitions.proto
|
// source: camouflage_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
import { createBaseI18nString, I18nString } from './i18n';
|
import { I18nString } from "./i18n";
|
||||||
|
|
||||||
export const protobufPackage = 'blitzkit';
|
export const protobufPackage = "blitzkit";
|
||||||
|
|
||||||
export interface CamouflageDefinitions {
|
export interface CamouflageDefinitions {
|
||||||
camouflages: { [key: number]: Camouflage };
|
camouflages: { [key: number]: Camouflage };
|
||||||
@@ -21,36 +21,26 @@ export interface CamouflageDefinitions_CamouflagesEntry {
|
|||||||
|
|
||||||
export interface Camouflage {
|
export interface Camouflage {
|
||||||
id: number;
|
id: number;
|
||||||
name: I18nString;
|
name: I18nString | undefined;
|
||||||
tank_name?: I18nString;
|
tank_name?: I18nString | undefined;
|
||||||
tank_name_full?: I18nString;
|
tank_name_full?: I18nString | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseCamouflageDefinitions(): CamouflageDefinitions {
|
function createBaseCamouflageDefinitions(): CamouflageDefinitions {
|
||||||
return { camouflages: {} };
|
return { camouflages: {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
||||||
encode(
|
encode(message: CamouflageDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
message: CamouflageDefinitions,
|
globalThis.Object.entries(message.camouflages).forEach(([key, value]: [string, Camouflage]) => {
|
||||||
writer: BinaryWriter = new BinaryWriter(),
|
CamouflageDefinitions_CamouflagesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
): BinaryWriter {
|
|
||||||
Object.entries(message.camouflages).forEach(([key, value]) => {
|
|
||||||
CamouflageDefinitions_CamouflagesEntry.encode(
|
|
||||||
{ key: key as any, value },
|
|
||||||
writer.uint32(10).fork(),
|
|
||||||
).join();
|
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(
|
decode(input: BinaryReader | Uint8Array, length?: number): CamouflageDefinitions {
|
||||||
input: BinaryReader | Uint8Array,
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
length?: number,
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
): CamouflageDefinitions {
|
|
||||||
const reader =
|
|
||||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
|
||||||
const message = createBaseCamouflageDefinitions();
|
const message = createBaseCamouflageDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -60,10 +50,7 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const entry1 = CamouflageDefinitions_CamouflagesEntry.decode(
|
const entry1 = CamouflageDefinitions_CamouflagesEntry.decode(reader, reader.uint32());
|
||||||
reader,
|
|
||||||
reader.uint32(),
|
|
||||||
);
|
|
||||||
if (entry1.value !== undefined) {
|
if (entry1.value !== undefined) {
|
||||||
message.camouflages[entry1.key] = entry1.value;
|
message.camouflages[entry1.key] = entry1.value;
|
||||||
}
|
}
|
||||||
@@ -81,12 +68,13 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
|||||||
fromJSON(object: any): CamouflageDefinitions {
|
fromJSON(object: any): CamouflageDefinitions {
|
||||||
return {
|
return {
|
||||||
camouflages: isObject(object.camouflages)
|
camouflages: isObject(object.camouflages)
|
||||||
? Object.entries(object.camouflages).reduce<{
|
? (globalThis.Object.entries(object.camouflages) as [string, any][]).reduce(
|
||||||
[key: number]: Camouflage;
|
(acc: { [key: number]: Camouflage }, [key, value]: [string, any]) => {
|
||||||
}>((acc, [key, value]) => {
|
|
||||||
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
|
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -94,7 +82,7 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
|||||||
toJSON(message: CamouflageDefinitions): unknown {
|
toJSON(message: CamouflageDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.camouflages) {
|
if (message.camouflages) {
|
||||||
const entries = Object.entries(message.camouflages);
|
const entries = globalThis.Object.entries(message.camouflages) as [string, Camouflage][];
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.camouflages = {};
|
obj.camouflages = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -105,141 +93,112 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(
|
create<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(base?: I): CamouflageDefinitions {
|
||||||
base?: I,
|
|
||||||
): CamouflageDefinitions {
|
|
||||||
return CamouflageDefinitions.fromPartial(base ?? ({} as any));
|
return CamouflageDefinitions.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(
|
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(object: I): CamouflageDefinitions {
|
||||||
object: I,
|
|
||||||
): CamouflageDefinitions {
|
|
||||||
const message = createBaseCamouflageDefinitions();
|
const message = createBaseCamouflageDefinitions();
|
||||||
message.camouflages = Object.entries(object.camouflages ?? {}).reduce<{
|
message.camouflages = (globalThis.Object.entries(object.camouflages ?? {}) as [string, Camouflage][]).reduce(
|
||||||
[key: number]: Camouflage;
|
(acc: { [key: number]: Camouflage }, [key, value]: [string, Camouflage]) => {
|
||||||
}>((acc, [key, value]) => {
|
if (value !== undefined) {
|
||||||
if (value !== undefined) {
|
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
|
||||||
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
|
}
|
||||||
}
|
return acc;
|
||||||
return acc;
|
},
|
||||||
}, {});
|
{},
|
||||||
|
);
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseCamouflageDefinitions_CamouflagesEntry(): CamouflageDefinitions_CamouflagesEntry {
|
function createBaseCamouflageDefinitions_CamouflagesEntry(): CamouflageDefinitions_CamouflagesEntry {
|
||||||
return { key: 0, value: createBaseCamouflage() };
|
return { key: 0, value: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefinitions_CamouflagesEntry> =
|
export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefinitions_CamouflagesEntry> = {
|
||||||
{
|
encode(message: CamouflageDefinitions_CamouflagesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
encode(
|
if (message.key !== 0) {
|
||||||
message: CamouflageDefinitions_CamouflagesEntry,
|
writer.uint32(8).uint32(message.key);
|
||||||
writer: BinaryWriter = new BinaryWriter(),
|
}
|
||||||
): BinaryWriter {
|
if (message.value !== undefined) {
|
||||||
if (message.key !== undefined) {
|
Camouflage.encode(message.value, writer.uint32(18).fork()).join();
|
||||||
writer.uint32(8).uint32(message.key);
|
}
|
||||||
}
|
return writer;
|
||||||
if (message.value !== undefined) {
|
},
|
||||||
Camouflage.encode(message.value, writer.uint32(18).fork()).join();
|
|
||||||
}
|
|
||||||
return writer;
|
|
||||||
},
|
|
||||||
|
|
||||||
decode(
|
decode(input: BinaryReader | Uint8Array, length?: number): CamouflageDefinitions_CamouflagesEntry {
|
||||||
input: BinaryReader | Uint8Array,
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
length?: number,
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
): CamouflageDefinitions_CamouflagesEntry {
|
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
||||||
const reader =
|
while (reader.pos < end) {
|
||||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
const tag = reader.uint32();
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
switch (tag >>> 3) {
|
||||||
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
case 1: {
|
||||||
while (reader.pos < end) {
|
if (tag !== 8) {
|
||||||
const tag = reader.uint32();
|
break;
|
||||||
switch (tag >>> 3) {
|
|
||||||
case 1: {
|
|
||||||
if (tag !== 8) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
message.key = reader.uint32();
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
case 2: {
|
|
||||||
if (tag !== 18) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
message.value = Camouflage.decode(reader, reader.uint32());
|
message.key = reader.uint32();
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
case 2: {
|
||||||
|
if (tag !== 18) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message.value = Camouflage.decode(reader, reader.uint32());
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if ((tag & 7) === 4 || tag === 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
reader.skip(tag & 7);
|
|
||||||
}
|
}
|
||||||
return message;
|
if ((tag & 7) === 4 || tag === 0) {
|
||||||
},
|
break;
|
||||||
|
|
||||||
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
|
|
||||||
return {
|
|
||||||
key: globalThis.Number(
|
|
||||||
assertSet('CamouflageDefinitions_CamouflagesEntry.key', object.key),
|
|
||||||
),
|
|
||||||
value: Camouflage.fromJSON(
|
|
||||||
assertSet(
|
|
||||||
'CamouflageDefinitions_CamouflagesEntry.value',
|
|
||||||
object.value,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
toJSON(message: CamouflageDefinitions_CamouflagesEntry): unknown {
|
|
||||||
const obj: any = {};
|
|
||||||
if (message.key !== undefined) {
|
|
||||||
obj.key = Math.round(message.key);
|
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
reader.skip(tag & 7);
|
||||||
obj.value = Camouflage.toJSON(message.value);
|
}
|
||||||
}
|
return message;
|
||||||
return obj;
|
},
|
||||||
},
|
|
||||||
|
|
||||||
create<
|
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
|
||||||
I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>,
|
return {
|
||||||
>(base?: I): CamouflageDefinitions_CamouflagesEntry {
|
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||||
return CamouflageDefinitions_CamouflagesEntry.fromPartial(
|
value: isSet(object.value) ? Camouflage.fromJSON(object.value) : undefined,
|
||||||
base ?? ({} as any),
|
};
|
||||||
);
|
},
|
||||||
},
|
|
||||||
fromPartial<
|
|
||||||
I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>,
|
|
||||||
>(object: I): CamouflageDefinitions_CamouflagesEntry {
|
|
||||||
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
|
||||||
message.key = object.key ?? 0;
|
|
||||||
message.value =
|
|
||||||
object.value !== undefined && object.value !== null
|
|
||||||
? Camouflage.fromPartial(object.value)
|
|
||||||
: createBaseCamouflage();
|
|
||||||
return message;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export function createBaseCamouflage(): Camouflage {
|
toJSON(message: CamouflageDefinitions_CamouflagesEntry): unknown {
|
||||||
return {
|
const obj: any = {};
|
||||||
id: 0,
|
if (message.key !== 0) {
|
||||||
name: createBaseI18nString(),
|
obj.key = Math.round(message.key);
|
||||||
tank_name: undefined,
|
}
|
||||||
tank_name_full: undefined,
|
if (message.value !== undefined) {
|
||||||
};
|
obj.value = Camouflage.toJSON(message.value);
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
},
|
||||||
|
|
||||||
|
create<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): CamouflageDefinitions_CamouflagesEntry {
|
||||||
|
return CamouflageDefinitions_CamouflagesEntry.fromPartial(base ?? ({} as any));
|
||||||
|
},
|
||||||
|
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
|
||||||
|
object: I,
|
||||||
|
): CamouflageDefinitions_CamouflagesEntry {
|
||||||
|
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
||||||
|
message.key = object.key ?? 0;
|
||||||
|
message.value = (object.value !== undefined && object.value !== null)
|
||||||
|
? Camouflage.fromPartial(object.value)
|
||||||
|
: undefined;
|
||||||
|
return message;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
function createBaseCamouflage(): Camouflage {
|
||||||
|
return { id: 0, name: undefined, tank_name: undefined, tank_name_full: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Camouflage: MessageFns<Camouflage> = {
|
export const Camouflage: MessageFns<Camouflage> = {
|
||||||
encode(
|
encode(message: Camouflage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
message: Camouflage,
|
|
||||||
writer: BinaryWriter = new BinaryWriter(),
|
|
||||||
): BinaryWriter {
|
|
||||||
if (message.id !== 0) {
|
if (message.id !== 0) {
|
||||||
writer.uint32(8).uint32(message.id);
|
writer.uint32(8).uint32(message.id);
|
||||||
}
|
}
|
||||||
@@ -250,18 +209,14 @@ export const Camouflage: MessageFns<Camouflage> = {
|
|||||||
I18nString.encode(message.tank_name, writer.uint32(26).fork()).join();
|
I18nString.encode(message.tank_name, writer.uint32(26).fork()).join();
|
||||||
}
|
}
|
||||||
if (message.tank_name_full !== undefined) {
|
if (message.tank_name_full !== undefined) {
|
||||||
I18nString.encode(
|
I18nString.encode(message.tank_name_full, writer.uint32(34).fork()).join();
|
||||||
message.tank_name_full,
|
|
||||||
writer.uint32(34).fork(),
|
|
||||||
).join();
|
|
||||||
}
|
}
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Camouflage {
|
decode(input: BinaryReader | Uint8Array, length?: number): Camouflage {
|
||||||
const reader =
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
|
||||||
const message = createBaseCamouflage();
|
const message = createBaseCamouflage();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -309,12 +264,16 @@ export const Camouflage: MessageFns<Camouflage> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Camouflage {
|
fromJSON(object: any): Camouflage {
|
||||||
return {
|
return {
|
||||||
id: globalThis.Number(assertSet('Camouflage.id', object.id)),
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||||
name: I18nString.fromJSON(assertSet('Camouflage.name', object.name)),
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
tank_name: isSet(object.tank_name)
|
tank_name: isSet(object.tankName)
|
||||||
|
? I18nString.fromJSON(object.tankName)
|
||||||
|
: isSet(object.tank_name)
|
||||||
? I18nString.fromJSON(object.tank_name)
|
? I18nString.fromJSON(object.tank_name)
|
||||||
: undefined,
|
: undefined,
|
||||||
tank_name_full: isSet(object.tank_name_full)
|
tank_name_full: isSet(object.tankNameFull)
|
||||||
|
? I18nString.fromJSON(object.tankNameFull)
|
||||||
|
: isSet(object.tank_name_full)
|
||||||
? I18nString.fromJSON(object.tank_name_full)
|
? I18nString.fromJSON(object.tank_name_full)
|
||||||
: undefined,
|
: undefined,
|
||||||
};
|
};
|
||||||
@@ -329,10 +288,10 @@ export const Camouflage: MessageFns<Camouflage> = {
|
|||||||
obj.name = I18nString.toJSON(message.name);
|
obj.name = I18nString.toJSON(message.name);
|
||||||
}
|
}
|
||||||
if (message.tank_name !== undefined) {
|
if (message.tank_name !== undefined) {
|
||||||
obj.tank_name = I18nString.toJSON(message.tank_name);
|
obj.tankName = I18nString.toJSON(message.tank_name);
|
||||||
}
|
}
|
||||||
if (message.tank_name_full !== undefined) {
|
if (message.tank_name_full !== undefined) {
|
||||||
obj.tank_name_full = I18nString.toJSON(message.tank_name_full);
|
obj.tankNameFull = I18nString.toJSON(message.tank_name_full);
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
@@ -340,71 +299,43 @@ export const Camouflage: MessageFns<Camouflage> = {
|
|||||||
create<I extends Exact<DeepPartial<Camouflage>, I>>(base?: I): Camouflage {
|
create<I extends Exact<DeepPartial<Camouflage>, I>>(base?: I): Camouflage {
|
||||||
return Camouflage.fromPartial(base ?? ({} as any));
|
return Camouflage.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<Camouflage>, I>>(
|
fromPartial<I extends Exact<DeepPartial<Camouflage>, I>>(object: I): Camouflage {
|
||||||
object: I,
|
|
||||||
): Camouflage {
|
|
||||||
const message = createBaseCamouflage();
|
const message = createBaseCamouflage();
|
||||||
message.id = object.id ?? 0;
|
message.id = object.id ?? 0;
|
||||||
message.name =
|
message.name = (object.name !== undefined && object.name !== null)
|
||||||
object.name !== undefined && object.name !== null
|
? I18nString.fromPartial(object.name)
|
||||||
? I18nString.fromPartial(object.name)
|
: undefined;
|
||||||
: createBaseI18nString();
|
message.tank_name = (object.tank_name !== undefined && object.tank_name !== null)
|
||||||
message.tank_name =
|
? I18nString.fromPartial(object.tank_name)
|
||||||
object.tank_name !== undefined && object.tank_name !== null
|
: undefined;
|
||||||
? I18nString.fromPartial(object.tank_name)
|
message.tank_name_full = (object.tank_name_full !== undefined && object.tank_name_full !== null)
|
||||||
: undefined;
|
? I18nString.fromPartial(object.tank_name_full)
|
||||||
message.tank_name_full =
|
: undefined;
|
||||||
object.tank_name_full !== undefined && object.tank_name_full !== null
|
|
||||||
? I18nString.fromPartial(object.tank_name_full)
|
|
||||||
: undefined;
|
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
type Builtin =
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||||
| Date
|
|
||||||
| Function
|
|
||||||
| Uint8Array
|
|
||||||
| string
|
|
||||||
| number
|
|
||||||
| boolean
|
|
||||||
| undefined;
|
|
||||||
|
|
||||||
export type DeepPartial<T> = T extends Builtin
|
export type DeepPartial<T> = T extends Builtin ? T
|
||||||
? T
|
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
||||||
: T extends globalThis.Array<infer U>
|
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||||
? globalThis.Array<DeepPartial<U>>
|
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
|
||||||
: T extends ReadonlyArray<infer U>
|
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||||
? ReadonlyArray<DeepPartial<U>>
|
: Partial<T>;
|
||||||
: T extends { $case: string; value: unknown }
|
|
||||||
? { $case: T['$case']; value?: DeepPartial<T['value']> }
|
|
||||||
: T extends {}
|
|
||||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
||||||
: Partial<T>;
|
|
||||||
|
|
||||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||||
export type Exact<P, I extends P> = P extends Builtin
|
export type Exact<P, I extends P> = P extends Builtin ? P
|
||||||
? P
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
||||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
|
||||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
||||||
};
|
|
||||||
|
|
||||||
function isObject(value: any): boolean {
|
function isObject(value: any): boolean {
|
||||||
return typeof value === 'object' && value !== null;
|
return typeof value === "object" && value !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSet(value: any): boolean {
|
function isSet(value: any): boolean {
|
||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -2,28 +2,28 @@ syntax = "proto2";
|
|||||||
|
|
||||||
package blitzkit;
|
package blitzkit;
|
||||||
|
|
||||||
import "packages/core/src/protos/i18n.proto";
|
import "i18n.proto";
|
||||||
|
|
||||||
message ConsumableDefinitions {
|
message ConsumableDefinitions {
|
||||||
map<uint32, Consumable> consumables = 1;
|
map<uint32, Consumable> consumables = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Consumable {
|
message Consumable {
|
||||||
required uint32 id = 1;
|
required uint32 id = 1;
|
||||||
required I18nString name = 2;
|
required I18nString name = 2;
|
||||||
required uint32 cooldown = 3;
|
required uint32 cooldown = 3;
|
||||||
optional float duration = 4;
|
optional float duration = 4;
|
||||||
required bool game_mode_exclusive = 5;
|
required bool game_mode_exclusive = 5;
|
||||||
repeated ConsumableTankFilter include = 6;
|
repeated ConsumableTankFilter include = 6;
|
||||||
repeated ConsumableTankFilter exclude = 7;
|
repeated ConsumableTankFilter exclude = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ConsumableTankFilter {
|
message ConsumableTankFilter {
|
||||||
oneof filter_type {
|
oneof filter_type {
|
||||||
ConsumableTankTierFilter tiers = 1;
|
ConsumableTankTierFilter tiers = 1;
|
||||||
ConsumableTankIdsFilter ids = 2;
|
ConsumableTankIdsFilter ids = 2;
|
||||||
ConsumableTankCategoryFilter categories = 3;
|
ConsumableTankCategoryFilter categories = 3;
|
||||||
ConsumableTankNationFilter nations = 4;
|
ConsumableTankNationFilter nations = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/consumable_definitions.proto
|
// source: consumable_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
import { createBaseI18nString, I18nString } from "./i18n";
|
import { I18nString } from "./i18n";
|
||||||
|
|
||||||
export const protobufPackage = "blitzkit";
|
export const protobufPackage = "blitzkit";
|
||||||
|
|
||||||
export enum ConsumableTankCategoryFilterCategory {
|
export enum ConsumableTankCategoryFilterCategory {
|
||||||
CLIP = 0,
|
CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP = 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
export function consumableTankCategoryFilterCategoryFromJSON(object: any): ConsumableTankCategoryFilterCategory {
|
export function consumableTankCategoryFilterCategoryFromJSON(object: any): ConsumableTankCategoryFilterCategory {
|
||||||
switch (object) {
|
switch (object) {
|
||||||
case 0:
|
case 0:
|
||||||
case "CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP":
|
case "CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP":
|
||||||
return ConsumableTankCategoryFilterCategory.CLIP;
|
return ConsumableTankCategoryFilterCategory.CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP;
|
||||||
default:
|
default:
|
||||||
throw new globalThis.Error(
|
throw new globalThis.Error(
|
||||||
"Unrecognized enum value " + object + " for enum ConsumableTankCategoryFilterCategory",
|
"Unrecognized enum value " + object + " for enum ConsumableTankCategoryFilterCategory",
|
||||||
@@ -28,7 +28,7 @@ export function consumableTankCategoryFilterCategoryFromJSON(object: any): Consu
|
|||||||
|
|
||||||
export function consumableTankCategoryFilterCategoryToJSON(object: ConsumableTankCategoryFilterCategory): string {
|
export function consumableTankCategoryFilterCategoryToJSON(object: ConsumableTankCategoryFilterCategory): string {
|
||||||
switch (object) {
|
switch (object) {
|
||||||
case ConsumableTankCategoryFilterCategory.CLIP:
|
case ConsumableTankCategoryFilterCategory.CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP:
|
||||||
return "CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP";
|
return "CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP";
|
||||||
default:
|
default:
|
||||||
throw new globalThis.Error(
|
throw new globalThis.Error(
|
||||||
@@ -48,7 +48,7 @@ export interface ConsumableDefinitions_ConsumablesEntry {
|
|||||||
|
|
||||||
export interface Consumable {
|
export interface Consumable {
|
||||||
id: number;
|
id: number;
|
||||||
name: I18nString;
|
name: I18nString | undefined;
|
||||||
cooldown: number;
|
cooldown: number;
|
||||||
duration?: number | undefined;
|
duration?: number | undefined;
|
||||||
game_mode_exclusive: boolean;
|
game_mode_exclusive: boolean;
|
||||||
@@ -82,13 +82,13 @@ export interface ConsumableTankNationFilter {
|
|||||||
nations: string[];
|
nations: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseConsumableDefinitions(): ConsumableDefinitions {
|
function createBaseConsumableDefinitions(): ConsumableDefinitions {
|
||||||
return { consumables: {} };
|
return { consumables: {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
||||||
encode(message: ConsumableDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: ConsumableDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
Object.entries(message.consumables).forEach(([key, value]) => {
|
globalThis.Object.entries(message.consumables).forEach(([key, value]: [string, Consumable]) => {
|
||||||
ConsumableDefinitions_ConsumablesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
ConsumableDefinitions_ConsumablesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -96,7 +96,7 @@ export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableDefinitions {
|
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableDefinitions {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumableDefinitions();
|
const message = createBaseConsumableDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -124,10 +124,13 @@ export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
|||||||
fromJSON(object: any): ConsumableDefinitions {
|
fromJSON(object: any): ConsumableDefinitions {
|
||||||
return {
|
return {
|
||||||
consumables: isObject(object.consumables)
|
consumables: isObject(object.consumables)
|
||||||
? Object.entries(object.consumables).reduce<{ [key: number]: Consumable }>((acc, [key, value]) => {
|
? (globalThis.Object.entries(object.consumables) as [string, any][]).reduce(
|
||||||
acc[globalThis.Number(key)] = Consumable.fromJSON(value);
|
(acc: { [key: number]: Consumable }, [key, value]: [string, any]) => {
|
||||||
return acc;
|
acc[globalThis.Number(key)] = Consumable.fromJSON(value);
|
||||||
}, {})
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -135,7 +138,7 @@ export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
|||||||
toJSON(message: ConsumableDefinitions): unknown {
|
toJSON(message: ConsumableDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.consumables) {
|
if (message.consumables) {
|
||||||
const entries = Object.entries(message.consumables);
|
const entries = globalThis.Object.entries(message.consumables) as [string, Consumable][];
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.consumables = {};
|
obj.consumables = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -151,8 +154,8 @@ export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ConsumableDefinitions>, I>>(object: I): ConsumableDefinitions {
|
fromPartial<I extends Exact<DeepPartial<ConsumableDefinitions>, I>>(object: I): ConsumableDefinitions {
|
||||||
const message = createBaseConsumableDefinitions();
|
const message = createBaseConsumableDefinitions();
|
||||||
message.consumables = Object.entries(object.consumables ?? {}).reduce<{ [key: number]: Consumable }>(
|
message.consumables = (globalThis.Object.entries(object.consumables ?? {}) as [string, Consumable][]).reduce(
|
||||||
(acc, [key, value]) => {
|
(acc: { [key: number]: Consumable }, [key, value]: [string, Consumable]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = Consumable.fromPartial(value);
|
acc[globalThis.Number(key)] = Consumable.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -164,13 +167,13 @@ export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseConsumableDefinitions_ConsumablesEntry(): ConsumableDefinitions_ConsumablesEntry {
|
function createBaseConsumableDefinitions_ConsumablesEntry(): ConsumableDefinitions_ConsumablesEntry {
|
||||||
return { key: 0, value: createBaseConsumable() };
|
return { key: 0, value: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ConsumableDefinitions_ConsumablesEntry: MessageFns<ConsumableDefinitions_ConsumablesEntry> = {
|
export const ConsumableDefinitions_ConsumablesEntry: MessageFns<ConsumableDefinitions_ConsumablesEntry> = {
|
||||||
encode(message: ConsumableDefinitions_ConsumablesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: ConsumableDefinitions_ConsumablesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -181,7 +184,7 @@ export const ConsumableDefinitions_ConsumablesEntry: MessageFns<ConsumableDefini
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableDefinitions_ConsumablesEntry {
|
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableDefinitions_ConsumablesEntry {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumableDefinitions_ConsumablesEntry();
|
const message = createBaseConsumableDefinitions_ConsumablesEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -213,14 +216,14 @@ export const ConsumableDefinitions_ConsumablesEntry: MessageFns<ConsumableDefini
|
|||||||
|
|
||||||
fromJSON(object: any): ConsumableDefinitions_ConsumablesEntry {
|
fromJSON(object: any): ConsumableDefinitions_ConsumablesEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("ConsumableDefinitions_ConsumablesEntry.key", object.key)),
|
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||||
value: Consumable.fromJSON(assertSet("ConsumableDefinitions_ConsumablesEntry.value", object.value)),
|
value: isSet(object.value) ? Consumable.fromJSON(object.value) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: ConsumableDefinitions_ConsumablesEntry): unknown {
|
toJSON(message: ConsumableDefinitions_ConsumablesEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
obj.key = Math.round(message.key);
|
obj.key = Math.round(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -241,21 +244,13 @@ export const ConsumableDefinitions_ConsumablesEntry: MessageFns<ConsumableDefini
|
|||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value = (object.value !== undefined && object.value !== null)
|
||||||
? Consumable.fromPartial(object.value)
|
? Consumable.fromPartial(object.value)
|
||||||
: createBaseConsumable();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseConsumable(): Consumable {
|
function createBaseConsumable(): Consumable {
|
||||||
return {
|
return { id: 0, name: undefined, cooldown: 0, duration: 0, game_mode_exclusive: false, include: [], exclude: [] };
|
||||||
id: 0,
|
|
||||||
name: createBaseI18nString(),
|
|
||||||
cooldown: 0,
|
|
||||||
duration: undefined,
|
|
||||||
game_mode_exclusive: false,
|
|
||||||
include: [],
|
|
||||||
exclude: [],
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Consumable: MessageFns<Consumable> = {
|
export const Consumable: MessageFns<Consumable> = {
|
||||||
@@ -269,7 +264,7 @@ export const Consumable: MessageFns<Consumable> = {
|
|||||||
if (message.cooldown !== 0) {
|
if (message.cooldown !== 0) {
|
||||||
writer.uint32(24).uint32(message.cooldown);
|
writer.uint32(24).uint32(message.cooldown);
|
||||||
}
|
}
|
||||||
if (message.duration !== undefined && message.duration !== undefined) {
|
if (message.duration !== undefined && message.duration !== 0) {
|
||||||
writer.uint32(37).float(message.duration);
|
writer.uint32(37).float(message.duration);
|
||||||
}
|
}
|
||||||
if (message.game_mode_exclusive !== false) {
|
if (message.game_mode_exclusive !== false) {
|
||||||
@@ -286,7 +281,7 @@ export const Consumable: MessageFns<Consumable> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Consumable {
|
decode(input: BinaryReader | Uint8Array, length?: number): Consumable {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumable();
|
const message = createBaseConsumable();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -358,11 +353,15 @@ export const Consumable: MessageFns<Consumable> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Consumable {
|
fromJSON(object: any): Consumable {
|
||||||
return {
|
return {
|
||||||
id: globalThis.Number(assertSet("Consumable.id", object.id)),
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||||
name: I18nString.fromJSON(assertSet("Consumable.name", object.name)),
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
cooldown: globalThis.Number(assertSet("Consumable.cooldown", object.cooldown)),
|
cooldown: isSet(object.cooldown) ? globalThis.Number(object.cooldown) : 0,
|
||||||
duration: isSet(object.duration) ? globalThis.Number(object.duration) : undefined,
|
duration: isSet(object.duration) ? globalThis.Number(object.duration) : 0,
|
||||||
game_mode_exclusive: globalThis.Boolean(assertSet("Consumable.game_mode_exclusive", object.game_mode_exclusive)),
|
game_mode_exclusive: isSet(object.gameModeExclusive)
|
||||||
|
? globalThis.Boolean(object.gameModeExclusive)
|
||||||
|
: isSet(object.game_mode_exclusive)
|
||||||
|
? globalThis.Boolean(object.game_mode_exclusive)
|
||||||
|
: false,
|
||||||
include: globalThis.Array.isArray(object?.include)
|
include: globalThis.Array.isArray(object?.include)
|
||||||
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
||||||
: [],
|
: [],
|
||||||
@@ -383,11 +382,11 @@ export const Consumable: MessageFns<Consumable> = {
|
|||||||
if (message.cooldown !== 0) {
|
if (message.cooldown !== 0) {
|
||||||
obj.cooldown = Math.round(message.cooldown);
|
obj.cooldown = Math.round(message.cooldown);
|
||||||
}
|
}
|
||||||
if (message.duration !== undefined && message.duration !== undefined) {
|
if (message.duration !== undefined && message.duration !== 0) {
|
||||||
obj.duration = message.duration;
|
obj.duration = message.duration;
|
||||||
}
|
}
|
||||||
if (message.game_mode_exclusive !== false) {
|
if (message.game_mode_exclusive !== false) {
|
||||||
obj.game_mode_exclusive = message.game_mode_exclusive;
|
obj.gameModeExclusive = message.game_mode_exclusive;
|
||||||
}
|
}
|
||||||
if (message.include?.length) {
|
if (message.include?.length) {
|
||||||
obj.include = message.include.map((e) => ConsumableTankFilter.toJSON(e));
|
obj.include = message.include.map((e) => ConsumableTankFilter.toJSON(e));
|
||||||
@@ -406,9 +405,9 @@ export const Consumable: MessageFns<Consumable> = {
|
|||||||
message.id = object.id ?? 0;
|
message.id = object.id ?? 0;
|
||||||
message.name = (object.name !== undefined && object.name !== null)
|
message.name = (object.name !== undefined && object.name !== null)
|
||||||
? I18nString.fromPartial(object.name)
|
? I18nString.fromPartial(object.name)
|
||||||
: createBaseI18nString();
|
: undefined;
|
||||||
message.cooldown = object.cooldown ?? 0;
|
message.cooldown = object.cooldown ?? 0;
|
||||||
message.duration = object.duration ?? undefined;
|
message.duration = object.duration ?? 0;
|
||||||
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
|
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
|
||||||
message.include = object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
message.include = object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||||
message.exclude = object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
message.exclude = object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||||
@@ -416,7 +415,7 @@ export const Consumable: MessageFns<Consumable> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseConsumableTankFilter(): ConsumableTankFilter {
|
function createBaseConsumableTankFilter(): ConsumableTankFilter {
|
||||||
return { filter_type: undefined };
|
return { filter_type: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,7 +440,7 @@ export const ConsumableTankFilter: MessageFns<ConsumableTankFilter> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankFilter {
|
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankFilter {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumableTankFilter();
|
const message = createBaseConsumableTankFilter();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -508,14 +507,11 @@ export const ConsumableTankFilter: MessageFns<ConsumableTankFilter> = {
|
|||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.filter_type?.$case === "tiers") {
|
if (message.filter_type?.$case === "tiers") {
|
||||||
obj.tiers = ConsumableTankTierFilter.toJSON(message.filter_type.value);
|
obj.tiers = ConsumableTankTierFilter.toJSON(message.filter_type.value);
|
||||||
}
|
} else if (message.filter_type?.$case === "ids") {
|
||||||
if (message.filter_type?.$case === "ids") {
|
|
||||||
obj.ids = ConsumableTankIdsFilter.toJSON(message.filter_type.value);
|
obj.ids = ConsumableTankIdsFilter.toJSON(message.filter_type.value);
|
||||||
}
|
} else if (message.filter_type?.$case === "categories") {
|
||||||
if (message.filter_type?.$case === "categories") {
|
|
||||||
obj.categories = ConsumableTankCategoryFilter.toJSON(message.filter_type.value);
|
obj.categories = ConsumableTankCategoryFilter.toJSON(message.filter_type.value);
|
||||||
}
|
} else if (message.filter_type?.$case === "nations") {
|
||||||
if (message.filter_type?.$case === "nations") {
|
|
||||||
obj.nations = ConsumableTankNationFilter.toJSON(message.filter_type.value);
|
obj.nations = ConsumableTankNationFilter.toJSON(message.filter_type.value);
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
@@ -526,45 +522,46 @@ export const ConsumableTankFilter: MessageFns<ConsumableTankFilter> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ConsumableTankFilter>, I>>(object: I): ConsumableTankFilter {
|
fromPartial<I extends Exact<DeepPartial<ConsumableTankFilter>, I>>(object: I): ConsumableTankFilter {
|
||||||
const message = createBaseConsumableTankFilter();
|
const message = createBaseConsumableTankFilter();
|
||||||
if (
|
switch (object.filter_type?.$case) {
|
||||||
object.filter_type?.$case === "tiers" &&
|
case "tiers": {
|
||||||
object.filter_type?.value !== undefined &&
|
if (object.filter_type?.value !== undefined && object.filter_type?.value !== null) {
|
||||||
object.filter_type?.value !== null
|
message.filter_type = {
|
||||||
) {
|
$case: "tiers",
|
||||||
message.filter_type = { $case: "tiers", value: ConsumableTankTierFilter.fromPartial(object.filter_type.value) };
|
value: ConsumableTankTierFilter.fromPartial(object.filter_type.value),
|
||||||
}
|
};
|
||||||
if (
|
}
|
||||||
object.filter_type?.$case === "ids" &&
|
break;
|
||||||
object.filter_type?.value !== undefined &&
|
}
|
||||||
object.filter_type?.value !== null
|
case "ids": {
|
||||||
) {
|
if (object.filter_type?.value !== undefined && object.filter_type?.value !== null) {
|
||||||
message.filter_type = { $case: "ids", value: ConsumableTankIdsFilter.fromPartial(object.filter_type.value) };
|
message.filter_type = { $case: "ids", value: ConsumableTankIdsFilter.fromPartial(object.filter_type.value) };
|
||||||
}
|
}
|
||||||
if (
|
break;
|
||||||
object.filter_type?.$case === "categories" &&
|
}
|
||||||
object.filter_type?.value !== undefined &&
|
case "categories": {
|
||||||
object.filter_type?.value !== null
|
if (object.filter_type?.value !== undefined && object.filter_type?.value !== null) {
|
||||||
) {
|
message.filter_type = {
|
||||||
message.filter_type = {
|
$case: "categories",
|
||||||
$case: "categories",
|
value: ConsumableTankCategoryFilter.fromPartial(object.filter_type.value),
|
||||||
value: ConsumableTankCategoryFilter.fromPartial(object.filter_type.value),
|
};
|
||||||
};
|
}
|
||||||
}
|
break;
|
||||||
if (
|
}
|
||||||
object.filter_type?.$case === "nations" &&
|
case "nations": {
|
||||||
object.filter_type?.value !== undefined &&
|
if (object.filter_type?.value !== undefined && object.filter_type?.value !== null) {
|
||||||
object.filter_type?.value !== null
|
message.filter_type = {
|
||||||
) {
|
$case: "nations",
|
||||||
message.filter_type = {
|
value: ConsumableTankNationFilter.fromPartial(object.filter_type.value),
|
||||||
$case: "nations",
|
};
|
||||||
value: ConsumableTankNationFilter.fromPartial(object.filter_type.value),
|
}
|
||||||
};
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseConsumableTankTierFilter(): ConsumableTankTierFilter {
|
function createBaseConsumableTankTierFilter(): ConsumableTankTierFilter {
|
||||||
return { min: 0, max: 0 };
|
return { min: 0, max: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -581,7 +578,7 @@ export const ConsumableTankTierFilter: MessageFns<ConsumableTankTierFilter> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankTierFilter {
|
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankTierFilter {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumableTankTierFilter();
|
const message = createBaseConsumableTankTierFilter();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -613,8 +610,8 @@ export const ConsumableTankTierFilter: MessageFns<ConsumableTankTierFilter> = {
|
|||||||
|
|
||||||
fromJSON(object: any): ConsumableTankTierFilter {
|
fromJSON(object: any): ConsumableTankTierFilter {
|
||||||
return {
|
return {
|
||||||
min: globalThis.Number(assertSet("ConsumableTankTierFilter.min", object.min)),
|
min: isSet(object.min) ? globalThis.Number(object.min) : 0,
|
||||||
max: globalThis.Number(assertSet("ConsumableTankTierFilter.max", object.max)),
|
max: isSet(object.max) ? globalThis.Number(object.max) : 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -640,23 +637,21 @@ export const ConsumableTankTierFilter: MessageFns<ConsumableTankTierFilter> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseConsumableTankIdsFilter(): ConsumableTankIdsFilter {
|
function createBaseConsumableTankIdsFilter(): ConsumableTankIdsFilter {
|
||||||
return { ids: [] };
|
return { ids: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ConsumableTankIdsFilter: MessageFns<ConsumableTankIdsFilter> = {
|
export const ConsumableTankIdsFilter: MessageFns<ConsumableTankIdsFilter> = {
|
||||||
encode(message: ConsumableTankIdsFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: ConsumableTankIdsFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
writer.uint32(10).fork();
|
|
||||||
for (const v of message.ids) {
|
for (const v of message.ids) {
|
||||||
writer.uint32(v);
|
writer.uint32(8).uint32(v!);
|
||||||
}
|
}
|
||||||
writer.join();
|
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankIdsFilter {
|
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankIdsFilter {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumableTankIdsFilter();
|
const message = createBaseConsumableTankIdsFilter();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -710,23 +705,21 @@ export const ConsumableTankIdsFilter: MessageFns<ConsumableTankIdsFilter> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseConsumableTankCategoryFilter(): ConsumableTankCategoryFilter {
|
function createBaseConsumableTankCategoryFilter(): ConsumableTankCategoryFilter {
|
||||||
return { categories: [] };
|
return { categories: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ConsumableTankCategoryFilter: MessageFns<ConsumableTankCategoryFilter> = {
|
export const ConsumableTankCategoryFilter: MessageFns<ConsumableTankCategoryFilter> = {
|
||||||
encode(message: ConsumableTankCategoryFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: ConsumableTankCategoryFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
writer.uint32(10).fork();
|
|
||||||
for (const v of message.categories) {
|
for (const v of message.categories) {
|
||||||
writer.int32(v);
|
writer.uint32(8).int32(v!);
|
||||||
}
|
}
|
||||||
writer.join();
|
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankCategoryFilter {
|
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankCategoryFilter {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumableTankCategoryFilter();
|
const message = createBaseConsumableTankCategoryFilter();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -784,7 +777,7 @@ export const ConsumableTankCategoryFilter: MessageFns<ConsumableTankCategoryFilt
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseConsumableTankNationFilter(): ConsumableTankNationFilter {
|
function createBaseConsumableTankNationFilter(): ConsumableTankNationFilter {
|
||||||
return { nations: [] };
|
return { nations: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -798,7 +791,7 @@ export const ConsumableTankNationFilter: MessageFns<ConsumableTankNationFilter>
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankNationFilter {
|
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankNationFilter {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseConsumableTankNationFilter();
|
const message = createBaseConsumableTankNationFilter();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -865,14 +858,6 @@ function isSet(value: any): boolean {
|
|||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -2,15 +2,15 @@ syntax = "proto2";
|
|||||||
|
|
||||||
package blitzkit;
|
package blitzkit;
|
||||||
|
|
||||||
import "packages/core/src/protos/i18n.proto";
|
import "i18n.proto";
|
||||||
|
|
||||||
message EquipmentDefinitions {
|
message EquipmentDefinitions {
|
||||||
map<string, EquipmentPreset> presets = 1;
|
map<string, EquipmentPreset> presets = 1;
|
||||||
map<uint32, Equipment> equipments = 2;
|
map<uint32, Equipment> equipments = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Equipment {
|
message Equipment {
|
||||||
required I18nString name = 1;
|
required I18nString name = 1;
|
||||||
required I18nString description = 2;
|
required I18nString description = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,6 +19,6 @@ message EquipmentPreset {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message EquipmentSlot {
|
message EquipmentSlot {
|
||||||
required uint32 left = 1;
|
required uint32 left = 1;
|
||||||
required uint32 right = 2;
|
required uint32 right = 2;
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/equipment_definitions.proto
|
// source: equipment_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
import { createBaseI18nString, I18nString } from "./i18n";
|
import { I18nString } from "./i18n";
|
||||||
|
|
||||||
export const protobufPackage = "blitzkit";
|
export const protobufPackage = "blitzkit";
|
||||||
|
|
||||||
@@ -26,8 +26,8 @@ export interface EquipmentDefinitions_EquipmentsEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface Equipment {
|
export interface Equipment {
|
||||||
name: I18nString;
|
name: I18nString | undefined;
|
||||||
description: I18nString;
|
description: I18nString | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EquipmentPreset {
|
export interface EquipmentPreset {
|
||||||
@@ -39,16 +39,16 @@ export interface EquipmentSlot {
|
|||||||
right: number;
|
right: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseEquipmentDefinitions(): EquipmentDefinitions {
|
function createBaseEquipmentDefinitions(): EquipmentDefinitions {
|
||||||
return { presets: {}, equipments: {} };
|
return { presets: {}, equipments: {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
||||||
encode(message: EquipmentDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: EquipmentDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
Object.entries(message.presets).forEach(([key, value]) => {
|
globalThis.Object.entries(message.presets).forEach(([key, value]: [string, EquipmentPreset]) => {
|
||||||
EquipmentDefinitions_PresetsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
EquipmentDefinitions_PresetsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
Object.entries(message.equipments).forEach(([key, value]) => {
|
globalThis.Object.entries(message.equipments).forEach(([key, value]: [string, Equipment]) => {
|
||||||
EquipmentDefinitions_EquipmentsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
|
EquipmentDefinitions_EquipmentsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -56,7 +56,7 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions {
|
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseEquipmentDefinitions();
|
const message = createBaseEquipmentDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -95,16 +95,22 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
fromJSON(object: any): EquipmentDefinitions {
|
fromJSON(object: any): EquipmentDefinitions {
|
||||||
return {
|
return {
|
||||||
presets: isObject(object.presets)
|
presets: isObject(object.presets)
|
||||||
? Object.entries(object.presets).reduce<{ [key: string]: EquipmentPreset }>((acc, [key, value]) => {
|
? (globalThis.Object.entries(object.presets) as [string, any][]).reduce(
|
||||||
acc[key] = EquipmentPreset.fromJSON(value);
|
(acc: { [key: string]: EquipmentPreset }, [key, value]: [string, any]) => {
|
||||||
return acc;
|
acc[key] = EquipmentPreset.fromJSON(value);
|
||||||
}, {})
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
equipments: isObject(object.equipments)
|
equipments: isObject(object.equipments)
|
||||||
? Object.entries(object.equipments).reduce<{ [key: number]: Equipment }>((acc, [key, value]) => {
|
? (globalThis.Object.entries(object.equipments) as [string, any][]).reduce(
|
||||||
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
|
(acc: { [key: number]: Equipment }, [key, value]: [string, any]) => {
|
||||||
return acc;
|
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
|
||||||
}, {})
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -112,7 +118,7 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
toJSON(message: EquipmentDefinitions): unknown {
|
toJSON(message: EquipmentDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.presets) {
|
if (message.presets) {
|
||||||
const entries = Object.entries(message.presets);
|
const entries = globalThis.Object.entries(message.presets) as [string, EquipmentPreset][];
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.presets = {};
|
obj.presets = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -121,7 +127,7 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (message.equipments) {
|
if (message.equipments) {
|
||||||
const entries = Object.entries(message.equipments);
|
const entries = globalThis.Object.entries(message.equipments) as [string, Equipment][];
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.equipments = {};
|
obj.equipments = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -137,8 +143,8 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(object: I): EquipmentDefinitions {
|
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(object: I): EquipmentDefinitions {
|
||||||
const message = createBaseEquipmentDefinitions();
|
const message = createBaseEquipmentDefinitions();
|
||||||
message.presets = Object.entries(object.presets ?? {}).reduce<{ [key: string]: EquipmentPreset }>(
|
message.presets = (globalThis.Object.entries(object.presets ?? {}) as [string, EquipmentPreset][]).reduce(
|
||||||
(acc, [key, value]) => {
|
(acc: { [key: string]: EquipmentPreset }, [key, value]: [string, EquipmentPreset]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[key] = EquipmentPreset.fromPartial(value);
|
acc[key] = EquipmentPreset.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -146,8 +152,8 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
);
|
);
|
||||||
message.equipments = Object.entries(object.equipments ?? {}).reduce<{ [key: number]: Equipment }>(
|
message.equipments = (globalThis.Object.entries(object.equipments ?? {}) as [string, Equipment][]).reduce(
|
||||||
(acc, [key, value]) => {
|
(acc: { [key: number]: Equipment }, [key, value]: [string, Equipment]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = Equipment.fromPartial(value);
|
acc[globalThis.Number(key)] = Equipment.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -159,13 +165,13 @@ export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseEquipmentDefinitions_PresetsEntry(): EquipmentDefinitions_PresetsEntry {
|
function createBaseEquipmentDefinitions_PresetsEntry(): EquipmentDefinitions_PresetsEntry {
|
||||||
return { key: "", value: createBaseEquipmentPreset() };
|
return { key: "", value: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_PresetsEntry> = {
|
export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_PresetsEntry> = {
|
||||||
encode(message: EquipmentDefinitions_PresetsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: EquipmentDefinitions_PresetsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== "") {
|
||||||
writer.uint32(10).string(message.key);
|
writer.uint32(10).string(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -176,7 +182,7 @@ export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions_PresetsEntry {
|
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions_PresetsEntry {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseEquipmentDefinitions_PresetsEntry();
|
const message = createBaseEquipmentDefinitions_PresetsEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -208,14 +214,14 @@ export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_
|
|||||||
|
|
||||||
fromJSON(object: any): EquipmentDefinitions_PresetsEntry {
|
fromJSON(object: any): EquipmentDefinitions_PresetsEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.String(assertSet("EquipmentDefinitions_PresetsEntry.key", object.key)),
|
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
||||||
value: EquipmentPreset.fromJSON(assertSet("EquipmentDefinitions_PresetsEntry.value", object.value)),
|
value: isSet(object.value) ? EquipmentPreset.fromJSON(object.value) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: EquipmentDefinitions_PresetsEntry): unknown {
|
toJSON(message: EquipmentDefinitions_PresetsEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== undefined) {
|
if (message.key !== "") {
|
||||||
obj.key = message.key;
|
obj.key = message.key;
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -236,18 +242,18 @@ export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_
|
|||||||
message.key = object.key ?? "";
|
message.key = object.key ?? "";
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value = (object.value !== undefined && object.value !== null)
|
||||||
? EquipmentPreset.fromPartial(object.value)
|
? EquipmentPreset.fromPartial(object.value)
|
||||||
: createBaseEquipmentPreset();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseEquipmentDefinitions_EquipmentsEntry(): EquipmentDefinitions_EquipmentsEntry {
|
function createBaseEquipmentDefinitions_EquipmentsEntry(): EquipmentDefinitions_EquipmentsEntry {
|
||||||
return { key: 0, value: createBaseEquipment() };
|
return { key: 0, value: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitions_EquipmentsEntry> = {
|
export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitions_EquipmentsEntry> = {
|
||||||
encode(message: EquipmentDefinitions_EquipmentsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: EquipmentDefinitions_EquipmentsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -258,7 +264,7 @@ export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitio
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions_EquipmentsEntry {
|
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions_EquipmentsEntry {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
|
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -290,14 +296,14 @@ export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitio
|
|||||||
|
|
||||||
fromJSON(object: any): EquipmentDefinitions_EquipmentsEntry {
|
fromJSON(object: any): EquipmentDefinitions_EquipmentsEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("EquipmentDefinitions_EquipmentsEntry.key", object.key)),
|
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||||
value: Equipment.fromJSON(assertSet("EquipmentDefinitions_EquipmentsEntry.value", object.value)),
|
value: isSet(object.value) ? Equipment.fromJSON(object.value) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: EquipmentDefinitions_EquipmentsEntry): unknown {
|
toJSON(message: EquipmentDefinitions_EquipmentsEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
obj.key = Math.round(message.key);
|
obj.key = Math.round(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -318,13 +324,13 @@ export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitio
|
|||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value = (object.value !== undefined && object.value !== null)
|
||||||
? Equipment.fromPartial(object.value)
|
? Equipment.fromPartial(object.value)
|
||||||
: createBaseEquipment();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseEquipment(): Equipment {
|
function createBaseEquipment(): Equipment {
|
||||||
return { name: createBaseI18nString(), description: createBaseI18nString() };
|
return { name: undefined, description: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Equipment: MessageFns<Equipment> = {
|
export const Equipment: MessageFns<Equipment> = {
|
||||||
@@ -340,7 +346,7 @@ export const Equipment: MessageFns<Equipment> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Equipment {
|
decode(input: BinaryReader | Uint8Array, length?: number): Equipment {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseEquipment();
|
const message = createBaseEquipment();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -372,8 +378,8 @@ export const Equipment: MessageFns<Equipment> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Equipment {
|
fromJSON(object: any): Equipment {
|
||||||
return {
|
return {
|
||||||
name: I18nString.fromJSON(assertSet("Equipment.name", object.name)),
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
description: I18nString.fromJSON(assertSet("Equipment.description", object.description)),
|
description: isSet(object.description) ? I18nString.fromJSON(object.description) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -395,15 +401,15 @@ export const Equipment: MessageFns<Equipment> = {
|
|||||||
const message = createBaseEquipment();
|
const message = createBaseEquipment();
|
||||||
message.name = (object.name !== undefined && object.name !== null)
|
message.name = (object.name !== undefined && object.name !== null)
|
||||||
? I18nString.fromPartial(object.name)
|
? I18nString.fromPartial(object.name)
|
||||||
: createBaseI18nString();
|
: undefined;
|
||||||
message.description = (object.description !== undefined && object.description !== null)
|
message.description = (object.description !== undefined && object.description !== null)
|
||||||
? I18nString.fromPartial(object.description)
|
? I18nString.fromPartial(object.description)
|
||||||
: createBaseI18nString();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseEquipmentPreset(): EquipmentPreset {
|
function createBaseEquipmentPreset(): EquipmentPreset {
|
||||||
return { slots: [] };
|
return { slots: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,7 +423,7 @@ export const EquipmentPreset: MessageFns<EquipmentPreset> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentPreset {
|
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentPreset {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseEquipmentPreset();
|
const message = createBaseEquipmentPreset();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -463,7 +469,7 @@ export const EquipmentPreset: MessageFns<EquipmentPreset> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseEquipmentSlot(): EquipmentSlot {
|
function createBaseEquipmentSlot(): EquipmentSlot {
|
||||||
return { left: 0, right: 0 };
|
return { left: 0, right: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -480,7 +486,7 @@ export const EquipmentSlot: MessageFns<EquipmentSlot> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentSlot {
|
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentSlot {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseEquipmentSlot();
|
const message = createBaseEquipmentSlot();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -512,8 +518,8 @@ export const EquipmentSlot: MessageFns<EquipmentSlot> = {
|
|||||||
|
|
||||||
fromJSON(object: any): EquipmentSlot {
|
fromJSON(object: any): EquipmentSlot {
|
||||||
return {
|
return {
|
||||||
left: globalThis.Number(assertSet("EquipmentSlot.left", object.left)),
|
left: isSet(object.left) ? globalThis.Number(object.left) : 0,
|
||||||
right: globalThis.Number(assertSet("EquipmentSlot.right", object.right)),
|
right: isSet(object.right) ? globalThis.Number(object.right) : 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -560,14 +566,6 @@ function isSet(value: any): boolean {
|
|||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ syntax = "proto2";
|
|||||||
|
|
||||||
package blitzkit;
|
package blitzkit;
|
||||||
|
|
||||||
import "packages/core/src/protos/i18n.proto";
|
import "i18n.proto";
|
||||||
|
|
||||||
message Gallery {
|
message Gallery {
|
||||||
repeated Avatar avatars = 1;
|
repeated Avatar avatars = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Avatar {
|
message Avatar {
|
||||||
required string id = 1;
|
required string id = 1;
|
||||||
required I18nString name = 2;
|
required I18nString name = 2;
|
||||||
required string extension = 3;
|
required string extension = 3;
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/gallery.proto
|
// source: gallery.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
import { createBaseI18nString, I18nString } from "./i18n";
|
import { I18nString } from "./i18n";
|
||||||
|
|
||||||
export const protobufPackage = "blitzkit";
|
export const protobufPackage = "blitzkit";
|
||||||
|
|
||||||
@@ -16,11 +16,11 @@ export interface Gallery {
|
|||||||
|
|
||||||
export interface Avatar {
|
export interface Avatar {
|
||||||
id: string;
|
id: string;
|
||||||
name: I18nString;
|
name: I18nString | undefined;
|
||||||
extension: string;
|
extension: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseGallery(): Gallery {
|
function createBaseGallery(): Gallery {
|
||||||
return { avatars: [] };
|
return { avatars: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ export const Gallery: MessageFns<Gallery> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Gallery {
|
decode(input: BinaryReader | Uint8Array, length?: number): Gallery {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseGallery();
|
const message = createBaseGallery();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -80,8 +80,8 @@ export const Gallery: MessageFns<Gallery> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseAvatar(): Avatar {
|
function createBaseAvatar(): Avatar {
|
||||||
return { id: "", name: createBaseI18nString(), extension: "" };
|
return { id: "", name: undefined, extension: "" };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Avatar: MessageFns<Avatar> = {
|
export const Avatar: MessageFns<Avatar> = {
|
||||||
@@ -100,7 +100,7 @@ export const Avatar: MessageFns<Avatar> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Avatar {
|
decode(input: BinaryReader | Uint8Array, length?: number): Avatar {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseAvatar();
|
const message = createBaseAvatar();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -140,9 +140,9 @@ export const Avatar: MessageFns<Avatar> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Avatar {
|
fromJSON(object: any): Avatar {
|
||||||
return {
|
return {
|
||||||
id: globalThis.String(assertSet("Avatar.id", object.id)),
|
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
||||||
name: I18nString.fromJSON(assertSet("Avatar.name", object.name)),
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
extension: globalThis.String(assertSet("Avatar.extension", object.extension)),
|
extension: isSet(object.extension) ? globalThis.String(object.extension) : "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ export const Avatar: MessageFns<Avatar> = {
|
|||||||
message.id = object.id ?? "";
|
message.id = object.id ?? "";
|
||||||
message.name = (object.name !== undefined && object.name !== null)
|
message.name = (object.name !== undefined && object.name !== null)
|
||||||
? I18nString.fromPartial(object.name)
|
? I18nString.fromPartial(object.name)
|
||||||
: createBaseI18nString();
|
: undefined;
|
||||||
message.extension = object.extension ?? "";
|
message.extension = object.extension ?? "";
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
@@ -191,14 +191,6 @@ function isSet(value: any): boolean {
|
|||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ syntax = "proto2";
|
|||||||
|
|
||||||
package blitzkit;
|
package blitzkit;
|
||||||
|
|
||||||
import "packages/core/src/protos/i18n.proto";
|
import "i18n.proto";
|
||||||
|
|
||||||
message GameDefinitions {
|
message GameDefinitions {
|
||||||
required string version = 1;
|
required string version = 1;
|
||||||
repeated string nations = 2;
|
repeated string nations = 2;
|
||||||
map<uint32, GameMode> gameModes = 3;
|
map<uint32, GameMode> gameModes = 3;
|
||||||
map<uint32, GameModeRole> roles = 4;
|
map<uint32, GameModeRole> roles = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GameMode {
|
message GameMode {
|
||||||
@@ -16,6 +16,6 @@ message GameMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message GameModeRole {
|
message GameModeRole {
|
||||||
repeated uint32 provisions = 1;
|
repeated uint32 provisions = 1;
|
||||||
repeated uint32 consumables = 2;
|
repeated uint32 consumables = 2;
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/game_definitions.proto
|
// source: game_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
import { createBaseI18nString, I18nString } from "./i18n";
|
import { I18nString } from "./i18n";
|
||||||
|
|
||||||
export const protobufPackage = "blitzkit";
|
export const protobufPackage = "blitzkit";
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ export interface GameDefinitions_RolesEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface GameMode {
|
export interface GameMode {
|
||||||
name: I18nString;
|
name: I18nString | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GameModeRole {
|
export interface GameModeRole {
|
||||||
@@ -36,7 +36,7 @@ export interface GameModeRole {
|
|||||||
consumables: number[];
|
consumables: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseGameDefinitions(): GameDefinitions {
|
function createBaseGameDefinitions(): GameDefinitions {
|
||||||
return { version: "", nations: [], gameModes: {}, roles: {} };
|
return { version: "", nations: [], gameModes: {}, roles: {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,10 +48,10 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
for (const v of message.nations) {
|
for (const v of message.nations) {
|
||||||
writer.uint32(18).string(v!);
|
writer.uint32(18).string(v!);
|
||||||
}
|
}
|
||||||
Object.entries(message.gameModes).forEach(([key, value]) => {
|
globalThis.Object.entries(message.gameModes).forEach(([key, value]: [string, GameMode]) => {
|
||||||
GameDefinitions_GameModesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join();
|
GameDefinitions_GameModesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join();
|
||||||
});
|
});
|
||||||
Object.entries(message.roles).forEach(([key, value]) => {
|
globalThis.Object.entries(message.roles).forEach(([key, value]: [string, GameModeRole]) => {
|
||||||
GameDefinitions_RolesEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
|
GameDefinitions_RolesEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -59,7 +59,7 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions {
|
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseGameDefinitions();
|
const message = createBaseGameDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -113,19 +113,25 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
|
|
||||||
fromJSON(object: any): GameDefinitions {
|
fromJSON(object: any): GameDefinitions {
|
||||||
return {
|
return {
|
||||||
version: globalThis.String(assertSet("GameDefinitions.version", object.version)),
|
version: isSet(object.version) ? globalThis.String(object.version) : "",
|
||||||
nations: globalThis.Array.isArray(object?.nations) ? object.nations.map((e: any) => globalThis.String(e)) : [],
|
nations: globalThis.Array.isArray(object?.nations) ? object.nations.map((e: any) => globalThis.String(e)) : [],
|
||||||
gameModes: isObject(object.gameModes)
|
gameModes: isObject(object.gameModes)
|
||||||
? Object.entries(object.gameModes).reduce<{ [key: number]: GameMode }>((acc, [key, value]) => {
|
? (globalThis.Object.entries(object.gameModes) as [string, any][]).reduce(
|
||||||
acc[globalThis.Number(key)] = GameMode.fromJSON(value);
|
(acc: { [key: number]: GameMode }, [key, value]: [string, any]) => {
|
||||||
return acc;
|
acc[globalThis.Number(key)] = GameMode.fromJSON(value);
|
||||||
}, {})
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
roles: isObject(object.roles)
|
roles: isObject(object.roles)
|
||||||
? Object.entries(object.roles).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => {
|
? (globalThis.Object.entries(object.roles) as [string, any][]).reduce(
|
||||||
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
|
(acc: { [key: number]: GameModeRole }, [key, value]: [string, any]) => {
|
||||||
return acc;
|
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
|
||||||
}, {})
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -139,7 +145,7 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
obj.nations = message.nations;
|
obj.nations = message.nations;
|
||||||
}
|
}
|
||||||
if (message.gameModes) {
|
if (message.gameModes) {
|
||||||
const entries = Object.entries(message.gameModes);
|
const entries = globalThis.Object.entries(message.gameModes) as [string, GameMode][];
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.gameModes = {};
|
obj.gameModes = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -148,7 +154,7 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (message.roles) {
|
if (message.roles) {
|
||||||
const entries = Object.entries(message.roles);
|
const entries = globalThis.Object.entries(message.roles) as [string, GameModeRole][];
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.roles = {};
|
obj.roles = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -166,8 +172,8 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
const message = createBaseGameDefinitions();
|
const message = createBaseGameDefinitions();
|
||||||
message.version = object.version ?? "";
|
message.version = object.version ?? "";
|
||||||
message.nations = object.nations?.map((e) => e) || [];
|
message.nations = object.nations?.map((e) => e) || [];
|
||||||
message.gameModes = Object.entries(object.gameModes ?? {}).reduce<{ [key: number]: GameMode }>(
|
message.gameModes = (globalThis.Object.entries(object.gameModes ?? {}) as [string, GameMode][]).reduce(
|
||||||
(acc, [key, value]) => {
|
(acc: { [key: number]: GameMode }, [key, value]: [string, GameMode]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = GameMode.fromPartial(value);
|
acc[globalThis.Number(key)] = GameMode.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -175,23 +181,26 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
|
|||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
);
|
);
|
||||||
message.roles = Object.entries(object.roles ?? {}).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => {
|
message.roles = (globalThis.Object.entries(object.roles ?? {}) as [string, GameModeRole][]).reduce(
|
||||||
if (value !== undefined) {
|
(acc: { [key: number]: GameModeRole }, [key, value]: [string, GameModeRole]) => {
|
||||||
acc[globalThis.Number(key)] = GameModeRole.fromPartial(value);
|
if (value !== undefined) {
|
||||||
}
|
acc[globalThis.Number(key)] = GameModeRole.fromPartial(value);
|
||||||
return acc;
|
}
|
||||||
}, {});
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
);
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseGameDefinitions_GameModesEntry(): GameDefinitions_GameModesEntry {
|
function createBaseGameDefinitions_GameModesEntry(): GameDefinitions_GameModesEntry {
|
||||||
return { key: 0, value: createBaseGameMode() };
|
return { key: 0, value: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> = {
|
export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> = {
|
||||||
encode(message: GameDefinitions_GameModesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: GameDefinitions_GameModesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -202,7 +211,7 @@ export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameMode
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_GameModesEntry {
|
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_GameModesEntry {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseGameDefinitions_GameModesEntry();
|
const message = createBaseGameDefinitions_GameModesEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -234,14 +243,14 @@ export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameMode
|
|||||||
|
|
||||||
fromJSON(object: any): GameDefinitions_GameModesEntry {
|
fromJSON(object: any): GameDefinitions_GameModesEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("GameDefinitions_GameModesEntry.key", object.key)),
|
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||||
value: GameMode.fromJSON(assertSet("GameDefinitions_GameModesEntry.value", object.value)),
|
value: isSet(object.value) ? GameMode.fromJSON(object.value) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: GameDefinitions_GameModesEntry): unknown {
|
toJSON(message: GameDefinitions_GameModesEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
obj.key = Math.round(message.key);
|
obj.key = Math.round(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -260,18 +269,18 @@ export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameMode
|
|||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value = (object.value !== undefined && object.value !== null)
|
||||||
? GameMode.fromPartial(object.value)
|
? GameMode.fromPartial(object.value)
|
||||||
: createBaseGameMode();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseGameDefinitions_RolesEntry(): GameDefinitions_RolesEntry {
|
function createBaseGameDefinitions_RolesEntry(): GameDefinitions_RolesEntry {
|
||||||
return { key: 0, value: createBaseGameModeRole() };
|
return { key: 0, value: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry> = {
|
export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry> = {
|
||||||
encode(message: GameDefinitions_RolesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: GameDefinitions_RolesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -282,7 +291,7 @@ export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry>
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_RolesEntry {
|
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_RolesEntry {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseGameDefinitions_RolesEntry();
|
const message = createBaseGameDefinitions_RolesEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -314,14 +323,14 @@ export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry>
|
|||||||
|
|
||||||
fromJSON(object: any): GameDefinitions_RolesEntry {
|
fromJSON(object: any): GameDefinitions_RolesEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("GameDefinitions_RolesEntry.key", object.key)),
|
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||||
value: GameModeRole.fromJSON(assertSet("GameDefinitions_RolesEntry.value", object.value)),
|
value: isSet(object.value) ? GameModeRole.fromJSON(object.value) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: GameDefinitions_RolesEntry): unknown {
|
toJSON(message: GameDefinitions_RolesEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
obj.key = Math.round(message.key);
|
obj.key = Math.round(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -338,13 +347,13 @@ export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry>
|
|||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value = (object.value !== undefined && object.value !== null)
|
||||||
? GameModeRole.fromPartial(object.value)
|
? GameModeRole.fromPartial(object.value)
|
||||||
: createBaseGameModeRole();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseGameMode(): GameMode {
|
function createBaseGameMode(): GameMode {
|
||||||
return { name: createBaseI18nString() };
|
return { name: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const GameMode: MessageFns<GameMode> = {
|
export const GameMode: MessageFns<GameMode> = {
|
||||||
@@ -357,7 +366,7 @@ export const GameMode: MessageFns<GameMode> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): GameMode {
|
decode(input: BinaryReader | Uint8Array, length?: number): GameMode {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseGameMode();
|
const message = createBaseGameMode();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -380,7 +389,7 @@ export const GameMode: MessageFns<GameMode> = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
fromJSON(object: any): GameMode {
|
fromJSON(object: any): GameMode {
|
||||||
return { name: I18nString.fromJSON(assertSet("GameMode.name", object.name)) };
|
return { name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined };
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: GameMode): unknown {
|
toJSON(message: GameMode): unknown {
|
||||||
@@ -398,33 +407,29 @@ export const GameMode: MessageFns<GameMode> = {
|
|||||||
const message = createBaseGameMode();
|
const message = createBaseGameMode();
|
||||||
message.name = (object.name !== undefined && object.name !== null)
|
message.name = (object.name !== undefined && object.name !== null)
|
||||||
? I18nString.fromPartial(object.name)
|
? I18nString.fromPartial(object.name)
|
||||||
: createBaseI18nString();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseGameModeRole(): GameModeRole {
|
function createBaseGameModeRole(): GameModeRole {
|
||||||
return { provisions: [], consumables: [] };
|
return { provisions: [], consumables: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const GameModeRole: MessageFns<GameModeRole> = {
|
export const GameModeRole: MessageFns<GameModeRole> = {
|
||||||
encode(message: GameModeRole, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: GameModeRole, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
writer.uint32(10).fork();
|
|
||||||
for (const v of message.provisions) {
|
for (const v of message.provisions) {
|
||||||
writer.uint32(v);
|
writer.uint32(8).uint32(v!);
|
||||||
}
|
}
|
||||||
writer.join();
|
|
||||||
writer.uint32(18).fork();
|
|
||||||
for (const v of message.consumables) {
|
for (const v of message.consumables) {
|
||||||
writer.uint32(v);
|
writer.uint32(16).uint32(v!);
|
||||||
}
|
}
|
||||||
writer.join();
|
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): GameModeRole {
|
decode(input: BinaryReader | Uint8Array, length?: number): GameModeRole {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseGameModeRole();
|
const message = createBaseGameModeRole();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -528,14 +533,6 @@ function isSet(value: any): boolean {
|
|||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/i18n.proto
|
// source: i18n.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
@@ -18,13 +18,13 @@ export interface I18nString_LocalesEntry {
|
|||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseI18nString(): I18nString {
|
function createBaseI18nString(): I18nString {
|
||||||
return { locales: {} };
|
return { locales: {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const I18nString: MessageFns<I18nString> = {
|
export const I18nString: MessageFns<I18nString> = {
|
||||||
encode(message: I18nString, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: I18nString, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
Object.entries(message.locales).forEach(([key, value]) => {
|
globalThis.Object.entries(message.locales).forEach(([key, value]: [string, string]) => {
|
||||||
I18nString_LocalesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
I18nString_LocalesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -32,7 +32,7 @@ export const I18nString: MessageFns<I18nString> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): I18nString {
|
decode(input: BinaryReader | Uint8Array, length?: number): I18nString {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseI18nString();
|
const message = createBaseI18nString();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -60,10 +60,13 @@ export const I18nString: MessageFns<I18nString> = {
|
|||||||
fromJSON(object: any): I18nString {
|
fromJSON(object: any): I18nString {
|
||||||
return {
|
return {
|
||||||
locales: isObject(object.locales)
|
locales: isObject(object.locales)
|
||||||
? Object.entries(object.locales).reduce<{ [key: string]: string }>((acc, [key, value]) => {
|
? (globalThis.Object.entries(object.locales) as [string, any][]).reduce(
|
||||||
acc[key] = String(value);
|
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
||||||
return acc;
|
acc[key] = globalThis.String(value);
|
||||||
}, {})
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -71,7 +74,7 @@ export const I18nString: MessageFns<I18nString> = {
|
|||||||
toJSON(message: I18nString): unknown {
|
toJSON(message: I18nString): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.locales) {
|
if (message.locales) {
|
||||||
const entries = Object.entries(message.locales);
|
const entries = globalThis.Object.entries(message.locales) as [string, string][];
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.locales = {};
|
obj.locales = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -87,26 +90,29 @@ export const I18nString: MessageFns<I18nString> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<I18nString>, I>>(object: I): I18nString {
|
fromPartial<I extends Exact<DeepPartial<I18nString>, I>>(object: I): I18nString {
|
||||||
const message = createBaseI18nString();
|
const message = createBaseI18nString();
|
||||||
message.locales = Object.entries(object.locales ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {
|
message.locales = (globalThis.Object.entries(object.locales ?? {}) as [string, string][]).reduce(
|
||||||
if (value !== undefined) {
|
(acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
||||||
acc[key] = globalThis.String(value);
|
if (value !== undefined) {
|
||||||
}
|
acc[key] = globalThis.String(value);
|
||||||
return acc;
|
}
|
||||||
}, {});
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
);
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseI18nString_LocalesEntry(): I18nString_LocalesEntry {
|
function createBaseI18nString_LocalesEntry(): I18nString_LocalesEntry {
|
||||||
return { key: "", value: "" };
|
return { key: "", value: "" };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const I18nString_LocalesEntry: MessageFns<I18nString_LocalesEntry> = {
|
export const I18nString_LocalesEntry: MessageFns<I18nString_LocalesEntry> = {
|
||||||
encode(message: I18nString_LocalesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: I18nString_LocalesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== "") {
|
||||||
writer.uint32(10).string(message.key);
|
writer.uint32(10).string(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== "") {
|
||||||
writer.uint32(18).string(message.value);
|
writer.uint32(18).string(message.value);
|
||||||
}
|
}
|
||||||
return writer;
|
return writer;
|
||||||
@@ -114,7 +120,7 @@ export const I18nString_LocalesEntry: MessageFns<I18nString_LocalesEntry> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): I18nString_LocalesEntry {
|
decode(input: BinaryReader | Uint8Array, length?: number): I18nString_LocalesEntry {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseI18nString_LocalesEntry();
|
const message = createBaseI18nString_LocalesEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -146,17 +152,17 @@ export const I18nString_LocalesEntry: MessageFns<I18nString_LocalesEntry> = {
|
|||||||
|
|
||||||
fromJSON(object: any): I18nString_LocalesEntry {
|
fromJSON(object: any): I18nString_LocalesEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.String(assertSet("I18nString_LocalesEntry.key", object.key)),
|
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
||||||
value: globalThis.String(assertSet("I18nString_LocalesEntry.value", object.value)),
|
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: I18nString_LocalesEntry): unknown {
|
toJSON(message: I18nString_LocalesEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== undefined) {
|
if (message.key !== "") {
|
||||||
obj.key = message.key;
|
obj.key = message.key;
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== "") {
|
||||||
obj.value = message.value;
|
obj.value = message.value;
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
@@ -194,14 +200,6 @@ function isSet(value: any): boolean {
|
|||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
export * from './average_definitions.ts';
|
export * from "./average_definitions.ts";
|
||||||
export * from './camouflage_definitions.ts';
|
export * from "./camouflage_definitions.ts";
|
||||||
export * from './consumable_definitions.ts';
|
export * from "./consumable_definitions.ts";
|
||||||
export * from './equipment_definitions.ts';
|
export * from "./equipment_definitions.ts";
|
||||||
export * from './gallery.ts';
|
export * from "./gallery.ts";
|
||||||
export * from './game_definitions.ts';
|
export * from "./game_definitions.ts";
|
||||||
export * from './i18n.ts';
|
export * from "./i18n.ts";
|
||||||
export * from './map_definitions.ts';
|
export * from "./map_definitions.ts";
|
||||||
export * from './model_definitions.ts';
|
export * from "./model_definitions.ts";
|
||||||
export * from './popular_tanks.ts';
|
export * from "./popular_tanks.ts";
|
||||||
export * from './provision_definitions.ts';
|
export * from "./provision_definitions.ts";
|
||||||
export * from './rating_leaderboard.ts';
|
export * from "./rating_leaderboard.ts";
|
||||||
export * from './reviews.ts';
|
export * from "./reviews.ts";
|
||||||
export * from './skill_definitions.ts';
|
export * from "./skill_definitions.ts";
|
||||||
export * from './tank_definitions.ts';
|
export * from "./tank_definitions.ts";
|
||||||
@@ -2,13 +2,13 @@ syntax = "proto2";
|
|||||||
|
|
||||||
package blitzkit;
|
package blitzkit;
|
||||||
|
|
||||||
import "packages/core/src/protos/i18n.proto";
|
import "i18n.proto";
|
||||||
|
|
||||||
message MapDefinitions {
|
message MapDefinitions {
|
||||||
map<int32, MapDefinition> maps = 1;
|
map<int32, MapDefinition> maps = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message MapDefinition {
|
message MapDefinition {
|
||||||
required uint32 id = 1;
|
required uint32 id = 1;
|
||||||
required I18nString name = 2;
|
required I18nString name = 2;
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/map_definitions.proto
|
// source: map_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
import { createBaseI18nString, I18nString } from "./i18n";
|
import { I18nString } from "./i18n";
|
||||||
|
|
||||||
export const protobufPackage = "blitzkit";
|
export const protobufPackage = "blitzkit";
|
||||||
|
|
||||||
@@ -21,16 +21,16 @@ export interface MapDefinitions_MapsEntry {
|
|||||||
|
|
||||||
export interface MapDefinition {
|
export interface MapDefinition {
|
||||||
id: number;
|
id: number;
|
||||||
name: I18nString;
|
name: I18nString | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseMapDefinitions(): MapDefinitions {
|
function createBaseMapDefinitions(): MapDefinitions {
|
||||||
return { maps: {} };
|
return { maps: {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const MapDefinitions: MessageFns<MapDefinitions> = {
|
export const MapDefinitions: MessageFns<MapDefinitions> = {
|
||||||
encode(message: MapDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: MapDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
Object.entries(message.maps).forEach(([key, value]) => {
|
globalThis.Object.entries(message.maps).forEach(([key, value]: [string, MapDefinition]) => {
|
||||||
MapDefinitions_MapsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
MapDefinitions_MapsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -38,7 +38,7 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinitions {
|
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinitions {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseMapDefinitions();
|
const message = createBaseMapDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -66,10 +66,13 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
|
|||||||
fromJSON(object: any): MapDefinitions {
|
fromJSON(object: any): MapDefinitions {
|
||||||
return {
|
return {
|
||||||
maps: isObject(object.maps)
|
maps: isObject(object.maps)
|
||||||
? Object.entries(object.maps).reduce<{ [key: number]: MapDefinition }>((acc, [key, value]) => {
|
? (globalThis.Object.entries(object.maps) as [string, any][]).reduce(
|
||||||
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
|
(acc: { [key: number]: MapDefinition }, [key, value]: [string, any]) => {
|
||||||
return acc;
|
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
|
||||||
}, {})
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -77,7 +80,7 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
|
|||||||
toJSON(message: MapDefinitions): unknown {
|
toJSON(message: MapDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.maps) {
|
if (message.maps) {
|
||||||
const entries = Object.entries(message.maps);
|
const entries = globalThis.Object.entries(message.maps) as [string, MapDefinition][];
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.maps = {};
|
obj.maps = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -93,23 +96,26 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<MapDefinitions>, I>>(object: I): MapDefinitions {
|
fromPartial<I extends Exact<DeepPartial<MapDefinitions>, I>>(object: I): MapDefinitions {
|
||||||
const message = createBaseMapDefinitions();
|
const message = createBaseMapDefinitions();
|
||||||
message.maps = Object.entries(object.maps ?? {}).reduce<{ [key: number]: MapDefinition }>((acc, [key, value]) => {
|
message.maps = (globalThis.Object.entries(object.maps ?? {}) as [string, MapDefinition][]).reduce(
|
||||||
if (value !== undefined) {
|
(acc: { [key: number]: MapDefinition }, [key, value]: [string, MapDefinition]) => {
|
||||||
acc[globalThis.Number(key)] = MapDefinition.fromPartial(value);
|
if (value !== undefined) {
|
||||||
}
|
acc[globalThis.Number(key)] = MapDefinition.fromPartial(value);
|
||||||
return acc;
|
}
|
||||||
}, {});
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
);
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseMapDefinitions_MapsEntry(): MapDefinitions_MapsEntry {
|
function createBaseMapDefinitions_MapsEntry(): MapDefinitions_MapsEntry {
|
||||||
return { key: 0, value: createBaseMapDefinition() };
|
return { key: 0, value: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
|
export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
|
||||||
encode(message: MapDefinitions_MapsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: MapDefinitions_MapsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
writer.uint32(8).int32(message.key);
|
writer.uint32(8).int32(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -120,7 +126,7 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinitions_MapsEntry {
|
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinitions_MapsEntry {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseMapDefinitions_MapsEntry();
|
const message = createBaseMapDefinitions_MapsEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -152,14 +158,14 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
|
|||||||
|
|
||||||
fromJSON(object: any): MapDefinitions_MapsEntry {
|
fromJSON(object: any): MapDefinitions_MapsEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("MapDefinitions_MapsEntry.key", object.key)),
|
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||||
value: MapDefinition.fromJSON(assertSet("MapDefinitions_MapsEntry.value", object.value)),
|
value: isSet(object.value) ? MapDefinition.fromJSON(object.value) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: MapDefinitions_MapsEntry): unknown {
|
toJSON(message: MapDefinitions_MapsEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
obj.key = Math.round(message.key);
|
obj.key = Math.round(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -176,13 +182,13 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
|
|||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value = (object.value !== undefined && object.value !== null)
|
||||||
? MapDefinition.fromPartial(object.value)
|
? MapDefinition.fromPartial(object.value)
|
||||||
: createBaseMapDefinition();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseMapDefinition(): MapDefinition {
|
function createBaseMapDefinition(): MapDefinition {
|
||||||
return { id: 0, name: createBaseI18nString() };
|
return { id: 0, name: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const MapDefinition: MessageFns<MapDefinition> = {
|
export const MapDefinition: MessageFns<MapDefinition> = {
|
||||||
@@ -198,7 +204,7 @@ export const MapDefinition: MessageFns<MapDefinition> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinition {
|
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinition {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseMapDefinition();
|
const message = createBaseMapDefinition();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -230,8 +236,8 @@ export const MapDefinition: MessageFns<MapDefinition> = {
|
|||||||
|
|
||||||
fromJSON(object: any): MapDefinition {
|
fromJSON(object: any): MapDefinition {
|
||||||
return {
|
return {
|
||||||
id: globalThis.Number(assertSet("MapDefinition.id", object.id)),
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||||
name: I18nString.fromJSON(assertSet("MapDefinition.name", object.name)),
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -254,7 +260,7 @@ export const MapDefinition: MessageFns<MapDefinition> = {
|
|||||||
message.id = object.id ?? 0;
|
message.id = object.id ?? 0;
|
||||||
message.name = (object.name !== undefined && object.name !== null)
|
message.name = (object.name !== undefined && object.name !== null)
|
||||||
? I18nString.fromPartial(object.name)
|
? I18nString.fromPartial(object.name)
|
||||||
: createBaseI18nString();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -280,14 +286,6 @@ function isSet(value: any): boolean {
|
|||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -7,17 +7,17 @@ message ModelDefinitions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message ModelDefinition {
|
message ModelDefinition {
|
||||||
required Armor armor = 1;
|
required Armor armor = 1;
|
||||||
required Vector3 turret_origin = 2;
|
required Vector3 turret_origin = 2;
|
||||||
optional InitialTurretRotation initial_turret_rotation = 3;
|
optional InitialTurretRotation initial_turret_rotation = 3;
|
||||||
map<uint32, TurretModelDefinition> turrets = 4;
|
map<uint32, TurretModelDefinition> turrets = 4;
|
||||||
map<uint32, TrackModelDefinition> tracks = 5;
|
map<uint32, TrackModelDefinition> tracks = 5;
|
||||||
required BoundingBox bounding_box = 6;
|
required BoundingBox bounding_box = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Armor {
|
message Armor {
|
||||||
map<uint32, float> thickness = 1;
|
map<uint32, float> thickness = 1;
|
||||||
repeated uint32 spaced = 2;
|
repeated uint32 spaced = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Vector3 {
|
message Vector3 {
|
||||||
@@ -27,18 +27,18 @@ message Vector3 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message InitialTurretRotation {
|
message InitialTurretRotation {
|
||||||
required float yaw = 1;
|
required float yaw = 1;
|
||||||
required float pitch = 2;
|
required float pitch = 2;
|
||||||
required float roll = 3;
|
required float roll = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TurretModelDefinition {
|
message TurretModelDefinition {
|
||||||
required BoundingBox bounding_box = 1;
|
required BoundingBox bounding_box = 1;
|
||||||
required Armor armor = 2;
|
required Armor armor = 2;
|
||||||
required uint32 model_id = 3;
|
required uint32 model_id = 3;
|
||||||
required Vector3 gun_origin = 4;
|
required Vector3 gun_origin = 4;
|
||||||
map<uint32, GunModelDefinition> guns = 5;
|
map<uint32, GunModelDefinition> guns = 5;
|
||||||
optional YawLimits yaw = 6;
|
optional YawLimits yaw = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
message YawLimits {
|
message YawLimits {
|
||||||
@@ -52,28 +52,28 @@ message BoundingBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message TrackModelDefinition {
|
message TrackModelDefinition {
|
||||||
required float thickness = 1;
|
required float thickness = 1;
|
||||||
required Vector3 origin = 2;
|
required Vector3 origin = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GunModelDefinition {
|
message GunModelDefinition {
|
||||||
required Armor armor = 1;
|
required Armor armor = 1;
|
||||||
required float thickness = 2;
|
required float thickness = 2;
|
||||||
required uint32 model_id = 3;
|
required uint32 model_id = 3;
|
||||||
required PitchLimits pitch = 4;
|
required PitchLimits pitch = 4;
|
||||||
optional float mask = 5;
|
optional float mask = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PitchLimits {
|
message PitchLimits {
|
||||||
required float min = 1;
|
required float min = 1;
|
||||||
required float max = 2;
|
required float max = 2;
|
||||||
optional PitchLimitsExtrema front = 3;
|
optional PitchLimitsExtrema front = 3;
|
||||||
optional PitchLimitsExtrema back = 4;
|
optional PitchLimitsExtrema back = 4;
|
||||||
optional float transition = 5;
|
optional float transition = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PitchLimitsExtrema {
|
message PitchLimitsExtrema {
|
||||||
required float min = 1;
|
required float min = 1;
|
||||||
required float max = 2;
|
required float max = 2;
|
||||||
required float range = 3;
|
required float range = 3;
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -7,6 +7,6 @@ message PopularTanks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message PopularTank {
|
message PopularTank {
|
||||||
required uint32 id = 1;
|
required uint32 id = 1;
|
||||||
required uint32 views = 2; // views in the last 7 days
|
required uint32 views = 2; // views in the last 7 days
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/popular_tanks.proto
|
// source: popular_tanks.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
@@ -19,7 +19,7 @@ export interface PopularTank {
|
|||||||
views: number;
|
views: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBasePopularTanks(): PopularTanks {
|
function createBasePopularTanks(): PopularTanks {
|
||||||
return { tanks: [] };
|
return { tanks: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ export const PopularTanks: MessageFns<PopularTanks> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): PopularTanks {
|
decode(input: BinaryReader | Uint8Array, length?: number): PopularTanks {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBasePopularTanks();
|
const message = createBasePopularTanks();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -79,7 +79,7 @@ export const PopularTanks: MessageFns<PopularTanks> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBasePopularTank(): PopularTank {
|
function createBasePopularTank(): PopularTank {
|
||||||
return { id: 0, views: 0 };
|
return { id: 0, views: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ export const PopularTank: MessageFns<PopularTank> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): PopularTank {
|
decode(input: BinaryReader | Uint8Array, length?: number): PopularTank {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBasePopularTank();
|
const message = createBasePopularTank();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -128,8 +128,8 @@ export const PopularTank: MessageFns<PopularTank> = {
|
|||||||
|
|
||||||
fromJSON(object: any): PopularTank {
|
fromJSON(object: any): PopularTank {
|
||||||
return {
|
return {
|
||||||
id: globalThis.Number(assertSet("PopularTank.id", object.id)),
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||||
views: globalThis.Number(assertSet("PopularTank.views", object.views)),
|
views: isSet(object.views) ? globalThis.Number(object.views) : 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -172,14 +172,6 @@ function isSet(value: any): boolean {
|
|||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -2,18 +2,18 @@ syntax = "proto2";
|
|||||||
|
|
||||||
package blitzkit;
|
package blitzkit;
|
||||||
|
|
||||||
import "packages/core/src/protos/consumable_definitions.proto";
|
import "consumable_definitions.proto";
|
||||||
import "packages/core/src/protos/i18n.proto";
|
import "i18n.proto";
|
||||||
|
|
||||||
message ProvisionDefinitions {
|
message ProvisionDefinitions {
|
||||||
map<uint32, Provision> provisions = 1;
|
map<uint32, Provision> provisions = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Provision {
|
message Provision {
|
||||||
required uint32 id = 1;
|
required uint32 id = 1;
|
||||||
required I18nString name = 2;
|
required I18nString name = 2;
|
||||||
optional float crew = 3;
|
optional float crew = 3;
|
||||||
required bool game_mode_exclusive = 5;
|
required bool game_mode_exclusive = 5;
|
||||||
repeated ConsumableTankFilter include = 6;
|
repeated ConsumableTankFilter include = 6;
|
||||||
repeated ConsumableTankFilter exclude = 7;
|
repeated ConsumableTankFilter exclude = 7;
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/provision_definitions.proto
|
// source: provision_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
import { ConsumableTankFilter } from "./consumable_definitions";
|
import { ConsumableTankFilter } from "./consumable_definitions";
|
||||||
import { createBaseI18nString, I18nString } from "./i18n";
|
import { I18nString } from "./i18n";
|
||||||
|
|
||||||
export const protobufPackage = "blitzkit";
|
export const protobufPackage = "blitzkit";
|
||||||
|
|
||||||
@@ -22,20 +22,20 @@ export interface ProvisionDefinitions_ProvisionsEntry {
|
|||||||
|
|
||||||
export interface Provision {
|
export interface Provision {
|
||||||
id: number;
|
id: number;
|
||||||
name: I18nString;
|
name: I18nString | undefined;
|
||||||
crew?: number | undefined;
|
crew?: number | undefined;
|
||||||
game_mode_exclusive: boolean;
|
game_mode_exclusive: boolean;
|
||||||
include: ConsumableTankFilter[];
|
include: ConsumableTankFilter[];
|
||||||
exclude: ConsumableTankFilter[];
|
exclude: ConsumableTankFilter[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseProvisionDefinitions(): ProvisionDefinitions {
|
function createBaseProvisionDefinitions(): ProvisionDefinitions {
|
||||||
return { provisions: {} };
|
return { provisions: {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
||||||
encode(message: ProvisionDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: ProvisionDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
Object.entries(message.provisions).forEach(([key, value]) => {
|
globalThis.Object.entries(message.provisions).forEach(([key, value]: [string, Provision]) => {
|
||||||
ProvisionDefinitions_ProvisionsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
ProvisionDefinitions_ProvisionsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -43,7 +43,7 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ProvisionDefinitions {
|
decode(input: BinaryReader | Uint8Array, length?: number): ProvisionDefinitions {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseProvisionDefinitions();
|
const message = createBaseProvisionDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -71,10 +71,13 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
|||||||
fromJSON(object: any): ProvisionDefinitions {
|
fromJSON(object: any): ProvisionDefinitions {
|
||||||
return {
|
return {
|
||||||
provisions: isObject(object.provisions)
|
provisions: isObject(object.provisions)
|
||||||
? Object.entries(object.provisions).reduce<{ [key: number]: Provision }>((acc, [key, value]) => {
|
? (globalThis.Object.entries(object.provisions) as [string, any][]).reduce(
|
||||||
acc[globalThis.Number(key)] = Provision.fromJSON(value);
|
(acc: { [key: number]: Provision }, [key, value]: [string, any]) => {
|
||||||
return acc;
|
acc[globalThis.Number(key)] = Provision.fromJSON(value);
|
||||||
}, {})
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -82,7 +85,7 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
|||||||
toJSON(message: ProvisionDefinitions): unknown {
|
toJSON(message: ProvisionDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.provisions) {
|
if (message.provisions) {
|
||||||
const entries = Object.entries(message.provisions);
|
const entries = globalThis.Object.entries(message.provisions) as [string, Provision][];
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.provisions = {};
|
obj.provisions = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -98,8 +101,8 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(object: I): ProvisionDefinitions {
|
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(object: I): ProvisionDefinitions {
|
||||||
const message = createBaseProvisionDefinitions();
|
const message = createBaseProvisionDefinitions();
|
||||||
message.provisions = Object.entries(object.provisions ?? {}).reduce<{ [key: number]: Provision }>(
|
message.provisions = (globalThis.Object.entries(object.provisions ?? {}) as [string, Provision][]).reduce(
|
||||||
(acc, [key, value]) => {
|
(acc: { [key: number]: Provision }, [key, value]: [string, Provision]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = Provision.fromPartial(value);
|
acc[globalThis.Number(key)] = Provision.fromPartial(value);
|
||||||
}
|
}
|
||||||
@@ -111,13 +114,13 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseProvisionDefinitions_ProvisionsEntry(): ProvisionDefinitions_ProvisionsEntry {
|
function createBaseProvisionDefinitions_ProvisionsEntry(): ProvisionDefinitions_ProvisionsEntry {
|
||||||
return { key: 0, value: createBaseProvision() };
|
return { key: 0, value: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitions_ProvisionsEntry> = {
|
export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitions_ProvisionsEntry> = {
|
||||||
encode(message: ProvisionDefinitions_ProvisionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: ProvisionDefinitions_ProvisionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -128,7 +131,7 @@ export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitio
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): ProvisionDefinitions_ProvisionsEntry {
|
decode(input: BinaryReader | Uint8Array, length?: number): ProvisionDefinitions_ProvisionsEntry {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseProvisionDefinitions_ProvisionsEntry();
|
const message = createBaseProvisionDefinitions_ProvisionsEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -160,14 +163,14 @@ export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitio
|
|||||||
|
|
||||||
fromJSON(object: any): ProvisionDefinitions_ProvisionsEntry {
|
fromJSON(object: any): ProvisionDefinitions_ProvisionsEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("ProvisionDefinitions_ProvisionsEntry.key", object.key)),
|
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||||
value: Provision.fromJSON(assertSet("ProvisionDefinitions_ProvisionsEntry.value", object.value)),
|
value: isSet(object.value) ? Provision.fromJSON(object.value) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: ProvisionDefinitions_ProvisionsEntry): unknown {
|
toJSON(message: ProvisionDefinitions_ProvisionsEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
obj.key = Math.round(message.key);
|
obj.key = Math.round(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -188,13 +191,13 @@ export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitio
|
|||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value = (object.value !== undefined && object.value !== null)
|
||||||
? Provision.fromPartial(object.value)
|
? Provision.fromPartial(object.value)
|
||||||
: createBaseProvision();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseProvision(): Provision {
|
function createBaseProvision(): Provision {
|
||||||
return { id: 0, name: createBaseI18nString(), crew: undefined, game_mode_exclusive: false, include: [], exclude: [] };
|
return { id: 0, name: undefined, crew: 0, game_mode_exclusive: false, include: [], exclude: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Provision: MessageFns<Provision> = {
|
export const Provision: MessageFns<Provision> = {
|
||||||
@@ -205,7 +208,7 @@ export const Provision: MessageFns<Provision> = {
|
|||||||
if (message.name !== undefined) {
|
if (message.name !== undefined) {
|
||||||
I18nString.encode(message.name, writer.uint32(18).fork()).join();
|
I18nString.encode(message.name, writer.uint32(18).fork()).join();
|
||||||
}
|
}
|
||||||
if (message.crew !== undefined && message.crew !== undefined) {
|
if (message.crew !== undefined && message.crew !== 0) {
|
||||||
writer.uint32(29).float(message.crew);
|
writer.uint32(29).float(message.crew);
|
||||||
}
|
}
|
||||||
if (message.game_mode_exclusive !== false) {
|
if (message.game_mode_exclusive !== false) {
|
||||||
@@ -222,7 +225,7 @@ export const Provision: MessageFns<Provision> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Provision {
|
decode(input: BinaryReader | Uint8Array, length?: number): Provision {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseProvision();
|
const message = createBaseProvision();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -286,10 +289,14 @@ export const Provision: MessageFns<Provision> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Provision {
|
fromJSON(object: any): Provision {
|
||||||
return {
|
return {
|
||||||
id: globalThis.Number(assertSet("Provision.id", object.id)),
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||||
name: I18nString.fromJSON(assertSet("Provision.name", object.name)),
|
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
|
||||||
crew: isSet(object.crew) ? globalThis.Number(object.crew) : undefined,
|
crew: isSet(object.crew) ? globalThis.Number(object.crew) : 0,
|
||||||
game_mode_exclusive: globalThis.Boolean(assertSet("Provision.game_mode_exclusive", object.game_mode_exclusive)),
|
game_mode_exclusive: isSet(object.gameModeExclusive)
|
||||||
|
? globalThis.Boolean(object.gameModeExclusive)
|
||||||
|
: isSet(object.game_mode_exclusive)
|
||||||
|
? globalThis.Boolean(object.game_mode_exclusive)
|
||||||
|
: false,
|
||||||
include: globalThis.Array.isArray(object?.include)
|
include: globalThis.Array.isArray(object?.include)
|
||||||
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
|
||||||
: [],
|
: [],
|
||||||
@@ -307,11 +314,11 @@ export const Provision: MessageFns<Provision> = {
|
|||||||
if (message.name !== undefined) {
|
if (message.name !== undefined) {
|
||||||
obj.name = I18nString.toJSON(message.name);
|
obj.name = I18nString.toJSON(message.name);
|
||||||
}
|
}
|
||||||
if (message.crew !== undefined && message.crew !== undefined) {
|
if (message.crew !== undefined && message.crew !== 0) {
|
||||||
obj.crew = message.crew;
|
obj.crew = message.crew;
|
||||||
}
|
}
|
||||||
if (message.game_mode_exclusive !== false) {
|
if (message.game_mode_exclusive !== false) {
|
||||||
obj.game_mode_exclusive = message.game_mode_exclusive;
|
obj.gameModeExclusive = message.game_mode_exclusive;
|
||||||
}
|
}
|
||||||
if (message.include?.length) {
|
if (message.include?.length) {
|
||||||
obj.include = message.include.map((e) => ConsumableTankFilter.toJSON(e));
|
obj.include = message.include.map((e) => ConsumableTankFilter.toJSON(e));
|
||||||
@@ -330,8 +337,8 @@ export const Provision: MessageFns<Provision> = {
|
|||||||
message.id = object.id ?? 0;
|
message.id = object.id ?? 0;
|
||||||
message.name = (object.name !== undefined && object.name !== null)
|
message.name = (object.name !== undefined && object.name !== null)
|
||||||
? I18nString.fromPartial(object.name)
|
? I18nString.fromPartial(object.name)
|
||||||
: createBaseI18nString();
|
: undefined;
|
||||||
message.crew = object.crew ?? undefined;
|
message.crew = object.crew ?? 0;
|
||||||
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
|
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
|
||||||
message.include = object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
message.include = object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||||
message.exclude = object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
message.exclude = object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
|
||||||
@@ -360,14 +367,6 @@ function isSet(value: any): boolean {
|
|||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ message RatingLeaderboardV1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message RatingLeaderboardEntryV1 {
|
message RatingLeaderboardEntryV1 {
|
||||||
required uint32 id = 1;
|
required uint32 id = 1;
|
||||||
required uint32 score = 2;
|
required uint32 score = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,11 +23,11 @@ message RatingLeaderboardV2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message RatingLeaderboardEntryV2 {
|
message RatingLeaderboardEntryV2 {
|
||||||
required uint32 id = 1;
|
required uint32 id = 1;
|
||||||
required uint32 score = 2;
|
required uint32 score = 2;
|
||||||
required uint32 battles = 3;
|
required uint32 battles = 3;
|
||||||
required uint32 wins = 4;
|
required uint32 wins = 4;
|
||||||
required uint32 survived = 5;
|
required uint32 survived = 5;
|
||||||
required uint32 damage = 6;
|
required uint32 damage = 6;
|
||||||
required uint32 kills = 7;
|
required uint32 kills = 7;
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/rating_leaderboard.proto
|
// source: rating_leaderboard.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
@@ -36,7 +36,7 @@ export interface RatingLeaderboardEntryV2 {
|
|||||||
kills: number;
|
kills: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseRatingLeaderboard(): RatingLeaderboard {
|
function createBaseRatingLeaderboard(): RatingLeaderboard {
|
||||||
return { version: undefined };
|
return { version: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ export const RatingLeaderboard: MessageFns<RatingLeaderboard> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboard {
|
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboard {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseRatingLeaderboard();
|
const message = createBaseRatingLeaderboard();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -99,8 +99,7 @@ export const RatingLeaderboard: MessageFns<RatingLeaderboard> = {
|
|||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.version?.$case === "v1") {
|
if (message.version?.$case === "v1") {
|
||||||
obj.v1 = RatingLeaderboardV1.toJSON(message.version.value);
|
obj.v1 = RatingLeaderboardV1.toJSON(message.version.value);
|
||||||
}
|
} else if (message.version?.$case === "v2") {
|
||||||
if (message.version?.$case === "v2") {
|
|
||||||
obj.v2 = RatingLeaderboardV2.toJSON(message.version.value);
|
obj.v2 = RatingLeaderboardV2.toJSON(message.version.value);
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
@@ -111,17 +110,25 @@ export const RatingLeaderboard: MessageFns<RatingLeaderboard> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<RatingLeaderboard>, I>>(object: I): RatingLeaderboard {
|
fromPartial<I extends Exact<DeepPartial<RatingLeaderboard>, I>>(object: I): RatingLeaderboard {
|
||||||
const message = createBaseRatingLeaderboard();
|
const message = createBaseRatingLeaderboard();
|
||||||
if (object.version?.$case === "v1" && object.version?.value !== undefined && object.version?.value !== null) {
|
switch (object.version?.$case) {
|
||||||
message.version = { $case: "v1", value: RatingLeaderboardV1.fromPartial(object.version.value) };
|
case "v1": {
|
||||||
}
|
if (object.version?.value !== undefined && object.version?.value !== null) {
|
||||||
if (object.version?.$case === "v2" && object.version?.value !== undefined && object.version?.value !== null) {
|
message.version = { $case: "v1", value: RatingLeaderboardV1.fromPartial(object.version.value) };
|
||||||
message.version = { $case: "v2", value: RatingLeaderboardV2.fromPartial(object.version.value) };
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "v2": {
|
||||||
|
if (object.version?.value !== undefined && object.version?.value !== null) {
|
||||||
|
message.version = { $case: "v2", value: RatingLeaderboardV2.fromPartial(object.version.value) };
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseRatingLeaderboardV1(): RatingLeaderboardV1 {
|
function createBaseRatingLeaderboardV1(): RatingLeaderboardV1 {
|
||||||
return { entries: [] };
|
return { entries: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +142,7 @@ export const RatingLeaderboardV1: MessageFns<RatingLeaderboardV1> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboardV1 {
|
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboardV1 {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseRatingLeaderboardV1();
|
const message = createBaseRatingLeaderboardV1();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -183,7 +190,7 @@ export const RatingLeaderboardV1: MessageFns<RatingLeaderboardV1> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseRatingLeaderboardEntryV1(): RatingLeaderboardEntryV1 {
|
function createBaseRatingLeaderboardEntryV1(): RatingLeaderboardEntryV1 {
|
||||||
return { id: 0, score: 0 };
|
return { id: 0, score: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,7 +207,7 @@ export const RatingLeaderboardEntryV1: MessageFns<RatingLeaderboardEntryV1> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboardEntryV1 {
|
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboardEntryV1 {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseRatingLeaderboardEntryV1();
|
const message = createBaseRatingLeaderboardEntryV1();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -232,8 +239,8 @@ export const RatingLeaderboardEntryV1: MessageFns<RatingLeaderboardEntryV1> = {
|
|||||||
|
|
||||||
fromJSON(object: any): RatingLeaderboardEntryV1 {
|
fromJSON(object: any): RatingLeaderboardEntryV1 {
|
||||||
return {
|
return {
|
||||||
id: globalThis.Number(assertSet("RatingLeaderboardEntryV1.id", object.id)),
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||||
score: globalThis.Number(assertSet("RatingLeaderboardEntryV1.score", object.score)),
|
score: isSet(object.score) ? globalThis.Number(object.score) : 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -259,7 +266,7 @@ export const RatingLeaderboardEntryV1: MessageFns<RatingLeaderboardEntryV1> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseRatingLeaderboardV2(): RatingLeaderboardV2 {
|
function createBaseRatingLeaderboardV2(): RatingLeaderboardV2 {
|
||||||
return { entries: [] };
|
return { entries: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,7 +280,7 @@ export const RatingLeaderboardV2: MessageFns<RatingLeaderboardV2> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboardV2 {
|
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboardV2 {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseRatingLeaderboardV2();
|
const message = createBaseRatingLeaderboardV2();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -321,7 +328,7 @@ export const RatingLeaderboardV2: MessageFns<RatingLeaderboardV2> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseRatingLeaderboardEntryV2(): RatingLeaderboardEntryV2 {
|
function createBaseRatingLeaderboardEntryV2(): RatingLeaderboardEntryV2 {
|
||||||
return { id: 0, score: 0, battles: 0, wins: 0, survived: 0, damage: 0, kills: 0 };
|
return { id: 0, score: 0, battles: 0, wins: 0, survived: 0, damage: 0, kills: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,7 +360,7 @@ export const RatingLeaderboardEntryV2: MessageFns<RatingLeaderboardEntryV2> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboardEntryV2 {
|
decode(input: BinaryReader | Uint8Array, length?: number): RatingLeaderboardEntryV2 {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseRatingLeaderboardEntryV2();
|
const message = createBaseRatingLeaderboardEntryV2();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -425,13 +432,13 @@ export const RatingLeaderboardEntryV2: MessageFns<RatingLeaderboardEntryV2> = {
|
|||||||
|
|
||||||
fromJSON(object: any): RatingLeaderboardEntryV2 {
|
fromJSON(object: any): RatingLeaderboardEntryV2 {
|
||||||
return {
|
return {
|
||||||
id: globalThis.Number(assertSet("RatingLeaderboardEntryV2.id", object.id)),
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||||
score: globalThis.Number(assertSet("RatingLeaderboardEntryV2.score", object.score)),
|
score: isSet(object.score) ? globalThis.Number(object.score) : 0,
|
||||||
battles: globalThis.Number(assertSet("RatingLeaderboardEntryV2.battles", object.battles)),
|
battles: isSet(object.battles) ? globalThis.Number(object.battles) : 0,
|
||||||
wins: globalThis.Number(assertSet("RatingLeaderboardEntryV2.wins", object.wins)),
|
wins: isSet(object.wins) ? globalThis.Number(object.wins) : 0,
|
||||||
survived: globalThis.Number(assertSet("RatingLeaderboardEntryV2.survived", object.survived)),
|
survived: isSet(object.survived) ? globalThis.Number(object.survived) : 0,
|
||||||
damage: globalThis.Number(assertSet("RatingLeaderboardEntryV2.damage", object.damage)),
|
damage: isSet(object.damage) ? globalThis.Number(object.damage) : 0,
|
||||||
kills: globalThis.Number(assertSet("RatingLeaderboardEntryV2.kills", object.kills)),
|
kills: isSet(object.kills) ? globalThis.Number(object.kills) : 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -494,14 +501,6 @@ function isSet(value: any): boolean {
|
|||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ message Reviews {
|
|||||||
|
|
||||||
message Review {
|
message Review {
|
||||||
required float last_updated = 1;
|
required float last_updated = 1;
|
||||||
repeated Video videos = 2;
|
repeated Video videos = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Video {
|
message Video {
|
||||||
required string id = 1;
|
required string id = 1;
|
||||||
required string author = 2;
|
required string author = 2;
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/reviews.proto
|
// source: reviews.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
@@ -28,13 +28,13 @@ export interface Video {
|
|||||||
author: string;
|
author: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseReviews(): Reviews {
|
function createBaseReviews(): Reviews {
|
||||||
return { reviews: {} };
|
return { reviews: {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Reviews: MessageFns<Reviews> = {
|
export const Reviews: MessageFns<Reviews> = {
|
||||||
encode(message: Reviews, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: Reviews, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
Object.entries(message.reviews).forEach(([key, value]) => {
|
globalThis.Object.entries(message.reviews).forEach(([key, value]: [string, Review]) => {
|
||||||
Reviews_ReviewsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
Reviews_ReviewsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -42,7 +42,7 @@ export const Reviews: MessageFns<Reviews> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Reviews {
|
decode(input: BinaryReader | Uint8Array, length?: number): Reviews {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseReviews();
|
const message = createBaseReviews();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -70,10 +70,13 @@ export const Reviews: MessageFns<Reviews> = {
|
|||||||
fromJSON(object: any): Reviews {
|
fromJSON(object: any): Reviews {
|
||||||
return {
|
return {
|
||||||
reviews: isObject(object.reviews)
|
reviews: isObject(object.reviews)
|
||||||
? Object.entries(object.reviews).reduce<{ [key: number]: Review }>((acc, [key, value]) => {
|
? (globalThis.Object.entries(object.reviews) as [string, any][]).reduce(
|
||||||
acc[globalThis.Number(key)] = Review.fromJSON(value);
|
(acc: { [key: number]: Review }, [key, value]: [string, any]) => {
|
||||||
return acc;
|
acc[globalThis.Number(key)] = Review.fromJSON(value);
|
||||||
}, {})
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -81,7 +84,7 @@ export const Reviews: MessageFns<Reviews> = {
|
|||||||
toJSON(message: Reviews): unknown {
|
toJSON(message: Reviews): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.reviews) {
|
if (message.reviews) {
|
||||||
const entries = Object.entries(message.reviews);
|
const entries = globalThis.Object.entries(message.reviews) as [string, Review][];
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.reviews = {};
|
obj.reviews = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -97,23 +100,26 @@ export const Reviews: MessageFns<Reviews> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<Reviews>, I>>(object: I): Reviews {
|
fromPartial<I extends Exact<DeepPartial<Reviews>, I>>(object: I): Reviews {
|
||||||
const message = createBaseReviews();
|
const message = createBaseReviews();
|
||||||
message.reviews = Object.entries(object.reviews ?? {}).reduce<{ [key: number]: Review }>((acc, [key, value]) => {
|
message.reviews = (globalThis.Object.entries(object.reviews ?? {}) as [string, Review][]).reduce(
|
||||||
if (value !== undefined) {
|
(acc: { [key: number]: Review }, [key, value]: [string, Review]) => {
|
||||||
acc[globalThis.Number(key)] = Review.fromPartial(value);
|
if (value !== undefined) {
|
||||||
}
|
acc[globalThis.Number(key)] = Review.fromPartial(value);
|
||||||
return acc;
|
}
|
||||||
}, {});
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
);
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseReviews_ReviewsEntry(): Reviews_ReviewsEntry {
|
function createBaseReviews_ReviewsEntry(): Reviews_ReviewsEntry {
|
||||||
return { key: 0, value: createBaseReview() };
|
return { key: 0, value: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Reviews_ReviewsEntry: MessageFns<Reviews_ReviewsEntry> = {
|
export const Reviews_ReviewsEntry: MessageFns<Reviews_ReviewsEntry> = {
|
||||||
encode(message: Reviews_ReviewsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: Reviews_ReviewsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -124,7 +130,7 @@ export const Reviews_ReviewsEntry: MessageFns<Reviews_ReviewsEntry> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Reviews_ReviewsEntry {
|
decode(input: BinaryReader | Uint8Array, length?: number): Reviews_ReviewsEntry {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseReviews_ReviewsEntry();
|
const message = createBaseReviews_ReviewsEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -156,14 +162,14 @@ export const Reviews_ReviewsEntry: MessageFns<Reviews_ReviewsEntry> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Reviews_ReviewsEntry {
|
fromJSON(object: any): Reviews_ReviewsEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("Reviews_ReviewsEntry.key", object.key)),
|
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||||
value: Review.fromJSON(assertSet("Reviews_ReviewsEntry.value", object.value)),
|
value: isSet(object.value) ? Review.fromJSON(object.value) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: Reviews_ReviewsEntry): unknown {
|
toJSON(message: Reviews_ReviewsEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
obj.key = Math.round(message.key);
|
obj.key = Math.round(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -180,12 +186,12 @@ export const Reviews_ReviewsEntry: MessageFns<Reviews_ReviewsEntry> = {
|
|||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value = (object.value !== undefined && object.value !== null)
|
||||||
? Review.fromPartial(object.value)
|
? Review.fromPartial(object.value)
|
||||||
: createBaseReview();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseReview(): Review {
|
function createBaseReview(): Review {
|
||||||
return { last_updated: 0, videos: [] };
|
return { last_updated: 0, videos: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,7 +208,7 @@ export const Review: MessageFns<Review> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Review {
|
decode(input: BinaryReader | Uint8Array, length?: number): Review {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseReview();
|
const message = createBaseReview();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -234,7 +240,11 @@ export const Review: MessageFns<Review> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Review {
|
fromJSON(object: any): Review {
|
||||||
return {
|
return {
|
||||||
last_updated: globalThis.Number(assertSet("Review.last_updated", object.last_updated)),
|
last_updated: isSet(object.lastUpdated)
|
||||||
|
? globalThis.Number(object.lastUpdated)
|
||||||
|
: isSet(object.last_updated)
|
||||||
|
? globalThis.Number(object.last_updated)
|
||||||
|
: 0,
|
||||||
videos: globalThis.Array.isArray(object?.videos) ? object.videos.map((e: any) => Video.fromJSON(e)) : [],
|
videos: globalThis.Array.isArray(object?.videos) ? object.videos.map((e: any) => Video.fromJSON(e)) : [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -242,7 +252,7 @@ export const Review: MessageFns<Review> = {
|
|||||||
toJSON(message: Review): unknown {
|
toJSON(message: Review): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.last_updated !== 0) {
|
if (message.last_updated !== 0) {
|
||||||
obj.last_updated = message.last_updated;
|
obj.lastUpdated = message.last_updated;
|
||||||
}
|
}
|
||||||
if (message.videos?.length) {
|
if (message.videos?.length) {
|
||||||
obj.videos = message.videos.map((e) => Video.toJSON(e));
|
obj.videos = message.videos.map((e) => Video.toJSON(e));
|
||||||
@@ -261,7 +271,7 @@ export const Review: MessageFns<Review> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseVideo(): Video {
|
function createBaseVideo(): Video {
|
||||||
return { id: "", author: "" };
|
return { id: "", author: "" };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,7 +288,7 @@ export const Video: MessageFns<Video> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Video {
|
decode(input: BinaryReader | Uint8Array, length?: number): Video {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseVideo();
|
const message = createBaseVideo();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -310,8 +320,8 @@ export const Video: MessageFns<Video> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Video {
|
fromJSON(object: any): Video {
|
||||||
return {
|
return {
|
||||||
id: globalThis.String(assertSet("Video.id", object.id)),
|
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
||||||
author: globalThis.String(assertSet("Video.author", object.author)),
|
author: isSet(object.author) ? globalThis.String(object.author) : "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -358,14 +368,6 @@ function isSet(value: any): boolean {
|
|||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/skill_definitions.proto
|
// source: skill_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
@@ -23,13 +23,13 @@ export interface Skill {
|
|||||||
skills: string[];
|
skills: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseSkillDefinitions(): SkillDefinitions {
|
function createBaseSkillDefinitions(): SkillDefinitions {
|
||||||
return { classes: {} };
|
return { classes: {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
||||||
encode(message: SkillDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: SkillDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
Object.entries(message.classes).forEach(([key, value]) => {
|
globalThis.Object.entries(message.classes).forEach(([key, value]: [string, Skill]) => {
|
||||||
SkillDefinitions_ClassesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
SkillDefinitions_ClassesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -37,7 +37,7 @@ export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): SkillDefinitions {
|
decode(input: BinaryReader | Uint8Array, length?: number): SkillDefinitions {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseSkillDefinitions();
|
const message = createBaseSkillDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -65,10 +65,13 @@ export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
|||||||
fromJSON(object: any): SkillDefinitions {
|
fromJSON(object: any): SkillDefinitions {
|
||||||
return {
|
return {
|
||||||
classes: isObject(object.classes)
|
classes: isObject(object.classes)
|
||||||
? Object.entries(object.classes).reduce<{ [key: number]: Skill }>((acc, [key, value]) => {
|
? (globalThis.Object.entries(object.classes) as [string, any][]).reduce(
|
||||||
acc[globalThis.Number(key)] = Skill.fromJSON(value);
|
(acc: { [key: number]: Skill }, [key, value]: [string, any]) => {
|
||||||
return acc;
|
acc[globalThis.Number(key)] = Skill.fromJSON(value);
|
||||||
}, {})
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -76,7 +79,7 @@ export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
|||||||
toJSON(message: SkillDefinitions): unknown {
|
toJSON(message: SkillDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.classes) {
|
if (message.classes) {
|
||||||
const entries = Object.entries(message.classes);
|
const entries = globalThis.Object.entries(message.classes) as [string, Skill][];
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.classes = {};
|
obj.classes = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -92,23 +95,26 @@ export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<SkillDefinitions>, I>>(object: I): SkillDefinitions {
|
fromPartial<I extends Exact<DeepPartial<SkillDefinitions>, I>>(object: I): SkillDefinitions {
|
||||||
const message = createBaseSkillDefinitions();
|
const message = createBaseSkillDefinitions();
|
||||||
message.classes = Object.entries(object.classes ?? {}).reduce<{ [key: number]: Skill }>((acc, [key, value]) => {
|
message.classes = (globalThis.Object.entries(object.classes ?? {}) as [string, Skill][]).reduce(
|
||||||
if (value !== undefined) {
|
(acc: { [key: number]: Skill }, [key, value]: [string, Skill]) => {
|
||||||
acc[globalThis.Number(key)] = Skill.fromPartial(value);
|
if (value !== undefined) {
|
||||||
}
|
acc[globalThis.Number(key)] = Skill.fromPartial(value);
|
||||||
return acc;
|
}
|
||||||
}, {});
|
return acc;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
);
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseSkillDefinitions_ClassesEntry(): SkillDefinitions_ClassesEntry {
|
function createBaseSkillDefinitions_ClassesEntry(): SkillDefinitions_ClassesEntry {
|
||||||
return { key: 0, value: createBaseSkill() };
|
return { key: 0, value: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SkillDefinitions_ClassesEntry: MessageFns<SkillDefinitions_ClassesEntry> = {
|
export const SkillDefinitions_ClassesEntry: MessageFns<SkillDefinitions_ClassesEntry> = {
|
||||||
encode(message: SkillDefinitions_ClassesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: SkillDefinitions_ClassesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -119,7 +125,7 @@ export const SkillDefinitions_ClassesEntry: MessageFns<SkillDefinitions_ClassesE
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): SkillDefinitions_ClassesEntry {
|
decode(input: BinaryReader | Uint8Array, length?: number): SkillDefinitions_ClassesEntry {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseSkillDefinitions_ClassesEntry();
|
const message = createBaseSkillDefinitions_ClassesEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -151,14 +157,14 @@ export const SkillDefinitions_ClassesEntry: MessageFns<SkillDefinitions_ClassesE
|
|||||||
|
|
||||||
fromJSON(object: any): SkillDefinitions_ClassesEntry {
|
fromJSON(object: any): SkillDefinitions_ClassesEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("SkillDefinitions_ClassesEntry.key", object.key)),
|
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||||
value: Skill.fromJSON(assertSet("SkillDefinitions_ClassesEntry.value", object.value)),
|
value: isSet(object.value) ? Skill.fromJSON(object.value) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: SkillDefinitions_ClassesEntry): unknown {
|
toJSON(message: SkillDefinitions_ClassesEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
obj.key = Math.round(message.key);
|
obj.key = Math.round(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -175,14 +181,12 @@ export const SkillDefinitions_ClassesEntry: MessageFns<SkillDefinitions_ClassesE
|
|||||||
): SkillDefinitions_ClassesEntry {
|
): SkillDefinitions_ClassesEntry {
|
||||||
const message = createBaseSkillDefinitions_ClassesEntry();
|
const message = createBaseSkillDefinitions_ClassesEntry();
|
||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value = (object.value !== undefined && object.value !== null) ? Skill.fromPartial(object.value) : undefined;
|
||||||
? Skill.fromPartial(object.value)
|
|
||||||
: createBaseSkill();
|
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseSkill(): Skill {
|
function createBaseSkill(): Skill {
|
||||||
return { skills: [] };
|
return { skills: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,7 +200,7 @@ export const Skill: MessageFns<Skill> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Skill {
|
decode(input: BinaryReader | Uint8Array, length?: number): Skill {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseSkill();
|
const message = createBaseSkill();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -263,14 +267,6 @@ function isSet(value: any): boolean {
|
|||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -2,48 +2,58 @@ syntax = "proto2";
|
|||||||
|
|
||||||
package blitzkit;
|
package blitzkit;
|
||||||
|
|
||||||
import "packages/core/src/protos/i18n.proto";
|
import "i18n.proto";
|
||||||
|
|
||||||
message TankDefinitions {
|
message TankDefinitions {
|
||||||
map<uint32, TankDefinition> tanks = 1;
|
map<uint32, TankDefinition> tanks = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TankDefinition {
|
message TankDefinition {
|
||||||
required uint32 id = 1;
|
required uint32 id = 1;
|
||||||
required string slug = 2;
|
required string slug = 2;
|
||||||
map<uint32, uint32> roles = 3;
|
map<uint32, uint32> roles = 3;
|
||||||
required bool fixed_camouflage = 5;
|
required bool fixed_camouflage = 5;
|
||||||
repeated int32 camouflages = 6;
|
repeated int32 camouflages = 6;
|
||||||
repeated int32 ancestors = 7;
|
repeated int32 ancestors = 7;
|
||||||
repeated int32 successors = 8;
|
repeated int32 successors = 8;
|
||||||
repeated Crew crew = 9;
|
repeated Crew crew = 9;
|
||||||
required uint32 health = 10;
|
required uint32 health = 10;
|
||||||
required string nation = 11;
|
required string nation = 11;
|
||||||
required I18nString name = 12;
|
required I18nString name = 12;
|
||||||
required TankType type = 13;
|
required TankType type = 13;
|
||||||
required uint32 max_consumables = 14;
|
required uint32 max_consumables = 14;
|
||||||
required uint32 max_provisions = 15;
|
required uint32 max_provisions = 15;
|
||||||
required uint32 tier = 16;
|
required uint32 tier = 16;
|
||||||
required TankClass class = 17;
|
required TankClass class = 17;
|
||||||
required bool testing = 18;
|
required bool testing = 18;
|
||||||
required bool deprecated = 19;
|
required bool deprecated = 19;
|
||||||
repeated TurretDefinition turrets = 20;
|
repeated TurretDefinition turrets = 20;
|
||||||
repeated EngineDefinition engines = 21;
|
repeated EngineDefinition engines = 21;
|
||||||
repeated TrackDefinition tracks = 22;
|
repeated TrackDefinition tracks = 22;
|
||||||
required TankPrice price = 23;
|
required TankPrice price = 23;
|
||||||
optional ResearchCost research_cost = 24;
|
optional ResearchCost research_cost = 24;
|
||||||
required float speed_forwards = 25;
|
required float speed_forwards = 25;
|
||||||
required float speed_backwards = 26;
|
required float speed_backwards = 26;
|
||||||
required float camouflage_still = 27;
|
required float camouflage_still = 27;
|
||||||
required float camouflage_moving = 28;
|
required float camouflage_moving = 28;
|
||||||
required float camouflage_onFire = 29;
|
required float camouflage_on_fire = 29;
|
||||||
required string equipment_preset = 30;
|
required string equipment_preset = 30;
|
||||||
required uint32 weight = 31;
|
required uint32 weight = 31;
|
||||||
|
required string dev_name = 32;
|
||||||
|
optional Equalizer equalizer = 33;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Equalizer {
|
||||||
|
required float health = 1;
|
||||||
|
required float penetration = 2;
|
||||||
|
required float module_health = 3;
|
||||||
|
required float damage = 4;
|
||||||
|
required float armor = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ResearchCost {
|
message ResearchCost {
|
||||||
oneof research_cost_type {
|
oneof research_cost_type {
|
||||||
uint32 xp = 1;
|
uint32 xp = 1;
|
||||||
ResearchCostSeasonalTokens seasonal_tokens = 2;
|
ResearchCostSeasonalTokens seasonal_tokens = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,77 +65,77 @@ message ResearchCostSeasonalTokens {
|
|||||||
|
|
||||||
enum TankPriceType {
|
enum TankPriceType {
|
||||||
TANK_PRICE_TYPE_CREDITS = 0;
|
TANK_PRICE_TYPE_CREDITS = 0;
|
||||||
TANK_PRICE_TYPE_GOLD = 1;
|
TANK_PRICE_TYPE_GOLD = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TankPrice {
|
message TankPrice {
|
||||||
required TankPriceType type = 1;
|
required TankPriceType type = 1;
|
||||||
required uint32 value = 2;
|
required uint32 value = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TrackDefinition {
|
message TrackDefinition {
|
||||||
required uint32 id = 1;
|
required uint32 id = 1;
|
||||||
required uint32 tier = 2;
|
required uint32 tier = 2;
|
||||||
required I18nString name = 3;
|
required I18nString name = 3;
|
||||||
required uint32 weight = 4;
|
required uint32 weight = 4;
|
||||||
required float traverse_speed = 5;
|
required float traverse_speed = 5;
|
||||||
optional ResearchCost research_cost = 6;
|
optional ResearchCost research_cost = 6;
|
||||||
required float dispersion_move = 7;
|
required float dispersion_move = 7;
|
||||||
required float dispersion_traverse = 8;
|
required float dispersion_traverse = 8;
|
||||||
required float resistance_hard = 9;
|
required float resistance_hard = 9;
|
||||||
required float resistance_medium = 10;
|
required float resistance_medium = 10;
|
||||||
required float resistance_soft = 11;
|
required float resistance_soft = 11;
|
||||||
repeated Unlock unlocks = 12;
|
repeated Unlock unlocks = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
message EngineDefinition {
|
message EngineDefinition {
|
||||||
required uint32 id = 1;
|
required uint32 id = 1;
|
||||||
required I18nString name = 2;
|
required I18nString name = 2;
|
||||||
optional ResearchCost research_cost = 3;
|
optional ResearchCost research_cost = 3;
|
||||||
required uint32 tier = 4;
|
required uint32 tier = 4;
|
||||||
required float fire_chance = 5;
|
required float fire_chance = 5;
|
||||||
required uint32 power = 6;
|
required uint32 power = 6;
|
||||||
required uint32 weight = 7;
|
required uint32 weight = 7;
|
||||||
repeated Unlock unlocks = 8;
|
repeated Unlock unlocks = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TurretDefinition {
|
message TurretDefinition {
|
||||||
required uint32 id = 1;
|
required uint32 id = 1;
|
||||||
required uint32 health = 2;
|
required uint32 health = 2;
|
||||||
required uint32 view_range = 3;
|
required uint32 view_range = 3;
|
||||||
required float traverse_speed = 4;
|
required float traverse_speed = 4;
|
||||||
optional ResearchCost research_cost = 5;
|
optional ResearchCost research_cost = 5;
|
||||||
required I18nString name = 6;
|
required I18nString name = 6;
|
||||||
required uint32 tier = 7;
|
required uint32 tier = 7;
|
||||||
required uint32 weight = 8;
|
required uint32 weight = 8;
|
||||||
repeated GunDefinition guns = 9;
|
repeated GunDefinition guns = 9;
|
||||||
repeated Unlock unlocks = 10;
|
repeated Unlock unlocks = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GunDefinition {
|
message GunDefinition {
|
||||||
oneof gun_type {
|
oneof gun_type {
|
||||||
GunDefinitionRegular regular = 1;
|
GunDefinitionRegular regular = 1;
|
||||||
GunDefinitionAutoLoader auto_loader = 2;
|
GunDefinitionAutoLoader auto_loader = 2;
|
||||||
GunDefinitionAutoReloader auto_reloader = 3;
|
GunDefinitionAutoReloader auto_reloader = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
required uint32 id = 4;
|
required uint32 id = 4;
|
||||||
required float rotation_speed = 5;
|
required float rotation_speed = 5;
|
||||||
optional ResearchCost research_cost = 6;
|
optional ResearchCost research_cost = 6;
|
||||||
required uint32 weight = 7;
|
required uint32 weight = 7;
|
||||||
required I18nString name = 8;
|
required I18nString name = 8;
|
||||||
required uint32 tier = 9;
|
required uint32 tier = 9;
|
||||||
repeated ShellDefinition shells = 10;
|
repeated ShellDefinition shells = 10;
|
||||||
required float camouflage_loss = 11;
|
required float camouflage_loss = 11;
|
||||||
required float aim_time = 12;
|
required float aim_time = 12;
|
||||||
required float dispersion_base = 13;
|
required float dispersion_base = 13;
|
||||||
required float dispersion_traverse = 14;
|
required float dispersion_traverse = 14;
|
||||||
required float dispersion_shot = 15;
|
required float dispersion_shot = 15;
|
||||||
required float dispersion_damaged = 16;
|
required float dispersion_damaged = 16;
|
||||||
repeated Unlock unlocks = 17;
|
repeated Unlock unlocks = 17;
|
||||||
required uint32 shell_capacity = 18;
|
required uint32 shell_capacity = 18;
|
||||||
optional AssaultRanges assault_ranges = 19;
|
optional AssaultRanges assault_ranges = 19;
|
||||||
optional Burst burst = 20;
|
optional Burst burst = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GunDefinitionRegular {
|
message GunDefinitionRegular {
|
||||||
@@ -134,101 +144,101 @@ message GunDefinitionRegular {
|
|||||||
|
|
||||||
message GunDefinitionAutoLoader {
|
message GunDefinitionAutoLoader {
|
||||||
required float clip_reload = 1;
|
required float clip_reload = 1;
|
||||||
required float intra_clip = 2;
|
required float intra_clip = 2;
|
||||||
required float shell_count = 3;
|
required float shell_count = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Burst {
|
message Burst {
|
||||||
required uint32 count = 1;
|
required uint32 count = 1;
|
||||||
required float interval = 2;
|
required float interval = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GunDefinitionAutoReloader {
|
message GunDefinitionAutoReloader {
|
||||||
repeated float shell_reloads = 1;
|
repeated float shell_reloads = 1;
|
||||||
required float intra_clip = 2;
|
required float intra_clip = 2;
|
||||||
required float shell_count = 3;
|
required float shell_count = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AssaultRanges {
|
message AssaultRanges {
|
||||||
repeated AssaultRange ranges = 1;
|
repeated AssaultRange ranges = 1;
|
||||||
repeated ShellType types = 2;
|
repeated ShellType types = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AssaultRange {
|
message AssaultRange {
|
||||||
required float distance = 1;
|
required float distance = 1;
|
||||||
required float factor = 2;
|
required float factor = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ShellDefinition {
|
message ShellDefinition {
|
||||||
required uint32 id = 1;
|
required uint32 id = 1;
|
||||||
required I18nString name = 2;
|
required I18nString name = 2;
|
||||||
required uint32 velocity = 3;
|
required uint32 velocity = 3;
|
||||||
required uint32 armor_damage = 4;
|
required uint32 armor_damage = 4;
|
||||||
required uint32 module_damage = 5;
|
required uint32 module_damage = 5;
|
||||||
required float caliber = 6;
|
required float caliber = 6;
|
||||||
required string icon = 7;
|
required string icon = 7;
|
||||||
required ShellPenetration penetration = 8;
|
required ShellPenetration penetration = 8;
|
||||||
required ShellType type = 9;
|
required ShellType type = 9;
|
||||||
optional float normalization = 10;
|
optional float normalization = 10;
|
||||||
optional float ricochet = 11;
|
optional float ricochet = 11;
|
||||||
optional float explosion_radius = 12;
|
optional float explosion_radius = 12;
|
||||||
required uint32 range = 13;
|
required uint32 range = 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ShellType {
|
enum ShellType {
|
||||||
SHELL_TYPE_AP = 0;
|
SHELL_TYPE_AP = 0;
|
||||||
SHELL_TYPE_APCR = 1;
|
SHELL_TYPE_APCR = 1;
|
||||||
SHELL_TYPE_HEAT = 2;
|
SHELL_TYPE_HEAT = 2;
|
||||||
SHELL_TYPE_HE = 3;
|
SHELL_TYPE_HE = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ShellPenetration {
|
message ShellPenetration {
|
||||||
required float near = 1;
|
required float near = 1;
|
||||||
required float far = 2;
|
required float far = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Unlock {
|
message Unlock {
|
||||||
required int32 id = 1;
|
required int32 id = 1;
|
||||||
required ModuleType type = 2;
|
required ModuleType type = 2;
|
||||||
required UnlockCost cost = 3;
|
required UnlockCost cost = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message UnlockCost {
|
message UnlockCost {
|
||||||
required string type = 1;
|
required string type = 1;
|
||||||
required int32 value = 2;
|
required int32 value = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ModuleType {
|
enum ModuleType {
|
||||||
MODULE_TYPE_VEHICLE = 0;
|
MODULE_TYPE_VEHICLE = 0;
|
||||||
MODULE_TYPE_ENGINE = 1;
|
MODULE_TYPE_ENGINE = 1;
|
||||||
MODULE_TYPE_TRACKS = 2;
|
MODULE_TYPE_TRACKS = 2;
|
||||||
MODULE_TYPE_TURRET = 3;
|
MODULE_TYPE_TURRET = 3;
|
||||||
MODULE_TYPE_GUN = 4;
|
MODULE_TYPE_GUN = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TankClass {
|
enum TankClass {
|
||||||
TANK_CLASS_LIGHT = 0;
|
TANK_CLASS_LIGHT = 0;
|
||||||
TANK_CLASS_MEDIUM = 1;
|
TANK_CLASS_MEDIUM = 1;
|
||||||
TANK_CLASS_HEAVY = 2;
|
TANK_CLASS_HEAVY = 2;
|
||||||
TANK_CLASS_TANK_DESTROYER = 3;
|
TANK_CLASS_TANK_DESTROYER = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TankType {
|
enum TankType {
|
||||||
TANK_TYPE_RESEARCHABLE = 0;
|
TANK_TYPE_RESEARCHABLE = 0;
|
||||||
TANK_TYPE_PREMIUM = 1;
|
TANK_TYPE_PREMIUM = 1;
|
||||||
TANK_TYPE_COLLECTOR = 2;
|
TANK_TYPE_COLLECTOR = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Crew {
|
message Crew {
|
||||||
required CrewType type = 1;
|
required CrewType type = 1;
|
||||||
required uint32 count = 2;
|
required uint32 count = 2;
|
||||||
repeated CrewType substitute = 3;
|
repeated CrewType substitute = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum CrewType {
|
enum CrewType {
|
||||||
CREW_TYPE_COMMANDER = 0;
|
CREW_TYPE_COMMANDER = 0;
|
||||||
CREW_TYPE_RADIOMAN = 1;
|
CREW_TYPE_RADIOMAN = 1;
|
||||||
CREW_TYPE_GUNNER = 2;
|
CREW_TYPE_GUNNER = 2;
|
||||||
CREW_TYPE_DRIVER = 3;
|
CREW_TYPE_DRIVER = 3;
|
||||||
CREW_TYPE_LOADER = 4;
|
CREW_TYPE_LOADER = 4;
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,3 @@
|
|||||||
|
export function bufferToBigInt(buffer: ArrayBuffer) {
|
||||||
|
return new DataView(buffer).getBigUint64(0, true);
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
export * from './buffer';
|
export * from './buffer';
|
||||||
|
export * from './bufferToBigInt';
|
||||||
export * from './dds';
|
export * from './dds';
|
||||||
export * from './dids';
|
export * from './dids';
|
||||||
export * from './pvr';
|
export * from './pvr';
|
||||||
@@ -7,3 +8,4 @@ export * from './sc2';
|
|||||||
export * from './scg';
|
export * from './scg';
|
||||||
export * from './scpg';
|
export * from './scpg';
|
||||||
export * from './windows';
|
export * from './windows';
|
||||||
|
|
||||||
Submodule
+1
Submodule packages/cue4parse added at b8c9dab500.
@@ -0,0 +1,3 @@
|
|||||||
|
[*.cs]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
## A streamlined .gitignore for modern .NET projects
|
||||||
|
## including temporary files, build results, and
|
||||||
|
## files generated by popular .NET tools. If you are
|
||||||
|
## developing with Visual Studio, the VS .gitignore
|
||||||
|
## https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
|
||||||
|
## has more thorough IDE-specific entries.
|
||||||
|
##
|
||||||
|
## Get latest from https://github.com/github/gitignore/blob/main/Dotnet.gitignore
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
[Dd]ebug/
|
||||||
|
[Dd]ebugPublic/
|
||||||
|
[Rr]elease/
|
||||||
|
[Rr]eleases/
|
||||||
|
x64/
|
||||||
|
x86/
|
||||||
|
[Ww][Ii][Nn]32/
|
||||||
|
[Aa][Rr][Mm]/
|
||||||
|
[Aa][Rr][Mm]64/
|
||||||
|
bld/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
[Ll]og/
|
||||||
|
[Ll]ogs/
|
||||||
|
|
||||||
|
# .NET Core
|
||||||
|
project.lock.json
|
||||||
|
project.fragment.lock.json
|
||||||
|
artifacts/
|
||||||
|
|
||||||
|
# ASP.NET Scaffolding
|
||||||
|
ScaffoldingReadMe.txt
|
||||||
|
|
||||||
|
# NuGet Packages
|
||||||
|
*.nupkg
|
||||||
|
# NuGet Symbol Packages
|
||||||
|
*.snupkg
|
||||||
|
|
||||||
|
# dotenv environment variables file
|
||||||
|
.env
|
||||||
|
|
||||||
|
# Others
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
CodeCoverage/
|
||||||
|
|
||||||
|
# MSBuild Binary and Structured Log
|
||||||
|
*.binlog
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
# NUnit
|
||||||
|
*.VisualState.xml
|
||||||
|
TestResult.xml
|
||||||
|
nunit-*.xml
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
using System.IO;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using BlitzKit.Game.Models;
|
||||||
|
using CUE4Parse_Conversion.Textures;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports.Texture;
|
||||||
|
using CUE4Parse.UE4.Objects.Engine;
|
||||||
|
using CUE4Parse.UE4.Objects.UObject;
|
||||||
|
using Microsoft.JavaScript.NodeApi;
|
||||||
|
using SkiaSharp;
|
||||||
|
|
||||||
|
namespace BlitzKit.Game.JSExport;
|
||||||
|
|
||||||
|
[JSExport]
|
||||||
|
public partial class GameInterface
|
||||||
|
{
|
||||||
|
private readonly BlitzFileProvider provider;
|
||||||
|
|
||||||
|
public string[] files;
|
||||||
|
public string[] tanksDirectoryNations;
|
||||||
|
|
||||||
|
public GameInterface(string directory)
|
||||||
|
{
|
||||||
|
provider = new(directory);
|
||||||
|
|
||||||
|
files = [.. provider.Files.Keys];
|
||||||
|
|
||||||
|
var tanksBase = "Blitz/Content/Tanks/";
|
||||||
|
tanksDirectoryNations =
|
||||||
|
[
|
||||||
|
.. files
|
||||||
|
.Where(path => path.StartsWith(tanksBase))
|
||||||
|
.Select(path => path[tanksBase.Length..])
|
||||||
|
.Select(path => path.Split('/')[0])
|
||||||
|
.Where(nation => !nation.EndsWith(".uasset") && nation != "TankStub")
|
||||||
|
.Distinct(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public string[] Files => files;
|
||||||
|
public string[] TanksDirectoryNations => tanksDirectoryNations;
|
||||||
|
|
||||||
|
public byte[] TankBigIcon(string tankId, string pdaName)
|
||||||
|
{
|
||||||
|
foreach (var nation in tanksDirectoryNations)
|
||||||
|
{
|
||||||
|
var path = $"Blitz/Content/Tanks/{nation}/{tankId}/{pdaName}.{pdaName}";
|
||||||
|
|
||||||
|
if (provider.TryLoadPackageObject<UPrimaryDataAsset>(path, out var pda))
|
||||||
|
{
|
||||||
|
FSoftObjectPath objectPath = pda.Get<FSoftObjectPath>("BigIcon");
|
||||||
|
UTexture2D uTexture = objectPath.Load<UTexture2D>();
|
||||||
|
CTexture? cTexture = uTexture.Decode(ETexturePlatform.DesktopMobile);
|
||||||
|
|
||||||
|
if (cTexture is null)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
SKBitmap bitmap = cTexture.ToSkBitmap();
|
||||||
|
SKData data = bitmap.Encode(SKEncodedImageFormat.Webp, 80);
|
||||||
|
byte[] bytes = data.ToArray();
|
||||||
|
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedRegex(@"T_UI_Flag_(\w+)_S")]
|
||||||
|
private static partial Regex FlagNameRegex();
|
||||||
|
|
||||||
|
public byte[] Flag(string nation)
|
||||||
|
{
|
||||||
|
var flagsBase = "Blitz/Content/UI/Textures/Flag/TankCard/";
|
||||||
|
|
||||||
|
foreach (var path in provider.Files.Keys)
|
||||||
|
{
|
||||||
|
if (!path.StartsWith(flagsBase))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var fileName = Path.GetFileNameWithoutExtension(path);
|
||||||
|
var match = FlagNameRegex().Match(fileName);
|
||||||
|
|
||||||
|
if (
|
||||||
|
match.Success
|
||||||
|
&& match.Groups[1].Value.Equals(nation, StringComparison.CurrentCultureIgnoreCase)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (provider.TryLoadPackageObject<UTexture2D>($"{path}.{fileName}", out var uTexture))
|
||||||
|
{
|
||||||
|
CTexture? cTexture = uTexture.Decode(ETexturePlatform.DesktopMobile);
|
||||||
|
|
||||||
|
if (cTexture is null)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
SKBitmap bitmap = cTexture.ToSkBitmap();
|
||||||
|
SKData data = bitmap.Encode(SKEncodedImageFormat.Webp, 80);
|
||||||
|
byte[] bytes = data.ToArray();
|
||||||
|
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using CUE4Parse.Compression;
|
||||||
|
using CUE4Parse.FileProvider;
|
||||||
|
using CUE4Parse.MappingsProvider;
|
||||||
|
using CUE4Parse.UE4.Versions;
|
||||||
|
|
||||||
|
namespace BlitzKit.Game.Models;
|
||||||
|
|
||||||
|
public class BlitzFileProvider : DefaultFileProvider
|
||||||
|
{
|
||||||
|
public BlitzFileProvider(string directory)
|
||||||
|
: base(
|
||||||
|
directory: directory,
|
||||||
|
searchOption: SearchOption.AllDirectories,
|
||||||
|
versions: new(EGame.GAME_UE5_5),
|
||||||
|
pathComparer: StringComparer.OrdinalIgnoreCase
|
||||||
|
)
|
||||||
|
{
|
||||||
|
MappingsContainer = new FileUsmapTypeMappingsProvider("../../packages/closed/blitz.usmap");
|
||||||
|
|
||||||
|
Initialize();
|
||||||
|
Mount();
|
||||||
|
|
||||||
|
// OodleHelper.DownloadOodleDll($"../../temp/oodle.so");
|
||||||
|
OodleHelper.Initialize($"../../temp/oodle.so");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<RootNamespace>BlitzKit.Game</RootNamespace>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<!-- <RuntimeIdentifier>win-x64</RuntimeIdentifier> -->
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<NodeApiAssemblyJSModuleType>esm</NodeApiAssemblyJSModuleType>
|
||||||
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="../cue4parse/CUE4Parse/CUE4Parse.csproj" />
|
||||||
|
<ProjectReference Include="../cue4parse/CUE4Parse-Conversion/CUE4Parse-Conversion.csproj" />
|
||||||
|
<PackageReference Include="Microsoft.JavaScript.NodeApi" Version="0.9.19" />
|
||||||
|
<PackageReference Include="Microsoft.JavaScript.NodeApi.Generator" Version="0.9.19" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<Solution>
|
||||||
|
<Project Path="game.csproj" />
|
||||||
|
</Solution>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "@blitzkit/game",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"main": "src/index.ts",
|
||||||
|
"scripts": {
|
||||||
|
"build": "dotnet build"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"node-api-dotnet": "^0.9.19"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from "../bin/Debug/net9.0/game";
|
||||||
@@ -1,4 +1,2 @@
|
|||||||
export * from "./literals";
|
export * from "./literals";
|
||||||
export * from "./strings";
|
export * from "./strings";
|
||||||
export * from "./unwrapper";
|
|
||||||
export * from "./wrapper";
|
|
||||||
@@ -1,16 +1,45 @@
|
|||||||
export function literals(
|
export function literals(
|
||||||
string: string,
|
string: string,
|
||||||
literals?: Record<string, string | number | undefined>
|
literals?: Record<string, string | number | undefined>,
|
||||||
) {
|
) {
|
||||||
for (const key in literals) {
|
for (const key in literals) {
|
||||||
const mutated = string.replaceAll(`{${key}}`, `${literals[key]}`);
|
string = string.replaceAll(`{${key}}`, `${literals[key]}`);
|
||||||
|
|
||||||
if (import.meta.env.DEV && mutated === string) {
|
|
||||||
console.warn(`Could not find literal {${key}} in string "${string}"`);
|
|
||||||
}
|
|
||||||
|
|
||||||
string = mutated;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function literalsArray<Type, Literal = Type | string>(
|
||||||
|
string: string,
|
||||||
|
literals?: Record<string, Literal>,
|
||||||
|
) {
|
||||||
|
if (!literals) return [string];
|
||||||
|
|
||||||
|
let array: (string | Literal)[] = [string];
|
||||||
|
|
||||||
|
for (const key in literals) {
|
||||||
|
const value = literals[key];
|
||||||
|
const next: (string | Literal)[] = [];
|
||||||
|
|
||||||
|
for (const chunk of array) {
|
||||||
|
if (typeof chunk !== "string") {
|
||||||
|
next.push(chunk);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const parts = chunk.split(`{${key}}`);
|
||||||
|
|
||||||
|
for (let index = 0; index < parts.length; index++) {
|
||||||
|
if (parts[index]) next.push(parts[index]);
|
||||||
|
|
||||||
|
if (index < parts.length - 1) {
|
||||||
|
next.push(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
array = next;
|
||||||
|
}
|
||||||
|
|
||||||
|
return array;
|
||||||
|
}
|
||||||
@@ -1,68 +1,3 @@
|
|||||||
import { merge } from "ts-deepmerge";
|
import type en from "../strings/en.json";
|
||||||
import locales from "../locales.json";
|
|
||||||
import en from "../strings/en.json";
|
|
||||||
import es from "../strings/es.json";
|
|
||||||
import fr from "../strings/fr.json";
|
|
||||||
import ja from "../strings/ja.json";
|
|
||||||
import pl from "../strings/pl.json";
|
|
||||||
import pt from "../strings/pt.json";
|
|
||||||
import ru from "../strings/ru.json";
|
|
||||||
import uk from "../strings/uk.json";
|
|
||||||
import zh from "../strings/zh.json";
|
|
||||||
|
|
||||||
export type BlitzKitStrings = typeof en;
|
export type Strings = typeof en;
|
||||||
|
|
||||||
const stringsRaw: Record<string, TranslationTree> = {
|
|
||||||
en,
|
|
||||||
es,
|
|
||||||
fr,
|
|
||||||
ja,
|
|
||||||
pl,
|
|
||||||
pt,
|
|
||||||
ru,
|
|
||||||
uk,
|
|
||||||
zh,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const STRINGS: Record<string, BlitzKitStrings> = {};
|
|
||||||
|
|
||||||
for (const locale in stringsRaw) {
|
|
||||||
if (locale === locales.default) {
|
|
||||||
STRINGS[locales.default] = stringsRaw[locales.default] as BlitzKitStrings;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const localeStrings = stringsRaw[locale];
|
|
||||||
STRINGS[locale] = merge(
|
|
||||||
stringsRaw[locales.default],
|
|
||||||
localeStrings,
|
|
||||||
) as BlitzKitStrings;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const SUPPORTED_LOCALE_BLITZ_MAP: Record<string, string> = {
|
|
||||||
en: "en",
|
|
||||||
es: "es",
|
|
||||||
fr: "fr",
|
|
||||||
ja: "ja",
|
|
||||||
pt: "pt",
|
|
||||||
ru: "ru",
|
|
||||||
uk: "uk",
|
|
||||||
zh: "zh-Hans",
|
|
||||||
pl: "pl",
|
|
||||||
};
|
|
||||||
|
|
||||||
export const SUPPORTED_LOCALE_FLAGS: Record<string, string> = {
|
|
||||||
en: "🇺🇸",
|
|
||||||
es: "🇪🇸",
|
|
||||||
fr: "🇫🇷",
|
|
||||||
ja: "🇯🇵",
|
|
||||||
pt: "🇵🇹",
|
|
||||||
ru: "🇷🇺",
|
|
||||||
uk: "🇺🇦",
|
|
||||||
zh: "🇨🇳",
|
|
||||||
pl: "🇵🇱",
|
|
||||||
};
|
|
||||||
|
|
||||||
export type TranslationTree = { [key: string]: TranslationNode };
|
|
||||||
|
|
||||||
export type TranslationNode = string | TranslationTree;
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { I18nString } from "../../core/src";
|
|
||||||
import locales from "../locales.json";
|
|
||||||
|
|
||||||
export function unwrapper(locale = locales.default) {
|
|
||||||
return function (i18nString: I18nString) {
|
|
||||||
if (locale in i18nString.locales) {
|
|
||||||
return i18nString.locales[locale];
|
|
||||||
}
|
|
||||||
|
|
||||||
return i18nString.locales[locales.default];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import locales from "../locales.json";
|
|
||||||
import { type BlitzKitStrings, STRINGS } from "./strings";
|
|
||||||
|
|
||||||
export function wrapper(slicer: (strings: BlitzKitStrings) => string) {
|
|
||||||
const defaultString = slicer(STRINGS[locales.default] as BlitzKitStrings);
|
|
||||||
|
|
||||||
const object = { [locales.default]: defaultString };
|
|
||||||
|
|
||||||
for (const { locale } of locales.supported) {
|
|
||||||
const string = slicer(STRINGS[locale] as BlitzKitStrings);
|
|
||||||
if (string !== defaultString) object[locale] = string;
|
|
||||||
}
|
|
||||||
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
+185
-1509
File diff suppressed because it is too large.
Load diff
Loaded 100 of 432 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user