mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-25 19:49:50 +01:00
Compare commits
612
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e72ea567f | ||
|
|
f801e81c8b | ||
|
|
b572ac5ea8 | ||
|
|
7e2fba35d0 | ||
|
|
e6fa17a911 | ||
|
|
a7d5bd6c75 | ||
|
|
d424679257 | ||
|
|
4248e19f68 | ||
|
|
59ef527967 | ||
|
|
39aeba0766 | ||
|
|
a0e1d8cee0 | ||
|
|
c6f8c1e6a5 | ||
|
|
333c310d5b | ||
|
|
c6c0e02fea | ||
|
|
028f4230e5 | ||
|
|
cf31ad8f7a | ||
|
|
9418526897 | ||
|
|
dacdc9ae53 | ||
|
|
30296d020b | ||
|
|
43b7b4159f | ||
|
|
1aeae3b93b | ||
|
|
d657cd2360 | ||
|
|
222746be26 | ||
|
|
95dd73de52 | ||
|
|
c893fa0a03 | ||
|
|
c0e7f2f00a | ||
|
|
4dce8046cb | ||
|
|
7df2425f76 | ||
|
|
e3cf2d51cc | ||
|
|
91ac93670f | ||
|
|
8a9b02e584 | ||
|
|
c16ccc4b4c | ||
|
|
5dc11473bb | ||
|
|
2213f7d032 | ||
|
|
9d12c936b4 | ||
|
|
3f54e467d8 | ||
|
|
3dd0c4916d | ||
|
|
d2ee528c52 | ||
|
|
0531fbf3ef | ||
|
|
415aab3824 | ||
|
|
f16e508e59 | ||
|
|
3299ce069e | ||
|
|
6395dd3f3d | ||
|
|
9536cd2d39 | ||
|
|
61abddc41b | ||
|
|
b23f88b8a5 | ||
|
|
007ad3be15 | ||
|
|
218684b85c | ||
|
|
2e17ed16ed | ||
|
|
173c476fb4 | ||
|
|
e12ba1e78f | ||
|
|
648344d7cc | ||
|
|
3e0130a200 | ||
|
|
fc0f77a459 | ||
|
|
9ba6d3ca56 | ||
|
|
ba017936fb | ||
|
|
ac47f11460 | ||
|
|
507e6fe7f9 | ||
|
|
965acadc3f | ||
|
|
14a2658a83 | ||
|
|
5cbe08fe1c | ||
|
|
05dd4dbd98 | ||
|
|
a348e005f7 | ||
|
|
62b629fe3a | ||
|
|
f790d07ed6 | ||
|
|
c86b269cf2 | ||
|
|
a878a7a143 | ||
|
|
76fc900a15 | ||
|
|
667d8c8f7c | ||
|
|
9cc94635a8 | ||
|
|
39ffc6ae51 | ||
|
|
4b0035345e | ||
|
|
ef7e002e8c | ||
|
|
81e17317be | ||
|
|
333866a9d6 | ||
|
|
152e0a6680 | ||
|
|
417b717b63 | ||
|
|
c134131127 | ||
|
|
516df13f62 | ||
|
|
0c8bb4be21 | ||
|
|
1f204918a5 | ||
|
|
0507f63177 | ||
|
|
0f84ae45b6 | ||
|
|
ff16a26bd8 | ||
|
|
85ddedd481 | ||
|
|
125f6c721d | ||
|
|
4bad35239b | ||
|
|
ff7716ce6c | ||
|
|
231e4aad0e | ||
|
|
632989087c | ||
|
|
bb0b932d26 | ||
|
|
3714c74394 | ||
|
|
168e85d838 | ||
|
|
666f44d9e6 | ||
|
|
595db8709b | ||
|
|
18a6f30a4b | ||
|
|
9b8d4c4e3c | ||
|
|
73de6e3521 | ||
|
|
6aa14d2faf | ||
|
|
477b9a9630 | ||
|
|
b297babde5 | ||
|
|
c854e8f7cb | ||
|
|
06832e156f | ||
|
|
22b77398ad | ||
|
|
665d5c0f2d | ||
|
|
d9b22431fa | ||
|
|
0a186399b6 | ||
|
|
d2b4cc3e7d | ||
|
|
885c260605 | ||
|
|
f8a71feb46 | ||
|
|
0cb4aadec3 | ||
|
|
f58d06b3c3 | ||
|
|
2c44bd8374 | ||
|
|
699b445f79 | ||
|
|
26bb350709 | ||
|
|
6fb51e703d | ||
|
|
7a7c73d77b | ||
|
|
f945786e2f | ||
|
|
c678830fd2 | ||
|
|
006b2fef78 | ||
|
|
26a0c1f176 | ||
|
|
403d1e7849 | ||
|
|
c9d8f6b445 | ||
|
|
73c53d6ef5 | ||
|
|
f8e8fd4016 | ||
|
|
15b29f439a | ||
|
|
fd96cd5975 | ||
|
|
66b9a9076f | ||
|
|
746c7963de | ||
|
|
ae96ae34c0 | ||
|
|
1f690d11c7 | ||
|
|
8cf3da12fa | ||
|
|
a8ae806f8b | ||
|
|
8a6841adea | ||
|
|
5e88f5a73d | ||
|
|
aa1f357538 | ||
|
|
a9a870c3e6 | ||
|
|
ca270e2010 | ||
|
|
17264c1adc | ||
|
|
2627aba938 | ||
|
|
a2574efb9c | ||
|
|
d3ab4bac51 | ||
|
|
ad78e45f1b | ||
|
|
5ea7bbd6a1 | ||
|
|
2b955a281b | ||
|
|
676601b06e | ||
|
|
b81d9985ee | ||
|
|
d66d25a261 | ||
|
|
402d054b30 | ||
|
|
61d6d42742 | ||
|
|
03e06b050e | ||
|
|
cca46957bc | ||
|
|
3c92ab3a19 | ||
|
|
6c31f663f6 | ||
|
|
bd140f0eda | ||
|
|
a3d8fcb960 | ||
|
|
06304cf075 | ||
|
|
416d061df1 | ||
|
|
47c87970cd | ||
|
|
ff3ed9d656 | ||
|
|
4e9c3df5eb | ||
|
|
c100a1e655 | ||
|
|
26cc0cc723 | ||
|
|
f697f94bd5 | ||
|
|
30fa18f0fd | ||
|
|
c45af8e156 | ||
|
|
f95a6e3495 | ||
|
|
0e637d772e | ||
|
|
a834d48a38 | ||
|
|
f550386fd9 | ||
|
|
0a4b81cde4 | ||
|
|
e1cc60ea5e | ||
|
|
a40860901b | ||
|
|
f3e96718eb | ||
|
|
a00411919d | ||
|
|
b298874f0d | ||
|
|
7011d4d20f | ||
|
|
d9ce16b41a | ||
|
|
f0e0d849d5 | ||
|
|
3d061a78de | ||
|
|
a188a01244 | ||
|
|
0828722876 | ||
|
|
0ccd9e45d8 | ||
|
|
2f745a16d1 | ||
|
|
100c7391fb | ||
|
|
4f42a31f53 | ||
|
|
6d2573ee95 | ||
|
|
0b2e322112 | ||
|
|
4c77cc2282 | ||
|
|
32f6916266 | ||
|
|
3a91e082d5 | ||
|
|
042a1afa74 | ||
|
|
2184c1c703 | ||
|
|
3edf4a25be | ||
|
|
95ad6bade7 | ||
|
|
8bda4a5331 | ||
|
|
16c77f587a | ||
|
|
a218c791a9 | ||
|
|
dccdf55bfc | ||
|
|
1ba6e70c56 | ||
|
|
0e76184813 | ||
|
|
c674da29d5 | ||
|
|
ba4e6dfd68 | ||
|
|
43237c2aee | ||
|
|
980fd6e50e | ||
|
|
2fffdc3ef5 | ||
|
|
44e7cd7505 | ||
|
|
76e748f0ed | ||
|
|
3a60535564 | ||
|
|
9abfeb749c | ||
|
|
0442c789f1 | ||
|
|
c353119962 | ||
|
|
76dc9f0742 | ||
|
|
ff56f1441e | ||
|
|
e3db886923 | ||
|
|
249f62759e | ||
|
|
7767481633 | ||
|
|
a97b1383d8 | ||
|
|
1b224b3949 | ||
|
|
018aa33a7f | ||
|
|
4b7b8b3392 | ||
|
|
5fa4d3b242 | ||
|
|
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 | ||
|
|
068e0e26b0 | ||
|
|
f6ca77f8c8 | ||
|
|
4c7eda81ca | ||
|
|
3948af9e39 | ||
|
|
aec30e1944 | ||
|
|
4205b16769 | ||
|
|
4d13803b0c | ||
|
|
b950ac1318 | ||
|
|
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 | ||
|
|
bf61cb17de | ||
|
|
c8ba6b1eca | ||
|
|
1d8c823703 | ||
|
|
3594c9a971 | ||
|
|
f478a08bd9 | ||
|
|
115fa5acad | ||
|
|
c24a2989fa | ||
|
|
a6cfb522b3 | ||
|
|
12e645f6e2 | ||
|
|
ccb86ae824 | ||
|
|
9a3f64fcd6 | ||
|
|
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
@@ -0,0 +1 @@
|
|||||||
|
indentSize: 2
|
||||||
@@ -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
|
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
name: Website
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
# blitz
|
||||||
|
WOTB_SERVER: ${{ secrets.WOTB_SERVER }}
|
||||||
|
WOTB_VERSION: ${{ secrets.WOTB_VERSION }}
|
||||||
|
PUBLIC_WOTB_CLIENT: ../../temp/game
|
||||||
|
WOTB_USMAP: ../closed/blitz.usmap
|
||||||
|
|
||||||
|
# google
|
||||||
|
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
||||||
|
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
||||||
|
|
||||||
|
# steam
|
||||||
|
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
|
||||||
|
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
|
||||||
|
STEAM_APP: 3341250
|
||||||
|
STEAM_OS: windows
|
||||||
|
STEAM_FINGERPRINT: Manifest_UFSFiles_Win64.txt
|
||||||
|
|
||||||
|
# debug
|
||||||
|
DOTNET_EnableDiagnostics: 1
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build chunk ${{ matrix.chunk }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
chunk: [pages, api, media, models, textures]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Free disk space
|
||||||
|
uses: jlumbroso/free-disk-space@main
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
token: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up Bun
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
|
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: latest
|
||||||
|
|
||||||
|
- name: Set up Dotnet
|
||||||
|
uses: actions/setup-dotnet@v5
|
||||||
|
with:
|
||||||
|
dotnet-version: 9.0.x
|
||||||
|
|
||||||
|
- name: Set up Protoc
|
||||||
|
uses: arduino/setup-protoc@v3
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up project
|
||||||
|
run: |
|
||||||
|
bun run setup
|
||||||
|
./scripts/setup_depot_downloader.sh
|
||||||
|
|
||||||
|
- name: Download Steam game
|
||||||
|
run: scripts/download_game.sh
|
||||||
|
|
||||||
|
- name: Enable core dumps
|
||||||
|
run: |
|
||||||
|
ulimit -c unlimited
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: bun run build-website
|
||||||
|
env:
|
||||||
|
BUILD_CHUNK: ${{ matrix.chunk }}
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-pages-artifact@v5
|
||||||
|
with:
|
||||||
|
name: chunk-${{ matrix.chunk }}
|
||||||
|
path: ${{ matrix.chunk == 'pages' && 'dist/website' || format('dist/website/{0}', matrix.chunk) }}
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
name: Website
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
- cron: "0 4 * * *"
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pages: write
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
|
|
||||||
env:
|
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
|
||||||
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:
|
|
||||||
build:
|
|
||||||
name: Build website
|
|
||||||
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 }}
|
|
||||||
- uses: actions/configure-pages@v5
|
|
||||||
- run: bun run setup
|
|
||||||
|
|
||||||
- name: Build website
|
|
||||||
run: bun run build:website
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-pages-artifact@v4
|
|
||||||
with:
|
|
||||||
path: dist/website
|
|
||||||
|
|
||||||
deploy-github-pages:
|
|
||||||
if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
name: Deploy to GitHub Pages
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: build
|
|
||||||
environment:
|
|
||||||
name: Production
|
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
id: deployment
|
|
||||||
uses: actions/deploy-pages@v4
|
|
||||||
+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/tresabhi/CUE4Parse.git
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"tabWidth": 2
|
||||||
|
}
|
||||||
Vendored
-4
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"recommendations": ["astro-build.astro-vscode"],
|
|
||||||
"unwantedRecommendations": []
|
|
||||||
}
|
|
||||||
Vendored
-11
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"command": "./node_modules/.bin/astro dev",
|
|
||||||
"name": "Development server",
|
|
||||||
"request": "launch",
|
|
||||||
"type": "node-terminal"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Vendored
-256
@@ -1,256 +0,0 @@
|
|||||||
{
|
|
||||||
"cSpell.words": [
|
|
||||||
"AABBOX",
|
|
||||||
"Abhi",
|
|
||||||
"absarc",
|
|
||||||
"accountinfo",
|
|
||||||
"adsense",
|
|
||||||
"aeson",
|
|
||||||
"alphatest",
|
|
||||||
"analyticsdata",
|
|
||||||
"analyticsreporting",
|
|
||||||
"APAC",
|
|
||||||
"apcr",
|
|
||||||
"appinfo",
|
|
||||||
"applypatches",
|
|
||||||
"artefacts",
|
|
||||||
"astrojs",
|
|
||||||
"astrolib",
|
|
||||||
"atgm",
|
|
||||||
"Autoloader",
|
|
||||||
"Autoreloader",
|
|
||||||
"AYUV",
|
|
||||||
"battleresults",
|
|
||||||
"bbox",
|
|
||||||
"beforeinstallprompt",
|
|
||||||
"bepaint",
|
|
||||||
"betakrieg",
|
|
||||||
"BINORMAL",
|
|
||||||
"Binormals",
|
|
||||||
"bkni",
|
|
||||||
"BKRL",
|
|
||||||
"BKRTS",
|
|
||||||
"BKRTSMANIFEST",
|
|
||||||
"bkwd",
|
|
||||||
"blitzkit",
|
|
||||||
"blitzrinth",
|
|
||||||
"blitzstars",
|
|
||||||
"bufbuild",
|
|
||||||
"cacheable",
|
|
||||||
"Callouts",
|
|
||||||
"Camo",
|
|
||||||
"Carro",
|
|
||||||
"CCPAOPTOUT",
|
|
||||||
"CDON",
|
|
||||||
"clanid",
|
|
||||||
"classname",
|
|
||||||
"cleandist",
|
|
||||||
"closedkrieg",
|
|
||||||
"cockroackdb",
|
|
||||||
"Coef",
|
|
||||||
"Combattimento",
|
|
||||||
"cooldown",
|
|
||||||
"corelations",
|
|
||||||
"corsproxy",
|
|
||||||
"CUBEMAP",
|
|
||||||
"CUBETEXCOORD",
|
|
||||||
"customperiod",
|
|
||||||
"datasource",
|
|
||||||
"Dava",
|
|
||||||
"dbid",
|
|
||||||
"Ddpf",
|
|
||||||
"Ddsd",
|
|
||||||
"deadrail",
|
|
||||||
"debugflags",
|
|
||||||
"deburr",
|
|
||||||
"decalmask",
|
|
||||||
"decompressor",
|
|
||||||
"décor",
|
|
||||||
"dedup",
|
|
||||||
"defence",
|
|
||||||
"degressive",
|
|
||||||
"depotdownloader",
|
|
||||||
"devkrieg",
|
|
||||||
"diacriticless",
|
|
||||||
"DIDS",
|
|
||||||
"donotremove",
|
|
||||||
"drei",
|
|
||||||
"Droodles",
|
|
||||||
"dvpd",
|
|
||||||
"dvpl",
|
|
||||||
"DVPLCRC",
|
|
||||||
"dvpm",
|
|
||||||
"dxgi",
|
|
||||||
"easimon",
|
|
||||||
"echarts",
|
|
||||||
"Everytime",
|
|
||||||
"FASTNAME",
|
|
||||||
"favicons",
|
|
||||||
"flexdirection",
|
|
||||||
"fontsource",
|
|
||||||
"FOURCC",
|
|
||||||
"frameloop",
|
|
||||||
"fsformat",
|
|
||||||
"Fullscreen",
|
|
||||||
"fullstats",
|
|
||||||
"fuzzysort",
|
|
||||||
"gamemode",
|
|
||||||
"gameplay",
|
|
||||||
"glsl",
|
|
||||||
"GLTF",
|
|
||||||
"GSOR",
|
|
||||||
"gtag",
|
|
||||||
"haha",
|
|
||||||
"Herdbreaker",
|
|
||||||
"Hetz",
|
|
||||||
"highp",
|
|
||||||
"iife",
|
|
||||||
"imgur",
|
|
||||||
"immer",
|
|
||||||
"Inclusivity",
|
|
||||||
"JOINTINDEX",
|
|
||||||
"JOINTWEIGHT",
|
|
||||||
"kranvagn",
|
|
||||||
"krieg",
|
|
||||||
"Leaderboard",
|
|
||||||
"leaderboards",
|
|
||||||
"lerp",
|
|
||||||
"LINEARSIZE",
|
|
||||||
"linktarget",
|
|
||||||
"lmao",
|
|
||||||
"loadouts",
|
|
||||||
"loddist",
|
|
||||||
"lods",
|
|
||||||
"lossrate",
|
|
||||||
"Maddoxkkm",
|
|
||||||
"malum",
|
|
||||||
"mantlets",
|
|
||||||
"mediump",
|
|
||||||
"metallicness",
|
|
||||||
"metalness",
|
|
||||||
"minitelrose",
|
|
||||||
"Minotauro",
|
|
||||||
"MIPMAPCOUNT",
|
|
||||||
"mišek",
|
|
||||||
"mmnow",
|
|
||||||
"modeltransform",
|
|
||||||
"MURICA",
|
|
||||||
"nanostores",
|
|
||||||
"NEGATIVEX",
|
|
||||||
"NEGATIVEY",
|
|
||||||
"NEGATIVEZ",
|
|
||||||
"networkidle",
|
|
||||||
"NITROPAY",
|
|
||||||
"nivo",
|
|
||||||
"nmatname",
|
|
||||||
"noout",
|
|
||||||
"normalmap",
|
|
||||||
"oneof",
|
|
||||||
"oopsies",
|
|
||||||
"Oopsy",
|
|
||||||
"opentest",
|
|
||||||
"OPTML",
|
|
||||||
"otemp",
|
|
||||||
"outdir",
|
|
||||||
"outfile",
|
|
||||||
"ownedtanks",
|
|
||||||
"padder",
|
|
||||||
"partytown",
|
|
||||||
"patchnotes",
|
|
||||||
"PIXELFORMAT",
|
|
||||||
"playerachievements",
|
|
||||||
"playerinfo",
|
|
||||||
"playform",
|
|
||||||
"pngjs",
|
|
||||||
"POSITIVEX",
|
|
||||||
"POSITIVEY",
|
|
||||||
"POSITIVEZ",
|
|
||||||
"precompute",
|
|
||||||
"Promisable",
|
|
||||||
"proto",
|
|
||||||
"protobuf",
|
|
||||||
"protoc",
|
|
||||||
"protos",
|
|
||||||
"proxyclient",
|
|
||||||
"prunestrings",
|
|
||||||
"Pyogenics",
|
|
||||||
"ratingleaderboard",
|
|
||||||
"raycaster",
|
|
||||||
"Redirector",
|
|
||||||
"Relogin",
|
|
||||||
"researchable",
|
|
||||||
"Resvg",
|
|
||||||
"rizz",
|
|
||||||
"roboto",
|
|
||||||
"rtsc",
|
|
||||||
"RTSM",
|
|
||||||
"SCPG",
|
|
||||||
"scroller",
|
|
||||||
"searchclans",
|
|
||||||
"searchplayers",
|
|
||||||
"searchtanks",
|
|
||||||
"SHAREDEXP",
|
|
||||||
"SKLLD",
|
|
||||||
"smoothstep",
|
|
||||||
"Smri",
|
|
||||||
"Specularity",
|
|
||||||
"SSAO",
|
|
||||||
"startcase",
|
|
||||||
"statkit",
|
|
||||||
"statsfull",
|
|
||||||
"steamapps",
|
|
||||||
"Stringifying",
|
|
||||||
"struct",
|
|
||||||
"structs",
|
|
||||||
"strvk",
|
|
||||||
"subnation",
|
|
||||||
"Synx",
|
|
||||||
"tankaverages",
|
|
||||||
"Tankerch",
|
|
||||||
"tankmen",
|
|
||||||
"tankopedia",
|
|
||||||
"tankopedias",
|
|
||||||
"tankstats",
|
|
||||||
"tauri",
|
|
||||||
"texconv",
|
|
||||||
"TEXCOORD",
|
|
||||||
"tresabhi",
|
|
||||||
"tungstentip",
|
|
||||||
"Turretless",
|
|
||||||
"TYPELESS",
|
|
||||||
"ubjson",
|
|
||||||
"Unicum",
|
|
||||||
"UNLOCALIZED",
|
|
||||||
"UNORM",
|
|
||||||
"unpickled",
|
|
||||||
"Unregistering",
|
|
||||||
"unrotate",
|
|
||||||
"unwrapper",
|
|
||||||
"userns",
|
|
||||||
"vercel",
|
|
||||||
"vickers",
|
|
||||||
"vitepress",
|
|
||||||
"Vovko",
|
|
||||||
"wargaming",
|
|
||||||
"webp",
|
|
||||||
"wgpkg",
|
|
||||||
"whitespaces",
|
|
||||||
"WHSS",
|
|
||||||
"winrate",
|
|
||||||
"wireframe",
|
|
||||||
"Woah",
|
|
||||||
"WOTB",
|
|
||||||
"wotblitz",
|
|
||||||
"wotbreplay",
|
|
||||||
"WOTINSPECTOR",
|
|
||||||
"xffn",
|
|
||||||
"xkdkw",
|
|
||||||
"XMLDVPL",
|
|
||||||
"YAMLDVPL",
|
|
||||||
"yolo",
|
|
||||||
"youtuber",
|
|
||||||
"youtubers",
|
|
||||||
"zoomable"
|
|
||||||
],
|
|
||||||
"typescript.tsdk": "node_modules\\typescript\\lib"
|
|
||||||
}
|
|
||||||
@@ -1,47 +1,105 @@
|
|||||||
# BlitzKit
|
# BlitzKit
|
||||||
|
|
||||||
Tools for everything and anything, World of Tanks Blitz.
|
Encyclopedia for World of Tanks Blitz.
|
||||||
|
|
||||||
This GitHub repository contains the code for BlitzKit and all its services. If you are here, looking to use BlitzKit, go to https://blitzkit.app/.
|
## Development
|
||||||
|
|
||||||
If you intend to contribute to the code, note that you may need to check out sensitive, closed-source submodules to locally develop certain aspects of BlitzKit. Communicate with `@tresabhi` on Discord to get started or discuss sensitive content, such as environment variables or submodules.
|
Setting up a local developer environment for BlitzKit is more complex than most projects, but this section will guide you through all the steps. If you're ever lost or confused, feel free to ask for help in [the official Discord server](https://discord.gg/nDt7AjGJQH).
|
||||||
|
|
||||||
## Packages
|
### Prerequisites
|
||||||
|
|
||||||
| Package | Title | Source | Memo |
|
Before you touch any code, you'll need the following.
|
||||||
| ------------------------------------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
|
|
||||||
| [packages/app](packages/app) | BlitzKit | [Play Store](https://play.google.com/store/apps/details?id=com.tresabhi.blitzkit), [App Store](https://apps.apple.com/app/4321), [Microsoft Store](https://apps.microsoft.com/detail/zyxw) | The native app of BlitzKit for all platforms. Unavailable from stores at this time. |
|
|
||||||
| [packages/bot](packages/bot) | BlitzKit Discord Bot | [Discord Application Directory](https://discord.com/discovery/applications/1097673957865443370) | The one-in-all Discord bot for statistics. |
|
|
||||||
| [packages/core](packages/core) | | | Mutual internal code shared between all other packages. |
|
|
||||||
| [packages/i18n](packages/i18n) | | [Crowdin](https://crowdin.com/project/blitzkrieg) | Translations served as JSON shared across all other packages, including some utility code. |
|
|
||||||
| [packages/scripts](packages/scripts) | | | CLI utilities for the development and deployment of BlitzKit services. |
|
|
||||||
| [packages/varuna](packages/varuna) | Varuna | [NPM](https://www.npmjs.com/package/varuna) | React and Astro-oriented state management library, awaiting separation from BlitzKit. Unavailable from NPM at this time. |
|
|
||||||
| [packages/website](packages/website) | BlitzKit | https://blitzkit.app | The BlitzKit website provides a wide range of tools, APIs, and interconnects all other services. |
|
|
||||||
|
|
||||||
## Submodules
|
#### Linux
|
||||||
|
|
||||||
| Submodule | Title | Source | Memo |
|
Because Node API for .NET doesn't resolve runtime-specific object files for libraries, the entirety of the BlitzKit project is "vendor-locked" to a single OS. GitHub Actions, responsible for BlitzKit CD/CI works best with Ubuntu, thus we must also use a Linux OS.
|
||||||
| ------------------------------------------------------ | --------- | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| [submodules/blitzkit-closed](packages/blitzkit-closed) | ClosedKit | [blitzkit/closed](https://github.com/blitzkit/closed) | Closed source, sensitive code hidden from the public to prevent bad actors from abusing the game. Discuss with `@tresabhi` on Discord for **special permission** to access. |
|
|
||||||
|
|
||||||
## Environment Variables
|
#### Windows (Optional)
|
||||||
|
|
||||||
| Name | Source | BlitzKit Default | Memo |
|
...
|
||||||
| ------------------------------------------------------------- | -------------------------------------------------------------------------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| `PUBLIC_WARGAMING_APPLICATION_ID` | [Wargaming Developer's Room](https://developers.wargaming.net/) | | Application ID needed to communicate with Wargaming APIs. |
|
#### Bun
|
||||||
| `PUBLIC_PROMOTE_OPENTEST` | | `false` | Optional boolean dictating whether the website advertises [the opentest subdomain of BlitzKit](https://opentest.blitzkit.app/). |
|
|
||||||
| `ALLOW_ROBOTS` | | `true` | Toggles between `Allow: /` and `Disallow: /` in the website's `/robots.txt`. This is usually `false` for all BlitzKit's subdomains. |
|
https://bun.com/
|
||||||
| `WOTB_GLOSSARY`, `WOTB_GLOSSARY_DOMAIN`, `WOTB_GLOSSARY_PATH` | | | |
|
|
||||||
| `PUBLIC_GOOGLE_TAG_MANAGER_ID` | [Google Tag Manager](https://tagmanager.google.com/) | `G-GL2JVHCGPQ` | Google Tag Manager's unique identifier for analytical purposes. |
|
BlitzKit is written mostly in TypeScript, with packages fetched from NPM, managed by Bun.
|
||||||
| `PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID` | [Google Analytics](https://analytics.google.com/) | `430711767` | Google Analytics' unique property ID for [BlitzKit's apex domain](https://blitzkit.app/) and subdomains. |
|
|
||||||
| `GOOGLE_APPLICATION_CREDENTIALS` | [Google Cloud](https://cloud.google.com/) | | Google Cloud's API key, primarily used for ranking popular tanks and finding relevant tank review videos in Tankopedia. |
|
#### .NET
|
||||||
| `PUBLIC_DISCORD_SERVER_ID` | [BlitzKit Discord Server](https://discord.gg/nDt7AjGJQH) | `734786591205359697` | BlitzKit Discord Server's id. |
|
|
||||||
| `PUBLIC_ASSET_BASE` | [blitzkit/assets](https://github.com/blitzkit/assets) | `https://blitzkit.github.io/assets` | The root domain and path that serves the external assets like tank models and icons. |
|
https://dotnet.microsoft.com/download/dotnet/9.0/
|
||||||
| `PUBLIC_BRANCH` | | `main` | The branch that the website is operating on. This is completely nominal. |
|
|
||||||
| `PUBLIC_GUIDE_WEBSITE` | [GuidesBlitz](https://guidesblitz.com/) | `https://guidesblitz.com` | The website that serves the encyclopedia-like content in BlitzKit. |
|
You'll need the .NET 9.0 SDK to build and run the interface layer between BlitzKit and your local installation of World of Tanks Blitz.
|
||||||
| `SERVICING` | | `false` | Wether the website is down for servicing. |
|
|
||||||
| `DISCORD_CLIENT_ID` | [Discord Developer Portal](https://discord.com/developers/applications) | `1097673957865443370` | The BlitzKit Discord Bot's user ID. |
|
#### Protocol Buffers
|
||||||
| `GH_TOKEN` | [GitHub Fine-Grained Tokens](https://github.com/settings/personal-access-tokens) | | The GitHub API key used for checking out private submodules and pushing content to the asset repository. |
|
|
||||||
| `DISCORD_TOKEN` | [Discord Developer Portal](https://discord.com/developers/applications) | | The Discord API Key for the BlitzKit Discord Bot. |
|
https://protobuf.dev/installation/
|
||||||
| `DATABASE_URL` | [CockroachDB](https://www.cockroachlabs.com/) | | The CockroachDB-SQL database URL used to link Wargaming and Discord users. |
|
|
||||||
| `WOTB_DLC_CDN` | | | |
|
Both BlitzKit and World of Tanks Blitz encode their APIs with Protocol Buffers.
|
||||||
|
|
||||||
|
#### World of Tanks Blitz
|
||||||
|
|
||||||
|
https://store.steampowered.com/app/444200/
|
||||||
|
|
||||||
|
You'll need an up-to-date installation of World of Tanks Blitz on your computer. You may use the same installation that you play, even on a Windows partition if you dual boot.
|
||||||
|
|
||||||
|
#### UE4SS
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
#### protodump
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
#### FModel (Optional)
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
### Set Up
|
||||||
|
|
||||||
|
Now we can start installing and initiating the code of BlitzKit.
|
||||||
|
|
||||||
|
#### Cloning
|
||||||
|
|
||||||
|
BlitzKit is a massive monorepo with a lot of submodules. You'll likely not need all the branches and commit history. So, clone with depth 1.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone --depth 1 https://github.com/blitzkit/blitzkit.git
|
||||||
|
cd blitzkit
|
||||||
|
git submodule update --init --recursive --depth 1
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Proto Files
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
#### Mappings
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
#### Environment Variables
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
#### The Big One
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
### Modifying The Code
|
||||||
|
|
||||||
|
This is where you can start changing things and proposing them through pull requests.
|
||||||
|
|
||||||
|
#### Server
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
#### Building
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
#### Branches & Pull Requests
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
#### Updating
|
||||||
|
|
||||||
|
...
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"folders": [
|
|
||||||
{
|
|
||||||
"path": ".",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "C:/Program Files/WindowsApps/7458BE2C.WorldofTanksBlitz_11.1.256.0_x64__x4tje2y229k00/Data",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"words": [
|
||||||
|
"gltf",
|
||||||
|
"amogos",
|
||||||
|
"Tankopedia",
|
||||||
|
"uasset",
|
||||||
|
"oodle",
|
||||||
|
"blitzkit",
|
||||||
|
"webp",
|
||||||
|
"hocs",
|
||||||
|
"cooldown",
|
||||||
|
"Lods",
|
||||||
|
"Skia",
|
||||||
|
"RMAO",
|
||||||
|
"Verts",
|
||||||
|
"drei",
|
||||||
|
"frameloop",
|
||||||
|
"pointermove",
|
||||||
|
"pointerup",
|
||||||
|
"pointerdown"
|
||||||
|
],
|
||||||
|
"userWords": [
|
||||||
|
"WOTB",
|
||||||
|
"USMAP",
|
||||||
|
"favicons"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# BlitzKit 1.29.12
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- BlitzKit no longer uses BlitzStars for tank averages for some commands
|
||||||
|
- BlitzKit Performance was created to completely replace BlitzStars but BlitzStars was still used for some older commands
|
||||||
|
- But since BlitzStars keeps having downtime, it has been completely removed
|
||||||
|
- Upgraded all dependencies to the latest versions
|
||||||
|
- The replay command is now properly localized across all languages
|
||||||
|
- Special Chinese characters are now properly handled
|
||||||
|
- Commands are now registered synchronously, allowing errors to reveal their exact origins
|
||||||
|
- Error handling now properly exists the process after logging the error
|
||||||
|
- The bot now uses Discord's new `clientReady` instead of the ambiguous `ready` event
|
||||||
|
- Both the armor and model extractors now use the new BlitzKit `SteamVFS`
|
||||||
@@ -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
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# BlitzKit 1.30.3
|
||||||
|
|
||||||
|
Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions this update.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- [GonnaHetzMe] Added tooltips to the module selector in Tankopedia
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Added aggressive re-rendering for the Guess mini-game's score readout to make inspect-element harder
|
||||||
|
- Removed tank visual and collision model caching
|
||||||
|
- Guesser once again breaks streaks if not all tiers are selected
|
||||||
|
- BlitzKit now properly unloads tank models from memory when visually hidden in Guesser
|
||||||
|
- [GonnaHetzMe] Tanks with complex transparency like the Herdbreaker once again handle opacity correctly
|
||||||
|
- [GonnaHetzMe] Pieces of tank models that have transparency now handle culling properly (they're visible from both sides)
|
||||||
|
- [GonnaHetzMe] Tanks with "cardboard" textures have been fixed, thanks to better PVR file parsing
|
||||||
|
- [GonnaHetzMe] Tank icons are now scaled correctly so small tanks are now properly zoomed out in contrast to bigger ones
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"isRoot": true,
|
||||||
|
"tools": {
|
||||||
|
"csharpier": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"commands": [
|
||||||
|
"csharpier"
|
||||||
|
],
|
||||||
|
"rollForward": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+6
-36
@@ -1,50 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "blitzkit",
|
"name": "blitzkit",
|
||||||
"version": "1.29.11",
|
"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": "chmod a+x scripts/*.sh && ./scripts/setup.sh",
|
||||||
"build:averages": "bun --filter=@blitzkit/scripts run build:averages",
|
"dev": "./scripts/dev.sh",
|
||||||
"build:bot": "cd packages/scripts && bun run build:bot",
|
"build-game": "./scripts/build_game.sh",
|
||||||
"build:website": "cd packages/website && bun run build",
|
"build-website": "./scripts/build_website.sh"
|
||||||
"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",
|
|
||||||
"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:api": "bun --filter=@blitzkit/api run dev",
|
|
||||||
"setup:depotdownloader": "bun --filter=@blitzkit/scripts run setup:depotdownloader",
|
|
||||||
"setup:patches": "bun --filter=@blitzkit/scripts run setup:patches",
|
|
||||||
"start:website": "bun --filter=@blitzkit/website run start",
|
|
||||||
"host:docs": "vitepress preview docs",
|
|
||||||
"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",
|
|
||||||
"preview:website": "cd packages/website && bun run preview",
|
|
||||||
"build:reviews": "cd packages/scripts && bun build:reviews",
|
|
||||||
"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",
|
"prettier": "^3.8.3",
|
||||||
"prisma": "^6.18.0",
|
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Generated
+11
-11
@@ -356,9 +356,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bytes"
|
name = "bytes"
|
||||||
version = "1.10.1"
|
version = "1.11.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
|
checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
@@ -2105,9 +2105,9 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-conv"
|
name = "num-conv"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
|
checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-traits"
|
name = "num-traits"
|
||||||
@@ -3907,30 +3907,30 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time"
|
name = "time"
|
||||||
version = "0.3.44"
|
version = "0.3.47"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d"
|
checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"deranged",
|
"deranged",
|
||||||
"itoa",
|
"itoa",
|
||||||
"num-conv",
|
"num-conv",
|
||||||
"powerfmt",
|
"powerfmt",
|
||||||
"serde",
|
"serde_core",
|
||||||
"time-core",
|
"time-core",
|
||||||
"time-macros",
|
"time-macros",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time-core"
|
name = "time-core"
|
||||||
version = "0.1.6"
|
version = "0.1.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b"
|
checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time-macros"
|
name = "time-macros"
|
||||||
version = "0.2.24"
|
version = "0.2.27"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3"
|
checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-conv",
|
"num-conv",
|
||||||
"time-core",
|
"time-core",
|
||||||
|
|||||||
@@ -4,25 +4,26 @@
|
|||||||
"@blitzkit/core": "workspace:*",
|
"@blitzkit/core": "workspace:*",
|
||||||
"@blitzkit/i18n": "workspace:*",
|
"@blitzkit/i18n": "workspace:*",
|
||||||
"@radix-ui/colors": "^3.0.0",
|
"@radix-ui/colors": "^3.0.0",
|
||||||
"@radix-ui/themes": "^3.2.1",
|
"@radix-ui/themes": "^3.3.0",
|
||||||
"@resvg/resvg-js": "^2.6.2",
|
"@resvg/resvg-js": "^2.6.2",
|
||||||
"@types/adm-zip": "^0.5.7",
|
"@types/adm-zip": "^0.5.7",
|
||||||
|
"@types/bun": "^1.3.9",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@types/markdown-escape": "^1.1.3",
|
"@types/markdown-escape": "^1.1.3",
|
||||||
"@types/react": "^19.2.2",
|
"@types/react": "^19.2.14",
|
||||||
"adm-zip": "^0.5.16",
|
"adm-zip": "^0.5.16",
|
||||||
"bepaint": "^0.1.0-beta.3",
|
"bepaint": "^0.1.0-beta.3",
|
||||||
"discord.js": "^14.22.1",
|
"discord.js": "^14.25.1",
|
||||||
"dotenv": "^17.2.2",
|
"dotenv": "^17.3.1",
|
||||||
"fuzzysort": "^3.1.0",
|
"fuzzysort": "^3.1.0",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.23",
|
||||||
"markdown-escape": "^2.0.0",
|
"markdown-escape": "^2.0.0",
|
||||||
"pickleparser": "^0.2.1",
|
"pickleparser": "^0.2.1",
|
||||||
"prisma": "^6.17.1",
|
"prisma": "^6.19.2",
|
||||||
"protobufjs": "^7.5.4",
|
"protobufjs": "^7.5.4",
|
||||||
"react": "^19.2.0",
|
"react": "^19.2.4",
|
||||||
"satori": "^0.18.3",
|
"satori": "^0.18.4",
|
||||||
"sharp": "^0.34.4"
|
"sharp": "^0.34.5"
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||||
import { translator } from "../core/localization/translator";
|
import { translator } from "../core/localization/translator";
|
||||||
import {
|
import {
|
||||||
COMMANDS_RAW,
|
commandsArray,
|
||||||
type CommandRegistry,
|
type CommandRegistry,
|
||||||
} from "../events/interactionCreate";
|
} from "../events/interactionCreate";
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ export const aboutCommand = new Promise<CommandRegistry>(async (resolve) => {
|
|||||||
|
|
||||||
if (subcommand === "commands") {
|
if (subcommand === "commands") {
|
||||||
return `${strings.bot.commands.about.subcommands.commands.body}${(
|
return `${strings.bot.commands.about.subcommands.commands.body}${(
|
||||||
await Promise.all(COMMANDS_RAW)
|
await Promise.all(commandsArray)
|
||||||
)
|
)
|
||||||
.sort((a, b) =>
|
.sort((a, b) =>
|
||||||
(a.command.name_localizations?.[interaction.locale] ??
|
(a.command.name_localizations?.[interaction.locale] ??
|
||||||
@@ -43,7 +43,7 @@ export const aboutCommand = new Promise<CommandRegistry>(async (resolve) => {
|
|||||||
(b.command.name_localizations?.[interaction.locale] ??
|
(b.command.name_localizations?.[interaction.locale] ??
|
||||||
b.command.name)
|
b.command.name)
|
||||||
? -1
|
? -1
|
||||||
: 1
|
: 1,
|
||||||
)
|
)
|
||||||
.map(
|
.map(
|
||||||
(registry) =>
|
(registry) =>
|
||||||
@@ -54,7 +54,7 @@ export const aboutCommand = new Promise<CommandRegistry>(async (resolve) => {
|
|||||||
registry.command.description_localizations?.[
|
registry.command.description_localizations?.[
|
||||||
interaction.locale
|
interaction.locale
|
||||||
] ?? registry.command.description
|
] ?? registry.command.description
|
||||||
}`
|
}`,
|
||||||
)
|
)
|
||||||
.join("\n")}`;
|
.join("\n")}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
|||||||
@@ -15,11 +15,16 @@ import { CommandWrapper } from "../../components/CommandWrapper";
|
|||||||
import { NoData } from "../../components/NoData";
|
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 { tankDefinitions } from "../../core/blitzkit/nonBlockingPromises";
|
import {
|
||||||
|
averageDefinitions,
|
||||||
|
tankDefinitions,
|
||||||
|
} from "../../core/blitzkit/nonBlockingPromises";
|
||||||
import { UserError } from "../../core/blitzkit/userError";
|
import { UserError } from "../../core/blitzkit/userError";
|
||||||
import { filterStats, type StatFilters } from "../../core/blitzstars/filterStats";
|
import {
|
||||||
|
filterStats,
|
||||||
|
type StatFilters,
|
||||||
|
} from "../../core/blitzstars/filterStats";
|
||||||
import { getStatsInPeriod } from "../../core/blitzstars/getStatsInPeriod";
|
import { getStatsInPeriod } from "../../core/blitzstars/getStatsInPeriod";
|
||||||
import { blitzStarsTankAverages } from "../../core/blitzstars/tankAverages";
|
|
||||||
import type { ResolvedPeriod } from "../../core/discord/resolvePeriodFromCommand";
|
import type { ResolvedPeriod } from "../../core/discord/resolvePeriodFromCommand";
|
||||||
import type { ResolvedPlayer } from "../../core/discord/resolvePlayerFromCommand";
|
import type { ResolvedPlayer } from "../../core/discord/resolvePlayerFromCommand";
|
||||||
import { translator } from "../../core/localization/translator";
|
import { translator } from "../../core/localization/translator";
|
||||||
@@ -31,11 +36,11 @@ export async function renderBreakdown(
|
|||||||
{ region, id }: ResolvedPlayer,
|
{ region, id }: ResolvedPlayer,
|
||||||
{ start, end, name }: ResolvedPeriod,
|
{ start, end, name }: ResolvedPeriod,
|
||||||
filters: StatFilters,
|
filters: StatFilters,
|
||||||
locale: Locale
|
locale: Locale,
|
||||||
) {
|
) {
|
||||||
const { strings, unwrap } = translator(locale);
|
const { strings, unwrap } = translator(locale);
|
||||||
const awaitedTankDefinitions = await tankDefinitions;
|
const awaitedTankDefinitions = await tankDefinitions;
|
||||||
const awaitedTankAverages = await blitzStarsTankAverages;
|
const awaitedTankAverages = await averageDefinitions;
|
||||||
const statsInPeriod = await getStatsInPeriod(region, id, start, end, locale);
|
const statsInPeriod = await getStatsInPeriod(region, id, start, end, locale);
|
||||||
const { filteredOrder } = await filterStats(statsInPeriod, filters);
|
const { filteredOrder } = await filterStats(statsInPeriod, filters);
|
||||||
const accountInfo = await getAccountInfo(region, id);
|
const accountInfo = await getAccountInfo(region, id);
|
||||||
@@ -53,14 +58,14 @@ export async function renderBreakdown(
|
|||||||
}
|
}
|
||||||
|
|
||||||
filteredOrder.forEach((id) => {
|
filteredOrder.forEach((id) => {
|
||||||
const tankAveragesEntry = awaitedTankAverages[id];
|
const tankAveragesEntry = awaitedTankAverages.averages[id];
|
||||||
const current = statsInPeriod.diff[id];
|
const current = statsInPeriod.diff[id];
|
||||||
const career = tankStats.find((tank) => tank.tank_id === id)!.all;
|
const career = tankStats.find((tank) => tank.tank_id === id)!.all;
|
||||||
const currentWN8 = tankAveragesEntry
|
const currentWN8 = tankAveragesEntry
|
||||||
? calculateWN8(tankAveragesEntry.all, current)
|
? calculateWN8(tankAveragesEntry.mu, current)
|
||||||
: undefined;
|
: undefined;
|
||||||
const careerWN8 = tankAveragesEntry
|
const careerWN8 = tankAveragesEntry
|
||||||
? calculateWN8(tankAveragesEntry.all, career)
|
? calculateWN8(tankAveragesEntry.mu, career)
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
orderedCurrentStats.push(current);
|
orderedCurrentStats.push(current);
|
||||||
@@ -69,65 +74,65 @@ export async function renderBreakdown(
|
|||||||
orderedCareerWN8.push(careerWN8);
|
orderedCareerWN8.push(careerWN8);
|
||||||
});
|
});
|
||||||
tankStats.forEach((tank) => {
|
tankStats.forEach((tank) => {
|
||||||
const tankAveragesEntry = awaitedTankAverages[tank.tank_id];
|
const tankAveragesEntry = awaitedTankAverages.averages[tank.tank_id];
|
||||||
|
|
||||||
orderedCareerWN8Full.push(
|
orderedCareerWN8Full.push(
|
||||||
tankAveragesEntry
|
tankAveragesEntry
|
||||||
? calculateWN8(tankAveragesEntry.all, tank.all)
|
? calculateWN8(tankAveragesEntry.mu, tank.all)
|
||||||
: undefined
|
: undefined,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const currentBattles = orderedCurrentStats.reduce(
|
const currentBattles = orderedCurrentStats.reduce(
|
||||||
(accumulator, current) => accumulator + current.battles,
|
(accumulator, current) => accumulator + current.battles,
|
||||||
0
|
0,
|
||||||
);
|
);
|
||||||
const careerBattles = tankStats.reduce(
|
const careerBattles = tankStats.reduce(
|
||||||
(accumulator, current) => accumulator + current.all.battles,
|
(accumulator, current) => accumulator + current.all.battles,
|
||||||
0
|
0,
|
||||||
);
|
);
|
||||||
const currentWinrate =
|
const currentWinrate =
|
||||||
orderedCurrentStats.reduce(
|
orderedCurrentStats.reduce(
|
||||||
(accumulator, current) => accumulator + current.wins,
|
(accumulator, current) => accumulator + current.wins,
|
||||||
0
|
0,
|
||||||
) / currentBattles;
|
) / currentBattles;
|
||||||
const careerWinrate =
|
const careerWinrate =
|
||||||
tankStats.reduce(
|
tankStats.reduce(
|
||||||
(accumulator, current) => accumulator + current.all.wins,
|
(accumulator, current) => accumulator + current.all.wins,
|
||||||
0
|
0,
|
||||||
) / careerBattles;
|
) / careerBattles;
|
||||||
const currentWN8 =
|
const currentWN8 =
|
||||||
orderedCurrentWN8.reduce<number>(
|
orderedCurrentWN8.reduce<number>(
|
||||||
(accumulator, current, index) =>
|
(accumulator, current, index) =>
|
||||||
accumulator + (current ?? 0) * orderedCurrentStats[index].battles,
|
accumulator + (current ?? 0) * orderedCurrentStats[index].battles,
|
||||||
0
|
0,
|
||||||
) /
|
) /
|
||||||
orderedCurrentStats.reduce(
|
orderedCurrentStats.reduce(
|
||||||
(accumulator, current, index) =>
|
(accumulator, current, index) =>
|
||||||
accumulator +
|
accumulator +
|
||||||
(orderedCurrentWN8[index] === undefined ? 0 : current.battles),
|
(orderedCurrentWN8[index] === undefined ? 0 : current.battles),
|
||||||
0
|
0,
|
||||||
);
|
);
|
||||||
const careerWN8 =
|
const careerWN8 =
|
||||||
orderedCareerWN8Full.reduce<number>(
|
orderedCareerWN8Full.reduce<number>(
|
||||||
(accumulator, current) => accumulator + (current ?? 0),
|
(accumulator, current) => accumulator + (current ?? 0),
|
||||||
0
|
0,
|
||||||
) /
|
) /
|
||||||
tankStats.reduce(
|
tankStats.reduce(
|
||||||
(accumulator, current, index) =>
|
(accumulator, current, index) =>
|
||||||
accumulator +
|
accumulator +
|
||||||
(orderedCareerWN8Full[index] === undefined ? 0 : current.all.battles),
|
(orderedCareerWN8Full[index] === undefined ? 0 : current.all.battles),
|
||||||
0
|
0,
|
||||||
);
|
);
|
||||||
const currentDamage =
|
const currentDamage =
|
||||||
orderedCurrentStats.reduce(
|
orderedCurrentStats.reduce(
|
||||||
(accumulator, current) => accumulator + current.damage_dealt,
|
(accumulator, current) => accumulator + current.damage_dealt,
|
||||||
0
|
0,
|
||||||
) / currentBattles;
|
) / currentBattles;
|
||||||
const careerDamage =
|
const careerDamage =
|
||||||
tankStats.reduce(
|
tankStats.reduce(
|
||||||
(accumulator, current) => accumulator + current.all.damage_dealt,
|
(accumulator, current) => accumulator + current.all.damage_dealt,
|
||||||
0
|
0,
|
||||||
) / careerBattles;
|
) / careerBattles;
|
||||||
|
|
||||||
const children: React.JSX.Element[] = [];
|
const children: React.JSX.Element[] = [];
|
||||||
@@ -172,7 +177,7 @@ export async function renderBreakdown(
|
|||||||
delta: currentDamage - careerDamage,
|
delta: currentDamage - careerDamage,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>,
|
||||||
);
|
);
|
||||||
|
|
||||||
filteredOrder.forEach((id, index) => {
|
filteredOrder.forEach((id, index) => {
|
||||||
@@ -206,7 +211,7 @@ export async function renderBreakdown(
|
|||||||
{
|
{
|
||||||
title: strings.bot.commands.breakdown.body.winrate,
|
title: strings.bot.commands.breakdown.body.winrate,
|
||||||
current: `${(100 * (current.wins / current.battles)).toFixed(
|
current: `${(100 * (current.wins / current.battles)).toFixed(
|
||||||
2
|
2,
|
||||||
)}%`,
|
)}%`,
|
||||||
career: `${(100 * (career.wins / career.battles)).toFixed(2)}%`,
|
career: `${(100 * (career.wins / career.battles)).toFixed(2)}%`,
|
||||||
delta:
|
delta:
|
||||||
@@ -230,24 +235,24 @@ export async function renderBreakdown(
|
|||||||
{
|
{
|
||||||
title: strings.bot.commands.breakdown.body.damage,
|
title: strings.bot.commands.breakdown.body.damage,
|
||||||
current: Math.round(
|
current: Math.round(
|
||||||
current.damage_dealt / current.battles
|
current.damage_dealt / current.battles,
|
||||||
).toLocaleString(),
|
).toLocaleString(),
|
||||||
career: Math.round(
|
career: Math.round(
|
||||||
career.damage_dealt / career.battles
|
career.damage_dealt / career.battles,
|
||||||
).toLocaleString(),
|
).toLocaleString(),
|
||||||
delta:
|
delta:
|
||||||
current.damage_dealt / current.battles -
|
current.damage_dealt / current.battles -
|
||||||
career.damage_dealt / career.battles,
|
career.damage_dealt / career.battles,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const pages = chunk(
|
const pages = chunk(
|
||||||
children,
|
children,
|
||||||
Math.max(Math.ceil(children.length / MAX_PAGES), ROWS_PER_PAGE)
|
Math.max(Math.ceil(children.length / MAX_PAGES), ROWS_PER_PAGE),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (filteredOrder.length > 0) {
|
if (filteredOrder.length > 0) {
|
||||||
|
|||||||
@@ -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];
|
||||||
|
|
||||||
|
|||||||
@@ -5,28 +5,29 @@ import {
|
|||||||
idToRegion,
|
idToRegion,
|
||||||
tankIcon,
|
tankIcon,
|
||||||
TIER_ROMAN_NUMERALS,
|
TIER_ROMAN_NUMERALS,
|
||||||
} from '@blitzkit/core';
|
} from "@blitzkit/core";
|
||||||
import { Locale } from 'discord.js';
|
import { Locale } from "discord.js";
|
||||||
import { clamp } from 'lodash-es';
|
import { clamp } from "lodash-es";
|
||||||
import { CommandWrapper } from '../components/CommandWrapper';
|
import { CommandWrapper } from "../components/CommandWrapper";
|
||||||
import { TitleBar } from '../components/TitleBar';
|
import { TitleBar } from "../components/TitleBar";
|
||||||
import { iconPng } from '../core/blitzkit/iconPng';
|
import { iconPng } from "../core/blitzkit/iconPng";
|
||||||
import {
|
import {
|
||||||
|
averageDefinitions,
|
||||||
mapDefinitions,
|
mapDefinitions,
|
||||||
tankDefinitions,
|
tankDefinitions,
|
||||||
} from '../core/blitzkit/nonBlockingPromises';
|
} from "../core/blitzkit/nonBlockingPromises";
|
||||||
import { RenderConfiguration } from '../core/blitzkit/renderConfiguration';
|
import { RenderConfiguration } from "../core/blitzkit/renderConfiguration";
|
||||||
import { blitzStarsTankAverages } from '../core/blitzstars/tankAverages';
|
import { buttonLink } from "../core/discord/buttonLink";
|
||||||
import { buttonLink } from '../core/discord/buttonLink';
|
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||||
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
import { localizationObject } from "../core/discord/localizationObject";
|
||||||
import { translator } from '../core/localization/translator';
|
import { translator } from "../core/localization/translator";
|
||||||
import { type CommandRegistry } from '../events/interactionCreate';
|
import { type CommandRegistry } from "../events/interactionCreate";
|
||||||
import { theme } from '../stitches.config';
|
import { theme } from "../stitches.config";
|
||||||
|
|
||||||
type WotInspectorReplaySubmission =
|
type WotInspectorReplaySubmission =
|
||||||
| { status: 'error'; data: unknown; error: { message: string } }
|
| { status: "error"; data: unknown; error: { message: string } }
|
||||||
| {
|
| {
|
||||||
status: 'ok';
|
status: "ok";
|
||||||
data: {
|
data: {
|
||||||
download_url: string;
|
download_url: string;
|
||||||
view_url: string;
|
view_url: string;
|
||||||
@@ -209,9 +210,9 @@ function stat(value: string | number, flex = 2) {
|
|||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
flex,
|
flex,
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
justifyContent: 'center',
|
justifyContent: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span style={{ fontSize: 16 }}>{value}</span>
|
<span style={{ fontSize: 16 }}>{value}</span>
|
||||||
@@ -227,15 +228,15 @@ async function playerListing(
|
|||||||
recordingPlayer = false,
|
recordingPlayer = false,
|
||||||
) {
|
) {
|
||||||
const { unwrap } = translator(locale);
|
const { unwrap } = translator(locale);
|
||||||
const awaitedTankAverages = await blitzStarsTankAverages;
|
const awaitedTankAverages = await averageDefinitions;
|
||||||
const awaitedTankDefinitions = await tankDefinitions;
|
const awaitedTankDefinitions = await tankDefinitions;
|
||||||
const tank = awaitedTankDefinitions.tanks[player.vehicle_descr];
|
const tank = awaitedTankDefinitions.tanks[player.vehicle_descr];
|
||||||
const blockAccent = recordingPlayer ? '_amber' : '';
|
const blockAccent = recordingPlayer ? "_amber" : "";
|
||||||
const healthAccent = protagonistTeam
|
const healthAccent = protagonistTeam
|
||||||
? recordingPlayer
|
? recordingPlayer
|
||||||
? '_amber'
|
? "_amber"
|
||||||
: '_green'
|
: "_green"
|
||||||
: '_red';
|
: "_red";
|
||||||
|
|
||||||
// our turret ids are always off by 1 or 2 lol so imma just grab the closest
|
// our turret ids are always off by 1 or 2 lol so imma just grab the closest
|
||||||
// TODO: 💀
|
// TODO: 💀
|
||||||
@@ -245,11 +246,11 @@ async function playerListing(
|
|||||||
)[0];
|
)[0];
|
||||||
const totalHealth = turret.health + tank.health;
|
const totalHealth = turret.health + tank.health;
|
||||||
const healthLeft = clamp(player.hitpoints_left / totalHealth, 0, 1);
|
const healthLeft = clamp(player.hitpoints_left / totalHealth, 0, 1);
|
||||||
const tankAveragesEntry = awaitedTankAverages[player.vehicle_descr];
|
const tankAveragesEntry = awaitedTankAverages.averages[player.vehicle_descr];
|
||||||
const wn8 =
|
const wn8 =
|
||||||
tankAveragesEntry === undefined
|
tankAveragesEntry === undefined
|
||||||
? -1
|
? -1
|
||||||
: calculateWN8(tankAveragesEntry.all, {
|
: calculateWN8(tankAveragesEntry.mu, {
|
||||||
battles: 1,
|
battles: 1,
|
||||||
damage_dealt: player.damage_made,
|
damage_dealt: player.damage_made,
|
||||||
dropped_capture_points: player.base_defend_points,
|
dropped_capture_points: player.base_defend_points,
|
||||||
@@ -262,8 +263,8 @@ async function playerListing(
|
|||||||
<div
|
<div
|
||||||
key={player.entity_id}
|
key={player.entity_id}
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
gap: 8,
|
gap: 8,
|
||||||
backgroundColor: theme.colors[`appBackground2${blockAccent}`],
|
backgroundColor: theme.colors[`appBackground2${blockAccent}`],
|
||||||
padding: 8,
|
padding: 8,
|
||||||
@@ -271,35 +272,35 @@ async function playerListing(
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
gap: 8,
|
gap: 8,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
overflow: 'hidden',
|
overflow: "hidden",
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<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,
|
||||||
height: 32,
|
height: 32,
|
||||||
objectFit: 'contain',
|
objectFit: "contain",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
flexDirection: 'column',
|
flexDirection: "column",
|
||||||
// align
|
// align
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
gap: 4,
|
gap: 4,
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -316,7 +317,7 @@ async function playerListing(
|
|||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{unwrap(tank.name)}
|
{unwrap(tank.name!)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -324,23 +325,23 @@ async function playerListing(
|
|||||||
style={{
|
style={{
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: theme.colors[`textLowContrast${blockAccent}`],
|
color: theme.colors[`textLowContrast${blockAccent}`],
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: "nowrap",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{player.name}
|
{player.name}
|
||||||
{player.clan_tag ? ` [${player.clan_tag}]` : ''}
|
{player.clan_tag ? ` [${player.clan_tag}]` : ""}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
flex: 1,
|
flex: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{stat(player.damage_made.toLocaleString())}
|
{stat(player.damage_made.toLocaleString())}
|
||||||
{stat(wn8 === -1 ? '--' : Math.round(wn8).toLocaleString())}
|
{stat(wn8 === -1 ? "--" : Math.round(wn8).toLocaleString())}
|
||||||
{stat(player.exp.toLocaleString())}
|
{stat(player.exp.toLocaleString())}
|
||||||
{stat(player.enemies_destroyed, 1)}
|
{stat(player.enemies_destroyed, 1)}
|
||||||
</div>
|
</div>
|
||||||
@@ -349,15 +350,15 @@ async function playerListing(
|
|||||||
style={{
|
style={{
|
||||||
borderRadius: 2,
|
borderRadius: 2,
|
||||||
backgroundColor: theme.colors[`componentInteractive${healthAccent}`],
|
backgroundColor: theme.colors[`componentInteractive${healthAccent}`],
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
width: 4,
|
width: 4,
|
||||||
height: '100%',
|
height: "100%",
|
||||||
transform: 'scaleY(-1)',
|
transform: "scaleY(-1)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
width: '100%',
|
width: "100%",
|
||||||
height: `${healthLeft * 100}%`,
|
height: `${healthLeft * 100}%`,
|
||||||
borderRadius: 2,
|
borderRadius: 2,
|
||||||
backgroundColor: theme.colors[`solidBackground${healthAccent}`],
|
backgroundColor: theme.colors[`solidBackground${healthAccent}`],
|
||||||
@@ -373,8 +374,8 @@ function Header() {
|
|||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
padding: 8,
|
padding: 8,
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
gap: 8,
|
gap: 8,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -382,16 +383,16 @@ function Header() {
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
flex: 1,
|
flex: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
flex: 2,
|
flex: 2,
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
justifyContent: 'center',
|
justifyContent: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -406,9 +407,9 @@ function Header() {
|
|||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
flex: 2,
|
flex: 2,
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
justifyContent: 'center',
|
justifyContent: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -423,9 +424,9 @@ function Header() {
|
|||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
flex: 2,
|
flex: 2,
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
justifyContent: 'center',
|
justifyContent: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -440,9 +441,9 @@ function Header() {
|
|||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
justifyContent: 'center',
|
justifyContent: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -460,28 +461,42 @@ function Header() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const replayCommand = new Promise<CommandRegistry>((resolve) => {
|
export const replayCommand = new Promise<CommandRegistry>((resolve) => {
|
||||||
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
command: createLocalizedCommand('replay').addAttachmentOption((option) =>
|
command: createLocalizedCommand("replay").addAttachmentOption((option) =>
|
||||||
option.setName('file').setDescription('Replay file').setRequired(true),
|
option
|
||||||
|
.setName(strings.bot.commands.replay.options.file.name)
|
||||||
|
.setNameLocalizations(
|
||||||
|
localizationObject(
|
||||||
|
(strings) => strings.bot.commands.replay.options.file.name,
|
||||||
|
undefined,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.setDescription(strings.bot.commands.replay.options.file.description)
|
||||||
|
.setDescriptionLocalizations(
|
||||||
|
localizationObject(
|
||||||
|
(strings) => strings.bot.commands.replay.options.file.description,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.setRequired(true),
|
||||||
),
|
),
|
||||||
|
|
||||||
async handler(interaction) {
|
async handler(interaction) {
|
||||||
const awaitedMapDefinitions = await mapDefinitions;
|
const awaitedMapDefinitions = await mapDefinitions;
|
||||||
const file = interaction.options.getAttachment('file')!;
|
const file = interaction.options.getAttachment("file")!;
|
||||||
// const file = {
|
|
||||||
// url: 'https://cdn.discordapp.com/ephemeral-attachments/1232434891652861972/1232781496016834581/20240328_1530__TresAbhi_M60_1157057448155406708.wotbreplay?ex=662ab4bc&is=6629633c&hm=c784cd10e80232350ddaf291fa987b879c4d0a8083b78298c9eee4fa0d507f6c&',
|
|
||||||
// };
|
|
||||||
const submissionData = (await fetch(
|
const submissionData = (await fetch(
|
||||||
`https://wotinspector.com/api/replay/upload/?url=${encodeURIComponent(
|
`https://wotinspector.com/api/replay/upload/?url=${encodeURIComponent(
|
||||||
file.url,
|
file.url,
|
||||||
)}`,
|
)}`,
|
||||||
).then((response) => response.json())) as WotInspectorReplaySubmission;
|
).then((response) => response.json())) as WotInspectorReplaySubmission;
|
||||||
|
|
||||||
if (submissionData.status === 'error') {
|
if (submissionData.status === "error") {
|
||||||
return `# Uh oh! WoT Inspector didn't like that.\n\nThere was an error processing your replay. Get help on [the official Discord server](https://discord.gg/nDt7AjGJQH).`;
|
return `# Uh oh! WoT Inspector didn't like that.\n\nThere was an error processing your replay. Get help on [the official Discord server](https://discord.gg/nDt7AjGJQH).`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const replayId = submissionData.data.download_url.split('/').at(-1)!;
|
const replayId = submissionData.data.download_url.split("/").at(-1)!;
|
||||||
const replayData = (await fetch(
|
const replayData = (await fetch(
|
||||||
`https://api.wotinspector.com/v2/blitz/replays/${replayId}/`,
|
`https://api.wotinspector.com/v2/blitz/replays/${replayId}/`,
|
||||||
).then((response) => response.json())) as WotInspectorReplay;
|
).then((response) => response.json())) as WotInspectorReplay;
|
||||||
@@ -493,7 +508,7 @@ export const replayCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
await getClanAccountInfo(
|
await getClanAccountInfo(
|
||||||
idToRegion(replayData.protagonist),
|
idToRegion(replayData.protagonist),
|
||||||
replayData.protagonist,
|
replayData.protagonist,
|
||||||
['clan'],
|
["clan"],
|
||||||
)
|
)
|
||||||
)?.clan;
|
)?.clan;
|
||||||
const clanImage = clan ? emblemURL(clan.emblem_set_id) : undefined;
|
const clanImage = clan ? emblemURL(clan.emblem_set_id) : undefined;
|
||||||
@@ -506,22 +521,22 @@ export const replayCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
image={clanImage}
|
image={clanImage}
|
||||||
description={`${
|
description={`${
|
||||||
replayData.protagonist_team === replayData.winner_team
|
replayData.protagonist_team === replayData.winner_team
|
||||||
? 'Victory'
|
? "Victory"
|
||||||
: 'Defeat'
|
: "Defeat"
|
||||||
} • ${awaitedMapDefinitions.maps[replayData.map_id].name}`}
|
} • ${awaitedMapDefinitions.maps[replayData.map_id].name}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
gap: 8,
|
gap: 8,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
flexDirection: 'column',
|
flexDirection: "column",
|
||||||
gap: 4,
|
gap: 4,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -547,8 +562,8 @@ export const replayCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
flexDirection: 'column',
|
flexDirection: "column",
|
||||||
gap: 4,
|
gap: 4,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -569,8 +584,8 @@ export const replayCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</CommandWrapper>,
|
</CommandWrapper>,
|
||||||
buttonLink(submissionData.data.view_url, 'WoT Inspector'),
|
buttonLink(submissionData.data.view_url, "WoT Inspector"),
|
||||||
buttonLink(submissionData.data.download_url, 'Download'),
|
buttonLink(submissionData.data.download_url, "Download"),
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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]);
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import {
|
import {
|
||||||
|
fetchAverageDefinitions,
|
||||||
fetchDiscoveredIdsDefinitions,
|
fetchDiscoveredIdsDefinitions,
|
||||||
fetchGameDefinitions,
|
fetchGameDefinitions,
|
||||||
fetchMapDefinitions,
|
fetchMapDefinitions,
|
||||||
fetchTankDefinitions,
|
fetchTankDefinitions,
|
||||||
fetchTankNames,
|
fetchTankNames,
|
||||||
} from '@blitzkit/core';
|
} from "@blitzkit/core";
|
||||||
|
|
||||||
|
export const averageDefinitions = fetchAverageDefinitions();
|
||||||
export const tankDefinitions = fetchTankDefinitions();
|
export const tankDefinitions = fetchTankDefinitions();
|
||||||
export const gameDefinitions = fetchGameDefinitions();
|
export const gameDefinitions = fetchGameDefinitions();
|
||||||
export const tankNames = fetchTankNames();
|
export const tankNames = fetchTankNames();
|
||||||
|
|||||||
@@ -1,29 +1,37 @@
|
|||||||
import { usersDatabase } from '../db/users';
|
import { usersDatabase } from "../db/users";
|
||||||
import { client } from '../discord/client';
|
import { client } from "../discord/client";
|
||||||
|
|
||||||
const EXIT_EVENTS = [
|
const EXIT_EVENTS = ["SIGINT", "SIGTERM", "SIGUSR1", "SIGUSR2"];
|
||||||
'beforeExit',
|
|
||||||
'exit',
|
|
||||||
'SIGINT',
|
|
||||||
'SIGTERM',
|
|
||||||
'SIGUSR1',
|
|
||||||
'SIGUSR2',
|
|
||||||
];
|
|
||||||
|
|
||||||
async function cleanup() {
|
let cleaningUp = false;
|
||||||
console.log('Cleaning up...');
|
|
||||||
|
|
||||||
|
async function cleanup(signal: string) {
|
||||||
|
if (cleaningUp) return;
|
||||||
|
cleaningUp = true;
|
||||||
|
|
||||||
|
console.log(`Cleaning up... (${signal})`);
|
||||||
|
|
||||||
|
try {
|
||||||
await Promise.all([usersDatabase.$disconnect(), client.destroy()]);
|
await Promise.all([usersDatabase.$disconnect(), client.destroy()]);
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Cleanup error:", err);
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Gracefully exiting...');
|
console.log("Gracefully exiting...");
|
||||||
|
|
||||||
EXIT_EVENTS.forEach((event) => process.off(event, cleanup));
|
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function registerProcesses() {
|
export function registerProcesses() {
|
||||||
process.on('uncaughtException', console.error);
|
process.on("uncaughtException", (err) => {
|
||||||
client.on('error', console.error);
|
console.error("uncaughtException:", err);
|
||||||
|
});
|
||||||
|
|
||||||
EXIT_EVENTS.forEach((event) => process.on(event, cleanup));
|
process.on("unhandledRejection", (err) => {
|
||||||
|
console.error("unhandledRejection:", err);
|
||||||
|
});
|
||||||
|
|
||||||
|
client.on("error", console.error);
|
||||||
|
|
||||||
|
EXIT_EVENTS.forEach((event) => process.on(event, () => cleanup(event)));
|
||||||
}
|
}
|
||||||
@@ -3,8 +3,10 @@ import type { SupplementaryStats } from "@blitzkit/core/src/blitz/getAccountInfo
|
|||||||
import { calculateWN8 } from "@blitzkit/core/src/statistics/calculateWN8";
|
import { calculateWN8 } from "@blitzkit/core/src/statistics/calculateWN8";
|
||||||
import type { BlitzStats } from "@blitzkit/core/src/statistics/compositeStats";
|
import type { BlitzStats } from "@blitzkit/core/src/statistics/compositeStats";
|
||||||
import { sumAllStats } from "@blitzkit/core/src/statistics/sumAllStats";
|
import { sumAllStats } from "@blitzkit/core/src/statistics/sumAllStats";
|
||||||
import { tankDefinitions } from "../blitzkit/nonBlockingPromises";
|
import {
|
||||||
import { blitzStarsTankAverages } from "./tankAverages";
|
averageDefinitions,
|
||||||
|
tankDefinitions,
|
||||||
|
} from "../blitzkit/nonBlockingPromises";
|
||||||
|
|
||||||
export interface StatFilters {
|
export interface StatFilters {
|
||||||
nation?: string;
|
nation?: string;
|
||||||
@@ -16,13 +18,13 @@ export interface StatFilters {
|
|||||||
|
|
||||||
export async function filterStats(
|
export async function filterStats(
|
||||||
{ diff, order }: DiffedTankStats,
|
{ diff, order }: DiffedTankStats,
|
||||||
filters: StatFilters
|
filters: StatFilters,
|
||||||
) {
|
) {
|
||||||
// tank, if provided, takes priority over all other filters
|
// tank, if provided, takes priority over all other filters
|
||||||
if (filters.tank) filters = { tank: filters.tank };
|
if (filters.tank) filters = { tank: filters.tank };
|
||||||
|
|
||||||
const awaitedTankDefinitions = await tankDefinitions;
|
const awaitedTankDefinitions = await tankDefinitions;
|
||||||
const awaitedTankAverages = await blitzStarsTankAverages;
|
const awaitedTankAverages = await averageDefinitions;
|
||||||
const filteredOrder = order.filter((id) => {
|
const filteredOrder = order.filter((id) => {
|
||||||
const entry = awaitedTankDefinitions.tanks[id];
|
const entry = awaitedTankDefinitions.tanks[id];
|
||||||
|
|
||||||
@@ -32,38 +34,40 @@ 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)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
const stats = sumAllStats(filteredOrder.map((id) => diff[id]));
|
const stats = sumAllStats(filteredOrder.map((id) => diff[id]));
|
||||||
const battlesOfTanksWithAverages = filteredOrder.reduce<number>(
|
const battlesOfTanksWithAverages = filteredOrder.reduce<number>(
|
||||||
(accumulator, id) =>
|
(accumulator, id) =>
|
||||||
awaitedTankAverages[id] ? accumulator + diff[id].battles : accumulator,
|
awaitedTankAverages.averages[id]
|
||||||
0
|
? accumulator + diff[id].battles
|
||||||
|
: accumulator,
|
||||||
|
0,
|
||||||
);
|
);
|
||||||
const battlesOfTanksWithTankDefinition = filteredOrder.reduce<number>(
|
const battlesOfTanksWithTankDefinition = filteredOrder.reduce<number>(
|
||||||
(accumulator, id) =>
|
(accumulator, id) =>
|
||||||
awaitedTankDefinitions.tanks[id]
|
awaitedTankDefinitions.tanks[id]
|
||||||
? accumulator + diff[id].battles
|
? accumulator + diff[id].battles
|
||||||
: accumulator,
|
: accumulator,
|
||||||
0
|
0,
|
||||||
);
|
);
|
||||||
const supplementary = {
|
const supplementary = {
|
||||||
WN8:
|
WN8:
|
||||||
filteredOrder.reduce<number>(
|
filteredOrder.reduce<number>(
|
||||||
(accumulator, id) =>
|
(accumulator, id) =>
|
||||||
awaitedTankAverages[id]
|
awaitedTankAverages.averages[id]
|
||||||
? accumulator +
|
? accumulator +
|
||||||
calculateWN8(awaitedTankAverages[id].all, diff[id]) *
|
calculateWN8(awaitedTankAverages.averages[id].mu, diff[id]) *
|
||||||
diff[id].battles
|
diff[id].battles
|
||||||
: accumulator,
|
: accumulator,
|
||||||
0
|
0,
|
||||||
) / battlesOfTanksWithAverages,
|
) / battlesOfTanksWithAverages,
|
||||||
tier:
|
tier:
|
||||||
filteredOrder.reduce<number>(
|
filteredOrder.reduce<number>(
|
||||||
@@ -72,7 +76,7 @@ export async function filterStats(
|
|||||||
? accumulator +
|
? accumulator +
|
||||||
awaitedTankDefinitions.tanks[id]!.tier * diff[id].battles
|
awaitedTankDefinitions.tanks[id]!.tier * diff[id].battles
|
||||||
: accumulator,
|
: accumulator,
|
||||||
0
|
0,
|
||||||
) / battlesOfTanksWithTankDefinition,
|
) / battlesOfTanksWithTankDefinition,
|
||||||
} satisfies SupplementaryStats;
|
} satisfies SupplementaryStats;
|
||||||
|
|
||||||
|
|||||||
@@ -1,101 +0,0 @@
|
|||||||
import { BlitzStats } from '@blitzkit/core';
|
|
||||||
import { context } from '@blitzkit/core/src/blitzkit/context';
|
|
||||||
|
|
||||||
interface SpecialStats {
|
|
||||||
winrate: number;
|
|
||||||
damageRatio: number;
|
|
||||||
kdr: number;
|
|
||||||
damagePerBattle: number;
|
|
||||||
killsPerBattle: number;
|
|
||||||
hitsPerBattle: number;
|
|
||||||
spotsPerBattle: number;
|
|
||||||
wpm: number;
|
|
||||||
dpm: number;
|
|
||||||
kpm: number;
|
|
||||||
hitRate: number;
|
|
||||||
survivalRate: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Percentiles = [
|
|
||||||
number,
|
|
||||||
number,
|
|
||||||
number,
|
|
||||||
number,
|
|
||||||
number,
|
|
||||||
number,
|
|
||||||
number,
|
|
||||||
number,
|
|
||||||
number,
|
|
||||||
];
|
|
||||||
|
|
||||||
export interface SpecialPercentiles {
|
|
||||||
winRate: Percentiles;
|
|
||||||
damageRatio: Percentiles;
|
|
||||||
kdr: Percentiles;
|
|
||||||
damagePerBattle: Percentiles;
|
|
||||||
killsPerBattle: Percentiles;
|
|
||||||
hitsPerBattle: Percentiles;
|
|
||||||
spotsPerBattle: Percentiles;
|
|
||||||
wpm: Percentiles;
|
|
||||||
dpm: Percentiles;
|
|
||||||
kpm: Percentiles;
|
|
||||||
hitRate: Percentiles;
|
|
||||||
survivalRate: Percentiles;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MeanSd {
|
|
||||||
winrateMean: number;
|
|
||||||
winrateSd: number;
|
|
||||||
hitRateMean: number;
|
|
||||||
hitRateSd: number;
|
|
||||||
survivalRateMean: number;
|
|
||||||
survivalRateSd: number;
|
|
||||||
damageRatioMean: number;
|
|
||||||
damageRatioSd: number;
|
|
||||||
kdrMean: number;
|
|
||||||
kdrSd: number;
|
|
||||||
dpbMean: number;
|
|
||||||
dpbSd: number;
|
|
||||||
kpbMean: number;
|
|
||||||
kpbSd: number;
|
|
||||||
hpbMean: number;
|
|
||||||
hpbSd: number;
|
|
||||||
spbMean: number;
|
|
||||||
spbSd: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IndividualTankAverage {
|
|
||||||
_id: number;
|
|
||||||
battle_life_time: number;
|
|
||||||
total_battle_life_time: number;
|
|
||||||
number_of_players: number;
|
|
||||||
tank_id: number;
|
|
||||||
all: BlitzStats;
|
|
||||||
special: SpecialStats;
|
|
||||||
percentiles: SpecialPercentiles;
|
|
||||||
percentiles_player_count: number;
|
|
||||||
meanSd: MeanSd;
|
|
||||||
shotEff: number;
|
|
||||||
last_update: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type BlitzStarsTankAverages = Record<number, IndividualTankAverage>;
|
|
||||||
|
|
||||||
export const blitzStarsTankAverages = fetch(
|
|
||||||
'https://www.blitzstars.com/api/tankaverages.json',
|
|
||||||
)
|
|
||||||
.then((response) => response.json())
|
|
||||||
.then((json) => {
|
|
||||||
if (context === 'server') {
|
|
||||||
const partialTankAverages: BlitzStarsTankAverages = {};
|
|
||||||
|
|
||||||
(json as IndividualTankAverage[]).forEach((individualTankAverage) => {
|
|
||||||
partialTankAverages[individualTankAverage.tank_id] =
|
|
||||||
individualTankAverage;
|
|
||||||
});
|
|
||||||
|
|
||||||
return partialTankAverages;
|
|
||||||
} else {
|
|
||||||
return json as BlitzStarsTankAverages;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -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>;
|
||||||
})
|
}),
|
||||||
)
|
)
|
||||||
: []
|
: [],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Client, GatewayIntentBits } from 'discord.js';
|
import { Client, GatewayIntentBits } from "discord.js";
|
||||||
import { interactionCreate } from '../../events/interactionCreate';
|
import { interactionCreate } from "../../events/interactionCreate";
|
||||||
import { ready } from '../../events/ready';
|
import { ready } from "../../events/ready";
|
||||||
|
|
||||||
export const client = new Client({
|
export const client = new Client({
|
||||||
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers],
|
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers],
|
||||||
})
|
})
|
||||||
.on('ready', ready)
|
.on("clientReady", ready)
|
||||||
.on('interactionCreate', interactionCreate);
|
.on("interactionCreate", interactionCreate);
|
||||||
@@ -22,11 +22,11 @@ export function createLocalizedCommand(
|
|||||||
command: string,
|
command: string,
|
||||||
sub?:
|
sub?:
|
||||||
| CreateLocalizedCommandSubcommand[]
|
| CreateLocalizedCommandSubcommand[]
|
||||||
| CreateLocalizedCommandSubcommandGroup[]
|
| CreateLocalizedCommandSubcommandGroup[],
|
||||||
) {
|
) {
|
||||||
const commandPathItem = command.replaceAll(
|
const commandPathItem = command.replaceAll(
|
||||||
"-",
|
"-",
|
||||||
"_"
|
"_",
|
||||||
) as keyof BlitzKitStrings["bot"]["commands"];
|
) as keyof BlitzKitStrings["bot"]["commands"];
|
||||||
const { strings } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
const slashCommand = new SlashCommandBuilder()
|
const slashCommand = new SlashCommandBuilder()
|
||||||
@@ -35,14 +35,14 @@ export function createLocalizedCommand(
|
|||||||
localizationObject(
|
localizationObject(
|
||||||
(strings) => strings.bot.commands[commandPathItem].name,
|
(strings) => strings.bot.commands[commandPathItem].name,
|
||||||
undefined,
|
undefined,
|
||||||
true
|
true,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
.setDescription(strings.bot.commands[commandPathItem].description)
|
.setDescription(strings.bot.commands[commandPathItem].description)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
(strings) => strings.bot.commands[commandPathItem].description
|
(strings) => strings.bot.commands[commandPathItem].description,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (sub) {
|
if (sub) {
|
||||||
@@ -56,7 +56,7 @@ export function createLocalizedCommand(
|
|||||||
}
|
}
|
||||||
).subcommands[subItem.subcommand].name,
|
).subcommands[subItem.subcommand].name,
|
||||||
undefined,
|
undefined,
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
const subcommandDescriptionLocalizations = localizationObject(
|
const subcommandDescriptionLocalizations = localizationObject(
|
||||||
(strings) =>
|
(strings) =>
|
||||||
@@ -64,7 +64,7 @@ export function createLocalizedCommand(
|
|||||||
strings.bot.commands[commandPathItem] as unknown as {
|
strings.bot.commands[commandPathItem] as unknown as {
|
||||||
subcommands: Record<string, { description: string }>;
|
subcommands: Record<string, { description: string }>;
|
||||||
}
|
}
|
||||||
).subcommands[subItem.subcommand].description
|
).subcommands[subItem.subcommand].description,
|
||||||
);
|
);
|
||||||
|
|
||||||
slashCommand.addSubcommand((option) => {
|
slashCommand.addSubcommand((option) => {
|
||||||
@@ -78,7 +78,7 @@ export function createLocalizedCommand(
|
|||||||
strings.bot.commands[commandPathItem] as unknown as {
|
strings.bot.commands[commandPathItem] as unknown as {
|
||||||
subcommands: Record<string, { description: string }>;
|
subcommands: Record<string, { description: string }>;
|
||||||
}
|
}
|
||||||
).subcommands[subItem.subcommand].description
|
).subcommands[subItem.subcommand].description,
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(subcommandDescriptionLocalizations);
|
.setDescriptionLocalizations(subcommandDescriptionLocalizations);
|
||||||
});
|
});
|
||||||
@@ -91,7 +91,7 @@ export function createLocalizedCommand(
|
|||||||
}
|
}
|
||||||
).groups[subItem.group].name,
|
).groups[subItem.group].name,
|
||||||
undefined,
|
undefined,
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
const subcommandDescriptionLocalizations = localizationObject(
|
const subcommandDescriptionLocalizations = localizationObject(
|
||||||
(strings) =>
|
(strings) =>
|
||||||
@@ -99,7 +99,7 @@ export function createLocalizedCommand(
|
|||||||
strings.bot.commands[commandPathItem] as unknown as {
|
strings.bot.commands[commandPathItem] as unknown as {
|
||||||
groups: Record<string, { description: string }>;
|
groups: Record<string, { description: string }>;
|
||||||
}
|
}
|
||||||
).groups[subItem.group].description
|
).groups[subItem.group].description,
|
||||||
);
|
);
|
||||||
|
|
||||||
slashCommand.addSubcommandGroup((option) => {
|
slashCommand.addSubcommandGroup((option) => {
|
||||||
@@ -113,7 +113,7 @@ export function createLocalizedCommand(
|
|||||||
strings.bot.commands[commandPathItem] as unknown as {
|
strings.bot.commands[commandPathItem] as unknown as {
|
||||||
groups: Record<string, { description: string }>;
|
groups: Record<string, { description: string }>;
|
||||||
}
|
}
|
||||||
).groups[subItem.group].description
|
).groups[subItem.group].description,
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(subcommandDescriptionLocalizations);
|
.setDescriptionLocalizations(subcommandDescriptionLocalizations);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { AutocompleteInteraction, CacheType } from 'discord.js';
|
import { AutocompleteInteraction, CacheType } from "discord.js";
|
||||||
import { commands } from '..';
|
import { commands } from "..";
|
||||||
|
|
||||||
export async function handleAutocomplete(
|
export async function handleAutocomplete(
|
||||||
interaction: AutocompleteInteraction<CacheType>,
|
interaction: AutocompleteInteraction<CacheType>,
|
||||||
) {
|
) {
|
||||||
const command = (await commands)[interaction.commandName];
|
const command = commands[interaction.commandName];
|
||||||
|
|
||||||
if (!command) {
|
if (!command) {
|
||||||
console.error(`No command matching ${interaction.commandName} was found.`);
|
console.error(`No command matching ${interaction.commandName} was found.`);
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { ButtonInteraction, CacheType } from 'discord.js';
|
import { ButtonInteraction, CacheType } from "discord.js";
|
||||||
import { commands } from '..';
|
import { commands } from "..";
|
||||||
import { normalizeInteractionReturnable } from '../../../core/discord/normalizeInteractionReturnable';
|
import { normalizeInteractionReturnable } from "../../../core/discord/normalizeInteractionReturnable";
|
||||||
|
|
||||||
export async function handleButton(interaction: ButtonInteraction<CacheType>) {
|
export async function handleButton(interaction: ButtonInteraction<CacheType>) {
|
||||||
await interaction.deferUpdate();
|
await interaction.deferUpdate();
|
||||||
|
|
||||||
const url = new URL(`https://example.com/${interaction.customId}`);
|
const url = new URL(`https://example.com/${interaction.customId}`);
|
||||||
const commandName = url.pathname.split('/')[1];
|
const commandName = url.pathname.split("/")[1];
|
||||||
const button = (await commands)[commandName]?.button;
|
const button = commands[commandName]?.button;
|
||||||
|
|
||||||
if (!button) {
|
if (!button) {
|
||||||
throw new Error(`Button handler not found for "${commandName}"`);
|
throw new Error(`Button handler not found for "${commandName}"`);
|
||||||
@@ -16,7 +16,7 @@ export async function handleButton(interaction: ButtonInteraction<CacheType>) {
|
|||||||
if (interaction.message.interaction?.user.id !== interaction.user.id) {
|
if (interaction.message.interaction?.user.id !== interaction.user.id) {
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
content: 'You are not the author of this command.',
|
content: "You are not the author of this command.",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,12 +17,11 @@ import { translator } from "../../../core/localization/translator";
|
|||||||
import type { Writeable } from "../../../types/writable";
|
import type { Writeable } from "../../../types/writable";
|
||||||
|
|
||||||
export async function handleChatInputCommand(
|
export async function handleChatInputCommand(
|
||||||
interaction: ChatInputCommandInteraction<CacheType>
|
interaction: ChatInputCommandInteraction<CacheType>,
|
||||||
) {
|
) {
|
||||||
await interaction.deferReply();
|
await interaction.deferReply();
|
||||||
|
|
||||||
const awaitedCommands = await commands;
|
const registry = commands[interaction.commandName];
|
||||||
const registry = awaitedCommands[interaction.commandName];
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const returnable = await registry.handler(interaction);
|
const returnable = await registry.handler(interaction);
|
||||||
@@ -36,7 +35,7 @@ export async function handleChatInputCommand(
|
|||||||
if (typeof object === "string") {
|
if (typeof object === "string") {
|
||||||
chunks.push([object]);
|
chunks.push([object]);
|
||||||
} else chunks.at(-1)?.push(object!);
|
} else chunks.at(-1)?.push(object!);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
let index = 0;
|
let index = 0;
|
||||||
@@ -59,7 +58,7 @@ export async function handleChatInputCommand(
|
|||||||
} else if (psa.data.type === "image") {
|
} else if (psa.data.type === "image") {
|
||||||
if (!reply.files) reply.files = [];
|
if (!reply.files) reply.files = [];
|
||||||
(reply.files as Writeable<typeof reply.files>).push(
|
(reply.files as Writeable<typeof reply.files>).push(
|
||||||
new AttachmentBuilder(psa.data.image)
|
new AttachmentBuilder(psa.data.image),
|
||||||
);
|
);
|
||||||
reply.content = reply.content ?? psa.data.title;
|
reply.content = reply.content ?? psa.data.title;
|
||||||
}
|
}
|
||||||
@@ -72,7 +71,7 @@ export async function handleChatInputCommand(
|
|||||||
(
|
(
|
||||||
reply.components[0] as ActionRowBuilder<ButtonBuilder>
|
reply.components[0] as ActionRowBuilder<ButtonBuilder>
|
||||||
).addComponents(
|
).addComponents(
|
||||||
psa.data.links.map(({ title, url }) => buttonLink(url, title))
|
psa.data.links.map(({ title, url }) => buttonLink(url, title)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,7 +102,7 @@ export async function handleChatInputCommand(
|
|||||||
} else if (psa.data.type === "image") {
|
} else if (psa.data.type === "image") {
|
||||||
if (!followUp.files) followUp.files = [];
|
if (!followUp.files) followUp.files = [];
|
||||||
(followUp.files as Writeable<typeof followUp.files>).push(
|
(followUp.files as Writeable<typeof followUp.files>).push(
|
||||||
new AttachmentBuilder(psa.data.image)
|
new AttachmentBuilder(psa.data.image),
|
||||||
);
|
);
|
||||||
followUp.content = followUp.content ?? psa.data.title;
|
followUp.content = followUp.content ?? psa.data.title;
|
||||||
}
|
}
|
||||||
@@ -116,7 +115,7 @@ export async function handleChatInputCommand(
|
|||||||
(
|
(
|
||||||
followUp.components[0] as ActionRowBuilder<ButtonBuilder>
|
followUp.components[0] as ActionRowBuilder<ButtonBuilder>
|
||||||
).addComponents(
|
).addComponents(
|
||||||
psa.data.links.map(({ title, url }) => buttonLink(url, title))
|
psa.data.links.map(({ title, url }) => buttonLink(url, title)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +132,7 @@ export async function handleChatInputCommand(
|
|||||||
new ButtonBuilder()
|
new ButtonBuilder()
|
||||||
.setLabel(strings.bot.common.errors.get_help)
|
.setLabel(strings.bot.common.errors.get_help)
|
||||||
.setURL("https://discord.gg/nDt7AjGJQH")
|
.setURL("https://discord.gg/nDt7AjGJQH")
|
||||||
.setStyle(ButtonStyle.Link)
|
.setStyle(ButtonStyle.Link),
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
if (error instanceof UserError) {
|
if (error instanceof UserError) {
|
||||||
|
|||||||
@@ -72,13 +72,13 @@ interface CommandRegistryImplicit extends CommandRegistryBase {
|
|||||||
interface CommandRegistryExplicit extends CommandRegistryBase {
|
interface CommandRegistryExplicit extends CommandRegistryBase {
|
||||||
handlesInteraction?: false;
|
handlesInteraction?: false;
|
||||||
handler: (
|
handler: (
|
||||||
interaction: ChatInputCommandInteraction<CacheType>
|
interaction: ChatInputCommandInteraction<CacheType>,
|
||||||
) => InteractionReturnable;
|
) => InteractionReturnable;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CommandRegistry = CommandRegistryImplicit | CommandRegistryExplicit;
|
export type CommandRegistry = CommandRegistryImplicit | CommandRegistryExplicit;
|
||||||
|
|
||||||
export const COMMANDS_RAW: Promise<CommandRegistry>[] = [
|
export const commandsArray: Promise<CommandRegistry>[] = [
|
||||||
// auctionCommand,
|
// auctionCommand,
|
||||||
permissionsCommand,
|
permissionsCommand,
|
||||||
debugCommand,
|
debugCommand,
|
||||||
@@ -101,34 +101,28 @@ export const COMMANDS_RAW: Promise<CommandRegistry>[] = [
|
|||||||
replayCommand,
|
replayCommand,
|
||||||
];
|
];
|
||||||
|
|
||||||
export const commands = Promise.allSettled(COMMANDS_RAW).then((rawCommands) => {
|
export const commands: Record<string, CommandRegistry> = {};
|
||||||
return rawCommands.reduce<Record<string, CommandRegistry>>(
|
const commandsFulfilled: CommandRegistry[] = [];
|
||||||
(commands, registry, index) => {
|
|
||||||
|
let index = 0;
|
||||||
|
for (const registry of await Promise.allSettled(commandsArray)) {
|
||||||
if (registry.status === "rejected") {
|
if (registry.status === "rejected") {
|
||||||
console.warn(
|
console.warn(`Command ${index} rejected`, registry.reason);
|
||||||
`Command ${index} failed to load; skipping...`,
|
continue;
|
||||||
registry.reason
|
|
||||||
);
|
|
||||||
return commands;
|
|
||||||
}
|
}
|
||||||
return { ...commands, [registry.value.command.name]: registry.value };
|
|
||||||
},
|
commandsFulfilled.push(registry.value);
|
||||||
{}
|
commands[registry.value.command.name] = registry.value;
|
||||||
);
|
index++;
|
||||||
});
|
}
|
||||||
|
|
||||||
const rest = new REST().setToken(assertSecret(import.meta.env.DISCORD_TOKEN));
|
const rest = new REST().setToken(assertSecret(import.meta.env.DISCORD_TOKEN));
|
||||||
|
const body = commandsFulfilled.map((registry) => registry.command.toJSON());
|
||||||
|
const applicationCommandsRoute = Routes.applicationCommands(
|
||||||
|
assertSecret(import.meta.env.DISCORD_CLIENT_ID),
|
||||||
|
);
|
||||||
|
|
||||||
commands.then((awaitedCommands) => {
|
await rest.put(applicationCommandsRoute, { body });
|
||||||
const body = Object.values(awaitedCommands).map((registry) =>
|
|
||||||
registry.command.toJSON()
|
|
||||||
);
|
|
||||||
|
|
||||||
rest.put(
|
|
||||||
Routes.applicationCommands(assertSecret(import.meta.env.DISCORD_CLIENT_ID)),
|
|
||||||
{ body }
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
export async function interactionCreate(interaction: Interaction<CacheType>) {
|
export async function interactionCreate(interaction: Interaction<CacheType>) {
|
||||||
if (interaction.isAutocomplete()) {
|
if (interaction.isAutocomplete()) {
|
||||||
|
|||||||
+14
-14
@@ -1,27 +1,27 @@
|
|||||||
import { assertSecret } from '@blitzkit/core';
|
import { assertSecret } from "@blitzkit/core";
|
||||||
import { ActivityType, ShardingManager } from 'discord.js';
|
import { ActivityType, ShardingManager } from "discord.js";
|
||||||
import {
|
import {
|
||||||
discoveredIdsDefinitions,
|
discoveredIdsDefinitions,
|
||||||
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),
|
||||||
});
|
});
|
||||||
|
|
||||||
const shards = await manager
|
const shards = await manager
|
||||||
.on('shardCreate', (shard) => {
|
.on("shardCreate", (shard) => {
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
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;
|
||||||
@@ -29,7 +29,7 @@ const interval = setInterval(async () => {
|
|||||||
let users = 0;
|
let users = 0;
|
||||||
|
|
||||||
for (const [, shard] of shards) {
|
for (const [, shard] of shards) {
|
||||||
const guilds = (await shard.fetchClientValue('guilds.cache')) as any;
|
const guilds = (await shard.fetchClientValue("guilds.cache")) as any;
|
||||||
|
|
||||||
servers += guilds.length;
|
servers += guilds.length;
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ const interval = setInterval(async () => {
|
|||||||
for (const guild of client.guilds.cache.values()) {
|
for (const guild of client.guilds.cache.values()) {
|
||||||
try {
|
try {
|
||||||
const botMember = await guild.members.fetch(client.user.id);
|
const botMember = await guild.members.fetch(client.user.id);
|
||||||
await botMember.setNickname('BlitzKit');
|
await botMember.setNickname("BlitzKit");
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -74,8 +74,8 @@ const interval = setInterval(async () => {
|
|||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(
|
console.warn(
|
||||||
'An error occurred when setting up presence, ignoring to keep the process alive',
|
"An error occurred when setting up presence, ignoring to keep the process alive",
|
||||||
error,
|
error,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, 5000);
|
}, 15000);
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { assertSecret } from '@blitzkit/core';
|
import { assertSecret } from "@blitzkit/core";
|
||||||
import { registerProcesses } from '../core/blitzkit/processes';
|
import { registerProcesses } from "../core/blitzkit/processes";
|
||||||
import { client } from '../core/discord/client';
|
import { client } from "../core/discord/client";
|
||||||
|
|
||||||
console.log(`🟡 Launching bot ${client.shard?.ids[0]}`);
|
console.log(`🟡 Launching bot ${client.shard?.ids[0]}`);
|
||||||
|
|
||||||
|
|||||||
+1
-1
Submodule packages/closed updated: 5b4a85d503...45c8f7115c.
@@ -13,7 +13,7 @@
|
|||||||
"@types/bun": "^1.3.1",
|
"@types/bun": "^1.3.1",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@types/lz4js": "^0.2.1",
|
"@types/lz4js": "^0.2.1",
|
||||||
"@types/three": "^0.180.0",
|
"@types/three": "^0.184.1",
|
||||||
"adm-zip": "^0.5.16",
|
"adm-zip": "^0.5.16",
|
||||||
"crc": "^4.3.2",
|
"crc": "^4.3.2",
|
||||||
"dotenv": "^17.2.2",
|
"dotenv": "^17.2.2",
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"lz4js": "^0.2.0",
|
"lz4js": "^0.2.0",
|
||||||
"pickleparser": "^0.2.1",
|
"pickleparser": "^0.2.1",
|
||||||
"protobufjs": "^7.5.4",
|
"protobufjs": "^7.5.4",
|
||||||
"three": "^0.180.0",
|
"three": "^0.184.0",
|
||||||
"ts-proto": "^2.7.7",
|
"ts-proto": "^2.7.7",
|
||||||
"yaml": "^2.8.1"
|
"yaml": "^2.8.1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
return type === ShellType.AP
|
|
||||||
? 1.08
|
? 1.08
|
||||||
: type === ShellType.APCR
|
: type === ShellType.SHELL_TYPE_APCR
|
||||||
? 1.05
|
? 1.05
|
||||||
: type === ShellType.HEAT
|
: type === ShellType.SHELL_TYPE_HEAT
|
||||||
? 1.13
|
? 1.13
|
||||||
: 1.08;
|
: 1.08
|
||||||
|
: 1;
|
||||||
|
const equalizer = (equalize ? equalizerObj?.penetration : undefined) ?? 1;
|
||||||
|
|
||||||
|
return calibrated * equalizer;
|
||||||
}
|
}
|
||||||
@@ -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";
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export function copySign(a: number, b: number) {
|
||||||
|
return b >= 0 ? Math.abs(a) : -Math.abs(a);
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -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: { [key: number]: AverageDefinitionsEntry }, [key, value]: [string, any]) => {
|
||||||
acc[globalThis.Number(key)] = AverageDefinitionsEntry.fromJSON(value);
|
acc[globalThis.Number(key)] = AverageDefinitionsEntry.fromJSON(value);
|
||||||
return acc;
|
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,7 +2,7 @@ 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;
|
||||||
|
|||||||
@@ -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,38 +93,31 @@ 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: BinaryWriter = new BinaryWriter(),
|
|
||||||
): BinaryWriter {
|
|
||||||
if (message.key !== undefined) {
|
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -145,13 +126,9 @@ export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefini
|
|||||||
return writer;
|
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 reader =
|
|
||||||
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
|
||||||
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -183,21 +160,14 @@ export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefini
|
|||||||
|
|
||||||
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
|
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(
|
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||||
assertSet('CamouflageDefinitions_CamouflagesEntry.key', object.key),
|
value: isSet(object.value) ? Camouflage.fromJSON(object.value) : undefined,
|
||||||
),
|
|
||||||
value: Camouflage.fromJSON(
|
|
||||||
assertSet(
|
|
||||||
'CamouflageDefinitions_CamouflagesEntry.value',
|
|
||||||
object.value,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: CamouflageDefinitions_CamouflagesEntry): unknown {
|
toJSON(message: CamouflageDefinitions_CamouflagesEntry): 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) {
|
||||||
@@ -206,40 +176,29 @@ export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefini
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<
|
create<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
|
||||||
I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>,
|
base?: I,
|
||||||
>(base?: I): CamouflageDefinitions_CamouflagesEntry {
|
): CamouflageDefinitions_CamouflagesEntry {
|
||||||
return CamouflageDefinitions_CamouflagesEntry.fromPartial(
|
return CamouflageDefinitions_CamouflagesEntry.fromPartial(base ?? ({} as any));
|
||||||
base ?? ({} as any),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
fromPartial<
|
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
|
||||||
I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>,
|
object: I,
|
||||||
>(object: I): CamouflageDefinitions_CamouflagesEntry {
|
): CamouflageDefinitions_CamouflagesEntry {
|
||||||
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value =
|
message.value = (object.value !== undefined && object.value !== null)
|
||||||
object.value !== undefined && object.value !== null
|
|
||||||
? Camouflage.fromPartial(object.value)
|
? Camouflage.fromPartial(object.value)
|
||||||
: createBaseCamouflage();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseCamouflage(): Camouflage {
|
function createBaseCamouflage(): Camouflage {
|
||||||
return {
|
return { id: 0, name: undefined, tank_name: undefined, tank_name_full: undefined };
|
||||||
id: 0,
|
|
||||||
name: createBaseI18nString(),
|
|
||||||
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)
|
||||||
: createBaseI18nString();
|
: undefined;
|
||||||
message.tank_name =
|
message.tank_name = (object.tank_name !== undefined && object.tank_name !== null)
|
||||||
object.tank_name !== undefined && object.tank_name !== null
|
|
||||||
? I18nString.fromPartial(object.tank_name)
|
? I18nString.fromPartial(object.tank_name)
|
||||||
: undefined;
|
: undefined;
|
||||||
message.tank_name_full =
|
message.tank_name_full = (object.tank_name_full !== undefined && object.tank_name_full !== null)
|
||||||
object.tank_name_full !== undefined && object.tank_name_full !== null
|
|
||||||
? I18nString.fromPartial(object.tank_name_full)
|
? I18nString.fromPartial(object.tank_name_full)
|
||||||
: undefined;
|
: 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>>
|
|
||||||
: T extends { $case: string; value: unknown }
|
|
||||||
? { $case: T['$case']; value?: DeepPartial<T['value']> }
|
|
||||||
: T extends {}
|
|
||||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
||||||
: Partial<T>;
|
: 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,7 +2,7 @@ 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;
|
||||||
|
|||||||
@@ -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: { [key: number]: Consumable }, [key, value]: [string, any]) => {
|
||||||
acc[globalThis.Number(key)] = Consumable.fromJSON(value);
|
acc[globalThis.Number(key)] = Consumable.fromJSON(value);
|
||||||
return acc;
|
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 (
|
break;
|
||||||
object.filter_type?.$case === "ids" &&
|
}
|
||||||
object.filter_type?.value !== undefined &&
|
case "ids": {
|
||||||
object.filter_type?.value !== null
|
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),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (
|
break;
|
||||||
object.filter_type?.$case === "nations" &&
|
}
|
||||||
object.filter_type?.value !== undefined &&
|
case "nations": {
|
||||||
object.filter_type?.value !== null
|
if (object.filter_type?.value !== undefined && object.filter_type?.value !== null) {
|
||||||
) {
|
|
||||||
message.filter_type = {
|
message.filter_type = {
|
||||||
$case: "nations",
|
$case: "nations",
|
||||||
value: ConsumableTankNationFilter.fromPartial(object.filter_type.value),
|
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,7 +2,7 @@ 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;
|
||||||
|
|||||||
@@ -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: string]: EquipmentPreset }, [key, value]: [string, any]) => {
|
||||||
acc[key] = EquipmentPreset.fromJSON(value);
|
acc[key] = EquipmentPreset.fromJSON(value);
|
||||||
return acc;
|
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: { [key: number]: Equipment }, [key, value]: [string, any]) => {
|
||||||
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
|
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
|
||||||
return acc;
|
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,7 +2,7 @@ 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;
|
||||||
|
|||||||
@@ -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,7 +2,7 @@ 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;
|
||||||
|
|||||||
@@ -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: { [key: number]: GameMode }, [key, value]: [string, any]) => {
|
||||||
acc[globalThis.Number(key)] = GameMode.fromJSON(value);
|
acc[globalThis.Number(key)] = GameMode.fromJSON(value);
|
||||||
return acc;
|
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: { [key: number]: GameModeRole }, [key, value]: [string, any]) => {
|
||||||
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
|
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
|
||||||
return acc;
|
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(
|
||||||
|
(acc: { [key: number]: GameModeRole }, [key, value]: [string, GameModeRole]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = GameModeRole.fromPartial(value);
|
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]) => {
|
||||||
|
acc[key] = globalThis.String(value);
|
||||||
return acc;
|
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(
|
||||||
|
(acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[key] = globalThis.String(value);
|
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,7 +2,7 @@ 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;
|
||||||
|
|||||||
@@ -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: { [key: number]: MapDefinition }, [key, value]: [string, any]) => {
|
||||||
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
|
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
|
||||||
return acc;
|
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(
|
||||||
|
(acc: { [key: number]: MapDefinition }, [key, value]: [string, MapDefinition]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = MapDefinition.fromPartial(value);
|
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;
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -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,8 +2,8 @@ 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;
|
||||||
|
|||||||
@@ -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: { [key: number]: Provision }, [key, value]: [string, any]) => {
|
||||||
acc[globalThis.Number(key)] = Provision.fromJSON(value);
|
acc[globalThis.Number(key)] = Provision.fromJSON(value);
|
||||||
return acc;
|
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;
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
case "v1": {
|
||||||
|
if (object.version?.value !== undefined && object.version?.value !== null) {
|
||||||
message.version = { $case: "v1", value: RatingLeaderboardV1.fromPartial(object.version.value) };
|
message.version = { $case: "v1", value: RatingLeaderboardV1.fromPartial(object.version.value) };
|
||||||
}
|
}
|
||||||
if (object.version?.$case === "v2" && object.version?.value !== undefined && object.version?.value !== null) {
|
break;
|
||||||
|
}
|
||||||
|
case "v2": {
|
||||||
|
if (object.version?.value !== undefined && object.version?.value !== null) {
|
||||||
message.version = { $case: "v2", value: RatingLeaderboardV2.fromPartial(object.version.value) };
|
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;
|
||||||
|
|||||||
Loaded 100 of 528 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user