mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-25 03:29:51 +01:00
Compare commits
583
Commits
v1.29.14
...
4e72ea567f
| 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 | ||
|
|
5412c479c8 | ||
|
|
ccb86ae824 | ||
|
|
001709c25c | ||
|
|
e50b8d11bf | ||
|
|
ea782af079 | ||
|
|
0ebf9f6c3d | ||
|
|
6fec467ec8 | ||
|
|
8b0f1cdfed | ||
|
|
f6008bd288 | ||
|
|
1776c8fc15 | ||
|
|
99f41b9805 | ||
|
|
d4f11fc52a | ||
|
|
750aeb39c9 | ||
|
|
0f355bc2fc | ||
|
|
6ebd3063ed | ||
|
|
b070cad92a | ||
|
|
204fbbff59 | ||
|
|
98e7760142 | ||
|
|
6c1c088d44 | ||
|
|
0b7f717057 | ||
|
|
728cb43f05 | ||
|
|
ff02f06cbc | ||
|
|
7a817cbe8c | ||
|
|
58e0876aa0 | ||
|
|
f84f846e76 | ||
|
|
ddb869e767 | ||
|
|
015d457d23 | ||
|
|
ba6a83a9cb | ||
|
|
689985ed93 | ||
|
|
bf9262f1f1 | ||
|
|
821bd363ad | ||
|
|
4a9fc65e71 | ||
|
|
81877f5abd | ||
|
|
01eed3e045 | ||
|
|
7bc423b570 | ||
|
|
dba56f8946 | ||
|
|
c1f765d5f7 | ||
|
|
7f5b5b614f | ||
|
|
5cd149b2b9 | ||
|
|
0bc2d0aaf6 | ||
|
|
1dc9a341d1 | ||
|
|
2ad1e71176 | ||
|
|
ca6973f529 | ||
|
|
323d624ec7 | ||
|
|
49f84db473 | ||
|
|
7399c402af | ||
|
|
cbfcb29691 | ||
|
|
ae616fbaf3 | ||
|
|
35275d4aa8 | ||
|
|
dda63830ec | ||
|
|
79b4f05809 | ||
|
|
b50c47b744 | ||
|
|
f7c6fdd861 | ||
|
|
47b583821e | ||
|
|
369ac113fa | ||
|
|
fc4d8b5ad0 | ||
|
|
72e1cf7d6a | ||
|
|
dd96556e2a | ||
|
|
a7ee51526a | ||
|
|
610b59f4c6 | ||
|
|
63ce327458 | ||
|
|
6ec7a50320 | ||
|
|
60a29ef2e7 | ||
|
|
52c3a0abe0 | ||
|
|
5bbe5c2720 | ||
|
|
c0c6a21e43 | ||
|
|
a7f93698a6 | ||
|
|
1a18058228 | ||
|
|
67024daa25 | ||
|
|
de6137d1a5 | ||
|
|
11e87bd519 | ||
|
|
3b4e089756 | ||
|
|
4a6f5845f9 | ||
|
|
e9684ce033 | ||
|
|
27abf1b0de | ||
|
|
f5f3f70e35 | ||
|
|
2d282a3261 | ||
|
|
a2d0d2d8c0 | ||
|
|
ea412086d4 | ||
|
|
455679a981 | ||
|
|
a21bc6174d | ||
|
|
fae1a89402 | ||
|
|
5a1a0c59f1 | ||
|
|
c98271f783 | ||
|
|
033660c2d9 | ||
|
|
1a639c51e1 | ||
|
|
1366579dd1 | ||
|
|
f5ed2c2c40 | ||
|
|
1598de9f5f | ||
|
|
6f47f5cc99 | ||
|
|
1117dcb935 | ||
|
|
01a58f9aa8 | ||
|
|
9096644d51 | ||
|
|
d42fc0e3f6 | ||
|
|
17d1526b6f | ||
|
|
db8ac195d4 | ||
|
|
c5f5f69fd6 | ||
|
|
44203223fd | ||
|
|
bdabadcd49 | ||
|
|
220e4388d4 | ||
|
|
51b2d1ce86 | ||
|
|
f3c1825c57 | ||
|
|
359dfcd102 | ||
|
|
649cdd893f | ||
|
|
0cb974acf5 | ||
|
|
9bca5dccc7 | ||
|
|
d707f1cc5d | ||
|
|
4ed4395535 | ||
|
|
0209d48475 | ||
|
|
437bee4a85 | ||
|
|
4b8e73fa57 | ||
|
|
b96f925d9a | ||
|
|
1551dc50fd | ||
|
|
daf4cef61c | ||
|
|
496e127f64 | ||
|
|
da1af66c77 | ||
|
|
01409985a2 | ||
|
|
a86ac0619a | ||
|
|
385d165512 | ||
|
|
fcfc97b964 | ||
|
|
53d05e73a6 | ||
|
|
40a1eb861d | ||
|
|
1d3cb95b89 | ||
|
|
010303a818 | ||
|
|
7281b9fed0 | ||
|
|
c5785c7ae6 | ||
|
|
698731cb9a | ||
|
|
99bae8f2c5 | ||
|
|
5034ec1aa0 | ||
|
|
be821c1f8b | ||
|
|
a364b79a9b | ||
|
|
0aa6e1e79a | ||
|
|
d2a6379131 | ||
|
|
07ce61d19f | ||
|
|
ad9f2d8609 | ||
|
|
57702d8a43 | ||
|
|
9a30af3818 | ||
|
|
23751fbdf3 | ||
|
|
db6d181f78 | ||
|
|
56ca4dcc61 | ||
|
|
d08b537721 | ||
|
|
c1a2edb489 | ||
|
|
164b7fa454 | ||
|
|
428483cf4c | ||
|
|
89f02eb399 | ||
|
|
4ce127516c | ||
|
|
6f4f487dfe | ||
|
|
57dd60e804 | ||
|
|
d24fd2250c | ||
|
|
e00bcdfc06 | ||
|
|
67dd204ee6 | ||
|
|
e130583fa4 | ||
|
|
6ad20a0fcf | ||
|
|
9fad644d7a | ||
|
|
8cb523dd06 | ||
|
|
b50ee23a26 | ||
|
|
a973cf699b | ||
|
|
102abf49c4 | ||
|
|
8929e503ea | ||
|
|
a2a794eb74 | ||
|
|
2e95f5dd95 | ||
|
|
23a42230cb | ||
|
|
e66daed7ae | ||
|
|
f2d0f68f07 | ||
|
|
be4af0bf84 | ||
|
|
15172e8b33 | ||
|
|
c6b7918525 | ||
|
|
4f1c4421e5 | ||
|
|
7b830f5a71 | ||
|
|
6ce1135835 | ||
|
|
66eaaef6de | ||
|
|
48fbf59036 | ||
|
|
0e0f4fbe9f | ||
|
|
6ba6e10108 | ||
|
|
cf8fa4ffb4 | ||
|
|
2b0180dce2 | ||
|
|
caee848a47 | ||
|
|
d01b7cf707 | ||
|
|
8921f84c38 | ||
|
|
6830df01fa | ||
|
|
67da59ef41 | ||
|
|
036cc9915d | ||
|
|
57b6ba19f0 | ||
|
|
32b5593d07 | ||
|
|
3b757562d2 | ||
|
|
4c8c2d0868 | ||
|
|
b2f266401f | ||
|
|
5541eca23d | ||
|
|
122d65840e | ||
|
|
ed4b72d85c | ||
|
|
4033e8618f | ||
|
|
42cada1811 | ||
|
|
ff7ed213c8 | ||
|
|
a0367af06b | ||
|
|
58c2965c53 | ||
|
|
edae41409a | ||
|
|
383d3a36ef | ||
|
|
6a958da390 | ||
|
|
ef154f99d5 | ||
|
|
4a20102de3 | ||
|
|
4e170f2917 | ||
|
|
a70d788f6b |
No files matched your search
@@ -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
-257
@@ -1,257 +0,0 @@
|
|||||||
{
|
|
||||||
"cSpell.words": [
|
|
||||||
"AABBOX",
|
|
||||||
"Abhi",
|
|
||||||
"absarc",
|
|
||||||
"accountinfo",
|
|
||||||
"adsense",
|
|
||||||
"aeson",
|
|
||||||
"alphatest",
|
|
||||||
"analyticsdata",
|
|
||||||
"analyticsreporting",
|
|
||||||
"APAC",
|
|
||||||
"apcr",
|
|
||||||
"appinfo",
|
|
||||||
"applypatches",
|
|
||||||
"artefacts",
|
|
||||||
"astrojs",
|
|
||||||
"astrolib",
|
|
||||||
"atgm",
|
|
||||||
"autocrop",
|
|
||||||
"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,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
-37
@@ -1,51 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "blitzkit",
|
"name": "blitzkit",
|
||||||
"version": "1.29.14",
|
"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 --dev",
|
|
||||||
"start:bot": "bun dist/bot/main.js",
|
|
||||||
"dev:docs": "vitepress dev docs",
|
|
||||||
"dev:website": "cd packages/website && bun run dev",
|
|
||||||
"dev:app": "cd packages/app && bun run dev",
|
|
||||||
"dev": "bun run dev:website",
|
|
||||||
"dev: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",
|
|
||||||
"sharp": "^0.34.5",
|
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ export const ownedTanksCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
tankStats.map(async (tankData) => ({
|
tankStats.map(async (tankData) => ({
|
||||||
tankDefinitions: (await tankDefinitions).tanks[tankData.tank_id]!,
|
tankDefinitions: (await tankDefinitions).tanks[tankData.tank_id]!,
|
||||||
id: tankData.tank_id,
|
id: tankData.tank_id,
|
||||||
}))
|
})),
|
||||||
)
|
)
|
||||||
).filter((tank) => tank.tankDefinitions?.tier === tier);
|
).filter((tank) => tank.tankDefinitions?.tier === tier);
|
||||||
const groupedTanks: Record<string, TankDefinition[]> = {};
|
const groupedTanks: Record<string, TankDefinition[]> = {};
|
||||||
@@ -69,16 +69,16 @@ export const ownedTanksCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
.filter((tank) => tank.tier === tier)
|
.filter((tank) => tank.tier === tier)
|
||||||
.sort(
|
.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
TANK_CLASSES.indexOf(a.class) - TANK_CLASSES.indexOf(b.class)
|
TANK_CLASSES.indexOf(a.class) - TANK_CLASSES.indexOf(b.class),
|
||||||
)
|
)
|
||||||
.sort(
|
.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
awaitedGameDefinitions.nations.indexOf(a.nation) -
|
awaitedGameDefinitions.nations.indexOf(a.nation) -
|
||||||
awaitedGameDefinitions.nations.indexOf(b.nation)
|
awaitedGameDefinitions.nations.indexOf(b.nation),
|
||||||
)
|
)
|
||||||
.map(
|
.map(
|
||||||
(tank) =>
|
(tank) =>
|
||||||
`[${flags[tank.nation]} ${markdownEscape(unwrap(tank.name))}](<https://blitzkit.app/tanks/${tank.slug}>)`
|
`[${flags[tank.nation]} ${markdownEscape(unwrap(tank.name!))}](<https://blitzkit.app/tanks/${tank.slug}>)`,
|
||||||
);
|
);
|
||||||
const lines = [title, ...tankList];
|
const lines = [title, ...tankList];
|
||||||
|
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ async function playerListing(
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
alt={unwrap(tank.name)}
|
alt={unwrap(tank.name!)}
|
||||||
src={await iconPng(tankIcon(tank.id))}
|
src={await iconPng(tankIcon(tank.id))}
|
||||||
style={{
|
style={{
|
||||||
width: 32,
|
width: 32,
|
||||||
@@ -317,7 +317,7 @@ async function playerListing(
|
|||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{unwrap(tank.name)}
|
{unwrap(tank.name!)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -35,49 +35,49 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
command: createLocalizedCommand("research")
|
command: createLocalizedCommand("research")
|
||||||
.addStringOption((option) =>
|
.addStringOption((option) =>
|
||||||
option
|
option
|
||||||
.setName(strings.bot.commands.research.options.target_tank.name)
|
.setName(strings.bot.commands.research.options.target_tank.name!)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
(strings) =>
|
(strings) =>
|
||||||
strings.bot.commands.research.options.target_tank.name,
|
strings.bot.commands.research.options.target_tank.name,
|
||||||
undefined,
|
undefined,
|
||||||
true
|
true,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
strings.bot.commands.research.options.target_tank.description
|
strings.bot.commands.research.options.target_tank.description,
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
(strings) =>
|
(strings) =>
|
||||||
strings.bot.commands.research.options.target_tank.description
|
strings.bot.commands.research.options.target_tank.description,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
.setAutocomplete(true)
|
.setAutocomplete(true)
|
||||||
.setRequired(true)
|
.setRequired(true),
|
||||||
)
|
)
|
||||||
.addStringOption((option) =>
|
.addStringOption((option) =>
|
||||||
option
|
option
|
||||||
.setName(strings.bot.commands.research.options.starting_tank.name)
|
.setName(strings.bot.commands.research.options.starting_tank.name!)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
(strings) =>
|
(strings) =>
|
||||||
strings.bot.commands.research.options.starting_tank.name,
|
strings.bot.commands.research.options.starting_tank.name,
|
||||||
undefined,
|
undefined,
|
||||||
true
|
true,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
strings.bot.commands.research.options.starting_tank.description
|
strings.bot.commands.research.options.starting_tank.description,
|
||||||
)
|
)
|
||||||
.setDescriptionLocalizations(
|
.setDescriptionLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
(strings) =>
|
(strings) =>
|
||||||
strings.bot.commands.research.options.starting_tank.description
|
strings.bot.commands.research.options.starting_tank.description,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
.setAutocomplete(true)
|
.setAutocomplete(true)
|
||||||
.setRequired(false)
|
.setRequired(false),
|
||||||
)
|
)
|
||||||
.addStringOption(addUsernameChoices),
|
.addStringOption(addUsernameChoices),
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
const targetTankId = await resolveTankId(
|
const targetTankId = await resolveTankId(
|
||||||
interaction.options.getString("target-tank", true),
|
interaction.options.getString("target-tank", true),
|
||||||
interaction.locale,
|
interaction.locale,
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
const startingTankRaw = interaction.options.getString("starting-tank");
|
const startingTankRaw = interaction.options.getString("starting-tank");
|
||||||
const targetTank = awaitedTankDefinitions.tanks[targetTankId];
|
const targetTank = awaitedTankDefinitions.tanks[targetTankId];
|
||||||
@@ -99,13 +99,13 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
startingTankId = await resolveTankId(
|
startingTankId = await resolveTankId(
|
||||||
startingTankRaw,
|
startingTankRaw,
|
||||||
interaction.locale,
|
interaction.locale,
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (targetTankId === startingTankId) {
|
if (targetTankId === startingTankId) {
|
||||||
return literals(
|
return literals(
|
||||||
strings.bot.commands.research.errors.start_end_equal,
|
strings.bot.commands.research.errors.start_end_equal,
|
||||||
{ tank: escapeMarkdown(unwrap(targetTank.name)) }
|
{ tank: escapeMarkdown(unwrap(targettank.name!)) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,8 +113,8 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
|
|
||||||
if (startingTank.tier > targetTank.tier) {
|
if (startingTank.tier > targetTank.tier) {
|
||||||
return literals(strings.bot.commands.research.errors.unordered, {
|
return literals(strings.bot.commands.research.errors.unordered, {
|
||||||
tank_1: escapeMarkdown(unwrap(startingTank.name)),
|
tank_1: escapeMarkdown(unwrap(startingtank.name!)),
|
||||||
tank_2: escapeMarkdown(unwrap(targetTank.name)),
|
tank_2: escapeMarkdown(unwrap(targettank.name!)),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,21 +122,21 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
return literals(
|
return literals(
|
||||||
strings.bot.commands.research.errors.tanks_not_on_line,
|
strings.bot.commands.research.errors.tanks_not_on_line,
|
||||||
{
|
{
|
||||||
tank_1: escapeMarkdown(unwrap(targetTank.name)),
|
tank_1: escapeMarkdown(unwrap(targettank.name!)),
|
||||||
tank_2: escapeMarkdown(unwrap(startingTank.name)),
|
tank_2: escapeMarkdown(unwrap(startingtank.name!)),
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (targetTank.type !== TankType.RESEARCHABLE) {
|
if (targetTank.type !== TankType.TANK_TYPE_RESEARCHABLE) {
|
||||||
return literals(strings.bot.commands.research.errors.non_tech_tree, {
|
return literals(strings.bot.commands.research.errors.non_tech_tree, {
|
||||||
tank: escapeMarkdown(unwrap(targetTank.name)),
|
tank: escapeMarkdown(unwrap(targettank.name!)),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetTank.tier === 1) {
|
if (targetTank.tier === 1) {
|
||||||
return literals(strings.bot.commands.research.errors.tier_1, {
|
return literals(strings.bot.commands.research.errors.tier_1, {
|
||||||
tank: escapeMarkdown(unwrap(targetTank.name)),
|
tank: escapeMarkdown(unwrap(targettank.name!)),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,14 +149,14 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
if (tankStats.some(({ tank_id }) => tank_id === targetTankId)) {
|
if (tankStats.some(({ tank_id }) => tank_id === targetTankId)) {
|
||||||
return literals(
|
return literals(
|
||||||
strings.bot.commands.research.errors.already_researched,
|
strings.bot.commands.research.errors.already_researched,
|
||||||
{ tank: escapeMarkdown(unwrap(targetTank.name)) }
|
{ tank: escapeMarkdown(unwrap(targettank.name!)) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const foundAncestor = targetTankAncestry.find(
|
const foundAncestor = targetTankAncestry.find(
|
||||||
(id) =>
|
(id) =>
|
||||||
awaitedTankDefinitions.tanks[id].tier === 1 ||
|
awaitedTankDefinitions.tanks[id].tier === 1 ||
|
||||||
tankStats.some(({ tank_id }) => tank_id === id)
|
tankStats.some(({ tank_id }) => tank_id === id),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (foundAncestor === undefined) {
|
if (foundAncestor === undefined) {
|
||||||
@@ -168,7 +168,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
|
|
||||||
const techTreeLine = await buildTechTreeLine(
|
const techTreeLine = await buildTechTreeLine(
|
||||||
startingTankId,
|
startingTankId,
|
||||||
targetTankId
|
targetTankId,
|
||||||
);
|
);
|
||||||
|
|
||||||
const line = [...techTreeLine, startingTankId].reverse();
|
const line = [...techTreeLine, startingTankId].reverse();
|
||||||
@@ -190,7 +190,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
) {
|
) {
|
||||||
turretXps.set(
|
turretXps.set(
|
||||||
turret.id,
|
turret.id,
|
||||||
turret.research_cost.research_cost_type!.value
|
turret.research_cost.research_cost_type!.value,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
) {
|
) {
|
||||||
engineXps.set(
|
engineXps.set(
|
||||||
engine.id,
|
engine.id,
|
||||||
engine.research_cost.research_cost_type!.value
|
engine.research_cost.research_cost_type!.value,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -223,7 +223,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
) {
|
) {
|
||||||
trackXps.set(
|
trackXps.set(
|
||||||
track.id,
|
track.id,
|
||||||
track.research_cost.research_cost_type!.value
|
track.research_cost.research_cost_type!.value,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -245,13 +245,13 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
return {
|
return {
|
||||||
research: tank.research_cost!.research_cost_type!.value as number,
|
research: tank.research_cost!.research_cost_type!.value as number,
|
||||||
upgrades: moduleXp,
|
upgrades: moduleXp,
|
||||||
purchase: tank.price.value,
|
purchase: tank.price!.value,
|
||||||
equipment: equipmentPriceMatrix[tank.tier].reduce(
|
equipment: equipmentPriceMatrix[tank.tier].reduce(
|
||||||
(a, b) => a + 3 * b,
|
(a, b) => a + 3 * b,
|
||||||
0
|
0,
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
const image = (
|
const image = (
|
||||||
@@ -456,7 +456,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
alt={unwrap(tank.name)}
|
alt={unwrap(tank.name!)}
|
||||||
src={TANK_ICONS[tank.class]}
|
src={TANK_ICONS[tank.class]}
|
||||||
width={16}
|
width={16}
|
||||||
height={16}
|
height={16}
|
||||||
@@ -467,7 +467,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
color: theme.colors.textHighContrast,
|
color: theme.colors.textHighContrast,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{unwrap(tank.name)}
|
{unwrap(tank.name!)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -505,9 +505,9 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
strings.bot.commands.research.body.research,
|
strings.bot.commands.research.body.research,
|
||||||
{
|
{
|
||||||
cost: costs[index].research?.toLocaleString(
|
cost: costs[index].research?.toLocaleString(
|
||||||
interaction.locale
|
interaction.locale,
|
||||||
),
|
),
|
||||||
}
|
},
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -523,7 +523,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
<img
|
<img
|
||||||
alt="Free XP icon"
|
alt="Free XP icon"
|
||||||
src={await iconPng(
|
src={await iconPng(
|
||||||
asset("icons/currencies/free-xp.webp")
|
asset("icons/currencies/free-xp.webp"),
|
||||||
)}
|
)}
|
||||||
width={16}
|
width={16}
|
||||||
height={16}
|
height={16}
|
||||||
@@ -536,7 +536,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
>
|
>
|
||||||
{literals(
|
{literals(
|
||||||
strings.bot.commands.research.body.upgrades,
|
strings.bot.commands.research.body.upgrades,
|
||||||
{ cost: costs[index].upgrades.toLocaleString() }
|
{ cost: costs[index].upgrades.toLocaleString() },
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -552,7 +552,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
<img
|
<img
|
||||||
alt="Silver icon"
|
alt="Silver icon"
|
||||||
src={await iconPng(
|
src={await iconPng(
|
||||||
asset("icons/currencies/silver.webp")
|
asset("icons/currencies/silver.webp"),
|
||||||
)}
|
)}
|
||||||
width={16}
|
width={16}
|
||||||
height={16}
|
height={16}
|
||||||
@@ -567,9 +567,9 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
strings.bot.commands.research.body.purchase,
|
strings.bot.commands.research.body.purchase,
|
||||||
{
|
{
|
||||||
cost: costs[index].purchase.toLocaleString(
|
cost: costs[index].purchase.toLocaleString(
|
||||||
interaction.locale
|
interaction.locale,
|
||||||
),
|
),
|
||||||
}
|
},
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -584,7 +584,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
<img
|
<img
|
||||||
alt="Silver icon"
|
alt="Silver icon"
|
||||||
src={await iconPng(
|
src={await iconPng(
|
||||||
asset("icons/currencies/silver.webp")
|
asset("icons/currencies/silver.webp"),
|
||||||
)}
|
)}
|
||||||
width={16}
|
width={16}
|
||||||
height={16}
|
height={16}
|
||||||
@@ -599,16 +599,16 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
strings.bot.commands.research.body.equipment,
|
strings.bot.commands.research.body.equipment,
|
||||||
{
|
{
|
||||||
cost: costs[index].equipment.toLocaleString(
|
cost: costs[index].equipment.toLocaleString(
|
||||||
interaction.locale
|
interaction.locale,
|
||||||
),
|
),
|
||||||
}
|
},
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})
|
}),
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</CommandWrapper>
|
</CommandWrapper>
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import {
|
|||||||
TankClass,
|
TankClass,
|
||||||
TankType,
|
TankType,
|
||||||
TREE_TYPE_ICONS,
|
TREE_TYPE_ICONS,
|
||||||
} from '@blitzkit/core';
|
} from "@blitzkit/core";
|
||||||
import { createColors } from 'bepaint';
|
import { createColors } from "bepaint";
|
||||||
import {
|
import {
|
||||||
type AccentColor,
|
type AccentColor,
|
||||||
type GrayColor,
|
type GrayColor,
|
||||||
PALETTES,
|
PALETTES,
|
||||||
} from '../../../core/radix/radixColors';
|
} from "../../../core/radix/radixColors";
|
||||||
import { RowStat } from './RowStat';
|
import { RowStat } from "./RowStat";
|
||||||
|
|
||||||
export interface RowStatItem {
|
export interface RowStatItem {
|
||||||
title: string;
|
title: string;
|
||||||
@@ -21,7 +21,7 @@ export interface RowStatItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface RowProps {
|
interface RowProps {
|
||||||
displayType?: 'tank' | 'summary';
|
displayType?: "tank" | "summary";
|
||||||
naked?: boolean;
|
naked?: boolean;
|
||||||
title: string;
|
title: string;
|
||||||
minimized?: boolean;
|
minimized?: boolean;
|
||||||
@@ -32,7 +32,7 @@ interface RowProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function Row({
|
export function Row({
|
||||||
color = 'slate',
|
color = "slate",
|
||||||
stats,
|
stats,
|
||||||
title,
|
title,
|
||||||
minimized,
|
minimized,
|
||||||
@@ -49,20 +49,20 @@ export function Row({
|
|||||||
className="session-tracker-row"
|
className="session-tracker-row"
|
||||||
style={{
|
style={{
|
||||||
maxWidth: naked ? 600 : Infinity,
|
maxWidth: naked ? 600 : Infinity,
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
flexDirection: 'column',
|
flexDirection: "column",
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
backgroundColor: naked
|
backgroundColor: naked
|
||||||
? `${theme.appBackground2}c0`
|
? `${theme.appBackground2}c0`
|
||||||
: theme.appBackground2,
|
: theme.appBackground2,
|
||||||
overflow: 'hidden',
|
overflow: "hidden",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
justifyContent: 'center',
|
justifyContent: "center",
|
||||||
padding: 8,
|
padding: 8,
|
||||||
gap: 4,
|
gap: 4,
|
||||||
backgroundColor: naked
|
backgroundColor: naked
|
||||||
@@ -70,10 +70,14 @@ export function Row({
|
|||||||
: theme.componentInteractive,
|
: theme.componentInteractive,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{displayType === 'tank' && tankClass !== undefined && (
|
{displayType === "tank" && tankClass !== undefined && (
|
||||||
<img
|
<img
|
||||||
alt={TankClass[tankClass]}
|
alt={TankClass[tankClass]}
|
||||||
src={TREE_TYPE_ICONS[type ?? TankType.RESEARCHABLE][tankClass]}
|
src={
|
||||||
|
TREE_TYPE_ICONS[type ?? TankType.TANK_TYPE_RESEARCHABLE][
|
||||||
|
tankClass
|
||||||
|
]
|
||||||
|
}
|
||||||
style={{ width: 16, height: 16 }}
|
style={{ width: 16, height: 16 }}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -81,10 +85,10 @@ export function Row({
|
|||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
color:
|
color:
|
||||||
displayType === 'tank'
|
displayType === "tank"
|
||||||
? type === TankType.COLLECTOR
|
? type === TankType.TANK_TYPE_COLLECTOR
|
||||||
? theme.textLowContrast_blue
|
? theme.textLowContrast_blue
|
||||||
: type === TankType.PREMIUM
|
: type === TankType.TANK_TYPE_PREMIUM
|
||||||
? theme.textLowContrast_amber
|
? theme.textLowContrast_amber
|
||||||
: theme.textHighContrast
|
: theme.textHighContrast
|
||||||
: theme.textLowContrast,
|
: theme.textLowContrast,
|
||||||
@@ -98,7 +102,7 @@ export function Row({
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
paddingTop: 8,
|
paddingTop: 8,
|
||||||
paddingBottom: 8,
|
paddingBottom: 8,
|
||||||
}}
|
}}
|
||||||
@@ -109,8 +113,8 @@ export function Row({
|
|||||||
<RowStat
|
<RowStat
|
||||||
minimized={minimized}
|
minimized={minimized}
|
||||||
key={index}
|
key={index}
|
||||||
name={`${row.title} • ${row.career ?? '--'}`}
|
name={`${row.title} • ${row.career ?? "--"}`}
|
||||||
value={row.current ?? '--'}
|
value={row.current ?? "--"}
|
||||||
delta={row.delta}
|
delta={row.delta}
|
||||||
percentile={row.percentile}
|
percentile={row.percentile}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { TankClass, TankType, TREE_TYPE_ICONS } from '@blitzkit/core';
|
import { TankClass, TankType, TREE_TYPE_ICONS } from "@blitzkit/core";
|
||||||
import { theme } from '../../../../stitches.config';
|
import { theme } from "../../../../stitches.config";
|
||||||
|
|
||||||
export interface ItemProps {
|
export interface ItemProps {
|
||||||
tankClass?: TankClass;
|
tankClass?: TankClass;
|
||||||
@@ -8,9 +8,9 @@ export interface ItemProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const TREE_TYPE_COLOR = {
|
const TREE_TYPE_COLOR = {
|
||||||
[TankType.RESEARCHABLE]: '',
|
[TankType.TANK_TYPE_RESEARCHABLE]: "",
|
||||||
[TankType.PREMIUM]: '_amber',
|
[TankType.TANK_TYPE_PREMIUM]: "_amber",
|
||||||
[TankType.COLLECTOR]: '_blue',
|
[TankType.TANK_TYPE_COLLECTOR]: "_blue",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export function Item({
|
export function Item({
|
||||||
@@ -21,12 +21,12 @@ export function Item({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
height: 32,
|
height: 32,
|
||||||
paddingLeft: 8,
|
paddingLeft: 8,
|
||||||
paddingRight: 8,
|
paddingRight: 8,
|
||||||
overflow: 'hidden',
|
overflow: "hidden",
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
theme.colors[`componentInteractive${TREE_TYPE_COLOR[treeType]}`],
|
theme.colors[`componentInteractive${TREE_TYPE_COLOR[treeType]}`],
|
||||||
@@ -34,12 +34,12 @@ export function Item({
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
gap: 4,
|
gap: 4,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
alignItems: 'center',
|
alignItems: "center",
|
||||||
justifyContent: 'flex-start',
|
justifyContent: "flex-start",
|
||||||
overflow: 'hidden',
|
overflow: "hidden",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{tankType && (
|
{tankType && (
|
||||||
@@ -52,7 +52,7 @@ export function Item({
|
|||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: "nowrap",
|
||||||
color: theme.colors[`textLowContrast${TREE_TYPE_COLOR[treeType]}`],
|
color: theme.colors[`textLowContrast${TREE_TYPE_COLOR[treeType]}`],
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -6,21 +6,21 @@ import { translator } from "../localization/translator";
|
|||||||
|
|
||||||
export async function filtersToDescription(
|
export async function filtersToDescription(
|
||||||
{ nation, tier, type, class: tankClass, tank }: StatFilters,
|
{ nation, tier, type, class: tankClass, tank }: StatFilters,
|
||||||
locale: Locale
|
locale: Locale,
|
||||||
) {
|
) {
|
||||||
const { strings, bkLocale } = translator(locale);
|
const { strings, bkLocale } = translator(locale);
|
||||||
const awaitedTankDefinitions = await fetchTankDefinitions();
|
const awaitedTankDefinitions = await fetchTankDefinitions();
|
||||||
const info: string[] = [];
|
const info: string[] = [];
|
||||||
|
|
||||||
// TODO: somehow localize tank names?
|
// TODO: somehow localize tank names?
|
||||||
if (tank) return awaitedTankDefinitions.tanks[tank].name.locales[bkLocale];
|
if (tank) return awaitedTankDefinitions.tanks[tank].name!.locales[bkLocale];
|
||||||
if (nation)
|
if (nation)
|
||||||
info.push((strings.common.nations as Record<string, string>)[nation]);
|
info.push((strings.common.nations as Record<string, string>)[nation]);
|
||||||
if (tier) {
|
if (tier) {
|
||||||
info.push(
|
info.push(
|
||||||
literals(strings.bot.common.filters.tier, {
|
literals(strings.bot.common.filters.tier, {
|
||||||
tier: TIER_ROMAN_NUMERALS[tier],
|
tier: TIER_ROMAN_NUMERALS[tier],
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (tankClass) info.push(strings.common.tank_class_short[tankClass]);
|
if (tankClass) info.push(strings.common.tank_class_short[tankClass]);
|
||||||
|
|||||||
@@ -34,12 +34,12 @@ export async function filterStats(
|
|||||||
(filters.tier === undefined || entry.tier === filters.tier) &&
|
(filters.tier === undefined || entry.tier === filters.tier) &&
|
||||||
(filters.class === undefined || entry.class === filters.class) &&
|
(filters.class === undefined || entry.class === filters.class) &&
|
||||||
(filters.type === undefined ||
|
(filters.type === undefined ||
|
||||||
(filters.type === TankType.COLLECTOR &&
|
(filters.type === TankType.TANK_TYPE_COLLECTOR &&
|
||||||
entry.type === TankType.COLLECTOR) ||
|
entry.type === TankType.TANK_TYPE_COLLECTOR) ||
|
||||||
(filters.type === TankType.PREMIUM &&
|
(filters.type === TankType.TANK_TYPE_PREMIUM &&
|
||||||
entry.type === TankType.PREMIUM) ||
|
entry.type === TankType.TANK_TYPE_PREMIUM) ||
|
||||||
(filters.type === TankType.RESEARCHABLE &&
|
(filters.type === TankType.TANK_TYPE_RESEARCHABLE &&
|
||||||
entry.type === TankType.RESEARCHABLE)) &&
|
entry.type === TankType.TANK_TYPE_RESEARCHABLE)) &&
|
||||||
(filters.tank === undefined || entry.id === filters.tank)
|
(filters.tank === undefined || entry.id === filters.tank)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { Locale, SlashCommandStringOption } from 'discord.js';
|
import { Locale, SlashCommandStringOption } from "discord.js";
|
||||||
import { translator } from '../localization/translator';
|
import { translator } from "../localization/translator";
|
||||||
import { localizationObject } from './localizationObject';
|
import { localizationObject } from "./localizationObject";
|
||||||
|
|
||||||
export function addTankChoices(option: SlashCommandStringOption) {
|
export function addTankChoices(option: SlashCommandStringOption) {
|
||||||
const { strings } = translator(Locale.EnglishUS);
|
const { strings } = translator(Locale.EnglishUS);
|
||||||
|
|
||||||
return option
|
return option
|
||||||
.setName(strings.bot.common.options.tank.name)
|
.setName(strings.bot.common.options.tank.name!)
|
||||||
.setNameLocalizations(
|
.setNameLocalizations(
|
||||||
localizationObject(
|
localizationObject(
|
||||||
(strings) => strings.bot.common.options.tank.name,
|
(strings) => strings.bot.common.options.tank.name,
|
||||||
|
|||||||
@@ -13,13 +13,13 @@ import {
|
|||||||
} from "./autocompleteClan/constants";
|
} from "./autocompleteClan/constants";
|
||||||
|
|
||||||
export const tankNamesTechTreeOnly = fetchTankNames().then((names) =>
|
export const tankNamesTechTreeOnly = fetchTankNames().then((names) =>
|
||||||
names.filter((tank) => tank.treeType === TankType.RESEARCHABLE)
|
names.filter((tank) => tank.treeType === TankType.TANK_TYPE_RESEARCHABLE),
|
||||||
);
|
);
|
||||||
|
|
||||||
export async function autocompleteTanks(
|
export async function autocompleteTanks(
|
||||||
interaction: AutocompleteInteraction<CacheType>,
|
interaction: AutocompleteInteraction<CacheType>,
|
||||||
techTreeOnly = false,
|
techTreeOnly = false,
|
||||||
fields = ["tank"]
|
fields = ["tank"],
|
||||||
) {
|
) {
|
||||||
const { unwrap } = translator(interaction.locale);
|
const { unwrap } = translator(interaction.locale);
|
||||||
const focusedOption = interaction.options.getFocused(true);
|
const focusedOption = interaction.options.getFocused(true);
|
||||||
@@ -31,7 +31,7 @@ export async function autocompleteTanks(
|
|||||||
go(
|
go(
|
||||||
focusedOption.value,
|
focusedOption.value,
|
||||||
await (techTreeOnly ? tankNamesTechTreeOnly : tankNames),
|
await (techTreeOnly ? tankNamesTechTreeOnly : tankNames),
|
||||||
{ keys: SEARCH_KEYS, limit: 10 }
|
{ keys: SEARCH_KEYS, limit: 10 },
|
||||||
).map(async (item) => {
|
).map(async (item) => {
|
||||||
let name = unwrap(item.obj.searchableName);
|
let name = unwrap(item.obj.searchableName);
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ export async function autocompleteTanks(
|
|||||||
0,
|
0,
|
||||||
unwrap(item.obj.searchableName).length -
|
unwrap(item.obj.searchableName).length -
|
||||||
overSize -
|
overSize -
|
||||||
OVERFLOW_SUFFIX.length
|
OVERFLOW_SUFFIX.length,
|
||||||
)}${OVERFLOW_SUFFIX}`;
|
)}${OVERFLOW_SUFFIX}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,8 +50,8 @@ export async function autocompleteTanks(
|
|||||||
name,
|
name,
|
||||||
value: `${item.obj.id}`,
|
value: `${item.obj.id}`,
|
||||||
} satisfies ApplicationCommandOptionChoiceData<string>;
|
} satisfies ApplicationCommandOptionChoiceData<string>;
|
||||||
})
|
}),
|
||||||
)
|
)
|
||||||
: []
|
: [],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
+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;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/reviews.proto
|
// source: reviews.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
@@ -28,13 +28,13 @@ export interface Video {
|
|||||||
author: string;
|
author: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseReviews(): Reviews {
|
function createBaseReviews(): Reviews {
|
||||||
return { reviews: {} };
|
return { reviews: {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Reviews: MessageFns<Reviews> = {
|
export const Reviews: MessageFns<Reviews> = {
|
||||||
encode(message: Reviews, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: Reviews, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
Object.entries(message.reviews).forEach(([key, value]) => {
|
globalThis.Object.entries(message.reviews).forEach(([key, value]: [string, Review]) => {
|
||||||
Reviews_ReviewsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
Reviews_ReviewsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -42,7 +42,7 @@ export const Reviews: MessageFns<Reviews> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Reviews {
|
decode(input: BinaryReader | Uint8Array, length?: number): Reviews {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseReviews();
|
const message = createBaseReviews();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -70,10 +70,13 @@ export const Reviews: MessageFns<Reviews> = {
|
|||||||
fromJSON(object: any): Reviews {
|
fromJSON(object: any): Reviews {
|
||||||
return {
|
return {
|
||||||
reviews: isObject(object.reviews)
|
reviews: isObject(object.reviews)
|
||||||
? Object.entries(object.reviews).reduce<{ [key: number]: Review }>((acc, [key, value]) => {
|
? (globalThis.Object.entries(object.reviews) as [string, any][]).reduce(
|
||||||
|
(acc: { [key: number]: Review }, [key, value]: [string, any]) => {
|
||||||
acc[globalThis.Number(key)] = Review.fromJSON(value);
|
acc[globalThis.Number(key)] = Review.fromJSON(value);
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -81,7 +84,7 @@ export const Reviews: MessageFns<Reviews> = {
|
|||||||
toJSON(message: Reviews): unknown {
|
toJSON(message: Reviews): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.reviews) {
|
if (message.reviews) {
|
||||||
const entries = Object.entries(message.reviews);
|
const entries = globalThis.Object.entries(message.reviews) as [string, Review][];
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.reviews = {};
|
obj.reviews = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -97,23 +100,26 @@ export const Reviews: MessageFns<Reviews> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<Reviews>, I>>(object: I): Reviews {
|
fromPartial<I extends Exact<DeepPartial<Reviews>, I>>(object: I): Reviews {
|
||||||
const message = createBaseReviews();
|
const message = createBaseReviews();
|
||||||
message.reviews = Object.entries(object.reviews ?? {}).reduce<{ [key: number]: Review }>((acc, [key, value]) => {
|
message.reviews = (globalThis.Object.entries(object.reviews ?? {}) as [string, Review][]).reduce(
|
||||||
|
(acc: { [key: number]: Review }, [key, value]: [string, Review]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = Review.fromPartial(value);
|
acc[globalThis.Number(key)] = Review.fromPartial(value);
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
},
|
||||||
|
{},
|
||||||
|
);
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseReviews_ReviewsEntry(): Reviews_ReviewsEntry {
|
function createBaseReviews_ReviewsEntry(): Reviews_ReviewsEntry {
|
||||||
return { key: 0, value: createBaseReview() };
|
return { key: 0, value: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Reviews_ReviewsEntry: MessageFns<Reviews_ReviewsEntry> = {
|
export const Reviews_ReviewsEntry: MessageFns<Reviews_ReviewsEntry> = {
|
||||||
encode(message: Reviews_ReviewsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: Reviews_ReviewsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -124,7 +130,7 @@ export const Reviews_ReviewsEntry: MessageFns<Reviews_ReviewsEntry> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Reviews_ReviewsEntry {
|
decode(input: BinaryReader | Uint8Array, length?: number): Reviews_ReviewsEntry {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseReviews_ReviewsEntry();
|
const message = createBaseReviews_ReviewsEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -156,14 +162,14 @@ export const Reviews_ReviewsEntry: MessageFns<Reviews_ReviewsEntry> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Reviews_ReviewsEntry {
|
fromJSON(object: any): Reviews_ReviewsEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("Reviews_ReviewsEntry.key", object.key)),
|
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||||
value: Review.fromJSON(assertSet("Reviews_ReviewsEntry.value", object.value)),
|
value: isSet(object.value) ? Review.fromJSON(object.value) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: Reviews_ReviewsEntry): unknown {
|
toJSON(message: Reviews_ReviewsEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
obj.key = Math.round(message.key);
|
obj.key = Math.round(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -180,12 +186,12 @@ export const Reviews_ReviewsEntry: MessageFns<Reviews_ReviewsEntry> = {
|
|||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value = (object.value !== undefined && object.value !== null)
|
||||||
? Review.fromPartial(object.value)
|
? Review.fromPartial(object.value)
|
||||||
: createBaseReview();
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseReview(): Review {
|
function createBaseReview(): Review {
|
||||||
return { last_updated: 0, videos: [] };
|
return { last_updated: 0, videos: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,7 +208,7 @@ export const Review: MessageFns<Review> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Review {
|
decode(input: BinaryReader | Uint8Array, length?: number): Review {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseReview();
|
const message = createBaseReview();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -234,7 +240,11 @@ export const Review: MessageFns<Review> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Review {
|
fromJSON(object: any): Review {
|
||||||
return {
|
return {
|
||||||
last_updated: globalThis.Number(assertSet("Review.last_updated", object.last_updated)),
|
last_updated: isSet(object.lastUpdated)
|
||||||
|
? globalThis.Number(object.lastUpdated)
|
||||||
|
: isSet(object.last_updated)
|
||||||
|
? globalThis.Number(object.last_updated)
|
||||||
|
: 0,
|
||||||
videos: globalThis.Array.isArray(object?.videos) ? object.videos.map((e: any) => Video.fromJSON(e)) : [],
|
videos: globalThis.Array.isArray(object?.videos) ? object.videos.map((e: any) => Video.fromJSON(e)) : [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -242,7 +252,7 @@ export const Review: MessageFns<Review> = {
|
|||||||
toJSON(message: Review): unknown {
|
toJSON(message: Review): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.last_updated !== 0) {
|
if (message.last_updated !== 0) {
|
||||||
obj.last_updated = message.last_updated;
|
obj.lastUpdated = message.last_updated;
|
||||||
}
|
}
|
||||||
if (message.videos?.length) {
|
if (message.videos?.length) {
|
||||||
obj.videos = message.videos.map((e) => Video.toJSON(e));
|
obj.videos = message.videos.map((e) => Video.toJSON(e));
|
||||||
@@ -261,7 +271,7 @@ export const Review: MessageFns<Review> = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseVideo(): Video {
|
function createBaseVideo(): Video {
|
||||||
return { id: "", author: "" };
|
return { id: "", author: "" };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,7 +288,7 @@ export const Video: MessageFns<Video> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Video {
|
decode(input: BinaryReader | Uint8Array, length?: number): Video {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseVideo();
|
const message = createBaseVideo();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -310,8 +320,8 @@ export const Video: MessageFns<Video> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Video {
|
fromJSON(object: any): Video {
|
||||||
return {
|
return {
|
||||||
id: globalThis.String(assertSet("Video.id", object.id)),
|
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
||||||
author: globalThis.String(assertSet("Video.author", object.author)),
|
author: isSet(object.author) ? globalThis.String(object.author) : "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -358,14 +368,6 @@ function isSet(value: any): boolean {
|
|||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-ts_proto v2.2.2
|
// protoc-gen-ts_proto v2.11.2
|
||||||
// protoc v5.28.2
|
// protoc v5.28.2
|
||||||
// source: packages/core/src/protos/skill_definitions.proto
|
// source: skill_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
||||||
@@ -23,13 +23,13 @@ export interface Skill {
|
|||||||
skills: string[];
|
skills: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseSkillDefinitions(): SkillDefinitions {
|
function createBaseSkillDefinitions(): SkillDefinitions {
|
||||||
return { classes: {} };
|
return { classes: {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
||||||
encode(message: SkillDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: SkillDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
Object.entries(message.classes).forEach(([key, value]) => {
|
globalThis.Object.entries(message.classes).forEach(([key, value]: [string, Skill]) => {
|
||||||
SkillDefinitions_ClassesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
SkillDefinitions_ClassesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
@@ -37,7 +37,7 @@ export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): SkillDefinitions {
|
decode(input: BinaryReader | Uint8Array, length?: number): SkillDefinitions {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseSkillDefinitions();
|
const message = createBaseSkillDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -65,10 +65,13 @@ export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
|||||||
fromJSON(object: any): SkillDefinitions {
|
fromJSON(object: any): SkillDefinitions {
|
||||||
return {
|
return {
|
||||||
classes: isObject(object.classes)
|
classes: isObject(object.classes)
|
||||||
? Object.entries(object.classes).reduce<{ [key: number]: Skill }>((acc, [key, value]) => {
|
? (globalThis.Object.entries(object.classes) as [string, any][]).reduce(
|
||||||
|
(acc: { [key: number]: Skill }, [key, value]: [string, any]) => {
|
||||||
acc[globalThis.Number(key)] = Skill.fromJSON(value);
|
acc[globalThis.Number(key)] = Skill.fromJSON(value);
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
},
|
||||||
|
{},
|
||||||
|
)
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -76,7 +79,7 @@ export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
|||||||
toJSON(message: SkillDefinitions): unknown {
|
toJSON(message: SkillDefinitions): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.classes) {
|
if (message.classes) {
|
||||||
const entries = Object.entries(message.classes);
|
const entries = globalThis.Object.entries(message.classes) as [string, Skill][];
|
||||||
if (entries.length > 0) {
|
if (entries.length > 0) {
|
||||||
obj.classes = {};
|
obj.classes = {};
|
||||||
entries.forEach(([k, v]) => {
|
entries.forEach(([k, v]) => {
|
||||||
@@ -92,23 +95,26 @@ export const SkillDefinitions: MessageFns<SkillDefinitions> = {
|
|||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<SkillDefinitions>, I>>(object: I): SkillDefinitions {
|
fromPartial<I extends Exact<DeepPartial<SkillDefinitions>, I>>(object: I): SkillDefinitions {
|
||||||
const message = createBaseSkillDefinitions();
|
const message = createBaseSkillDefinitions();
|
||||||
message.classes = Object.entries(object.classes ?? {}).reduce<{ [key: number]: Skill }>((acc, [key, value]) => {
|
message.classes = (globalThis.Object.entries(object.classes ?? {}) as [string, Skill][]).reduce(
|
||||||
|
(acc: { [key: number]: Skill }, [key, value]: [string, Skill]) => {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
acc[globalThis.Number(key)] = Skill.fromPartial(value);
|
acc[globalThis.Number(key)] = Skill.fromPartial(value);
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
},
|
||||||
|
{},
|
||||||
|
);
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseSkillDefinitions_ClassesEntry(): SkillDefinitions_ClassesEntry {
|
function createBaseSkillDefinitions_ClassesEntry(): SkillDefinitions_ClassesEntry {
|
||||||
return { key: 0, value: createBaseSkill() };
|
return { key: 0, value: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SkillDefinitions_ClassesEntry: MessageFns<SkillDefinitions_ClassesEntry> = {
|
export const SkillDefinitions_ClassesEntry: MessageFns<SkillDefinitions_ClassesEntry> = {
|
||||||
encode(message: SkillDefinitions_ClassesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(message: SkillDefinitions_ClassesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
writer.uint32(8).uint32(message.key);
|
writer.uint32(8).uint32(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -119,7 +125,7 @@ export const SkillDefinitions_ClassesEntry: MessageFns<SkillDefinitions_ClassesE
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): SkillDefinitions_ClassesEntry {
|
decode(input: BinaryReader | Uint8Array, length?: number): SkillDefinitions_ClassesEntry {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseSkillDefinitions_ClassesEntry();
|
const message = createBaseSkillDefinitions_ClassesEntry();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -151,14 +157,14 @@ export const SkillDefinitions_ClassesEntry: MessageFns<SkillDefinitions_ClassesE
|
|||||||
|
|
||||||
fromJSON(object: any): SkillDefinitions_ClassesEntry {
|
fromJSON(object: any): SkillDefinitions_ClassesEntry {
|
||||||
return {
|
return {
|
||||||
key: globalThis.Number(assertSet("SkillDefinitions_ClassesEntry.key", object.key)),
|
key: isSet(object.key) ? globalThis.Number(object.key) : 0,
|
||||||
value: Skill.fromJSON(assertSet("SkillDefinitions_ClassesEntry.value", object.value)),
|
value: isSet(object.value) ? Skill.fromJSON(object.value) : undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toJSON(message: SkillDefinitions_ClassesEntry): unknown {
|
toJSON(message: SkillDefinitions_ClassesEntry): unknown {
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
if (message.key !== undefined) {
|
if (message.key !== 0) {
|
||||||
obj.key = Math.round(message.key);
|
obj.key = Math.round(message.key);
|
||||||
}
|
}
|
||||||
if (message.value !== undefined) {
|
if (message.value !== undefined) {
|
||||||
@@ -175,14 +181,12 @@ export const SkillDefinitions_ClassesEntry: MessageFns<SkillDefinitions_ClassesE
|
|||||||
): SkillDefinitions_ClassesEntry {
|
): SkillDefinitions_ClassesEntry {
|
||||||
const message = createBaseSkillDefinitions_ClassesEntry();
|
const message = createBaseSkillDefinitions_ClassesEntry();
|
||||||
message.key = object.key ?? 0;
|
message.key = object.key ?? 0;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
message.value = (object.value !== undefined && object.value !== null) ? Skill.fromPartial(object.value) : undefined;
|
||||||
? Skill.fromPartial(object.value)
|
|
||||||
: createBaseSkill();
|
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createBaseSkill(): Skill {
|
function createBaseSkill(): Skill {
|
||||||
return { skills: [] };
|
return { skills: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,7 +200,7 @@ export const Skill: MessageFns<Skill> = {
|
|||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Skill {
|
decode(input: BinaryReader | Uint8Array, length?: number): Skill {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
const end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseSkill();
|
const message = createBaseSkill();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
const tag = reader.uint32();
|
const tag = reader.uint32();
|
||||||
@@ -263,14 +267,6 @@ function isSet(value: any): boolean {
|
|||||||
return value !== null && value !== undefined;
|
return value !== null && value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertSet<T>(field: string, value: T | undefined): T {
|
|
||||||
if (!isSet(value)) {
|
|
||||||
throw new TypeError(`Required field ${field} is not set`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MessageFns<T> {
|
export interface MessageFns<T> {
|
||||||
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ syntax = "proto2";
|
|||||||
|
|
||||||
package blitzkit;
|
package blitzkit;
|
||||||
|
|
||||||
import "packages/core/src/protos/i18n.proto";
|
import "i18n.proto";
|
||||||
|
|
||||||
message TankDefinitions {
|
message TankDefinitions {
|
||||||
map<uint32, TankDefinition> tanks = 1;
|
map<uint32, TankDefinition> tanks = 1;
|
||||||
@@ -36,9 +36,19 @@ message TankDefinition {
|
|||||||
required float speed_backwards = 26;
|
required float speed_backwards = 26;
|
||||||
required float camouflage_still = 27;
|
required float camouflage_still = 27;
|
||||||
required float camouflage_moving = 28;
|
required float camouflage_moving = 28;
|
||||||
required float camouflage_onFire = 29;
|
required float camouflage_on_fire = 29;
|
||||||
required string equipment_preset = 30;
|
required string equipment_preset = 30;
|
||||||
required uint32 weight = 31;
|
required uint32 weight = 31;
|
||||||
|
required string dev_name = 32;
|
||||||
|
optional Equalizer equalizer = 33;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Equalizer {
|
||||||
|
required float health = 1;
|
||||||
|
required float penetration = 2;
|
||||||
|
required float module_health = 3;
|
||||||
|
required float damage = 4;
|
||||||
|
required float armor = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ResearchCost {
|
message ResearchCost {
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,3 @@
|
|||||||
|
export function bufferToBigInt(buffer: ArrayBuffer) {
|
||||||
|
return new DataView(buffer).getBigUint64(0, true);
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
export * from './buffer';
|
export * from './buffer';
|
||||||
|
export * from './bufferToBigInt';
|
||||||
export * from './dds';
|
export * from './dds';
|
||||||
export * from './dids';
|
export * from './dids';
|
||||||
export * from './pvr';
|
export * from './pvr';
|
||||||
@@ -7,3 +8,4 @@ export * from './sc2';
|
|||||||
export * from './scg';
|
export * from './scg';
|
||||||
export * from './scpg';
|
export * from './scpg';
|
||||||
export * from './windows';
|
export * from './windows';
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { clamp, isEqual, times } from 'lodash-es';
|
import { clamp, isEqual, times } from "lodash-es";
|
||||||
import { ReadStream } from './buffer';
|
import { ReadStream } from "./buffer";
|
||||||
|
|
||||||
export enum PvrFlags {
|
export enum PvrFlags {
|
||||||
NoFlag = 0,
|
NoFlag = 0,
|
||||||
@@ -96,7 +96,7 @@ export class PvrReadStream extends ReadStream {
|
|||||||
const header = this.header();
|
const header = this.header();
|
||||||
this.metadata();
|
this.metadata();
|
||||||
|
|
||||||
if (typeof header.pixelFormat === 'number') {
|
if (typeof header.pixelFormat === "number") {
|
||||||
switch (header.pixelFormat) {
|
switch (header.pixelFormat) {
|
||||||
default:
|
default:
|
||||||
throw new TypeError(
|
throw new TypeError(
|
||||||
@@ -142,12 +142,12 @@ export class PvrReadStream extends ReadStream {
|
|||||||
|
|
||||||
times(pixelCount, (index) => {
|
times(pixelCount, (index) => {
|
||||||
const buffer = this.consumeUint8Array(2);
|
const buffer = this.consumeUint8Array(2);
|
||||||
const bufferIndex = index * 4;
|
const bufferIndex = index * 3;
|
||||||
const r = ((buffer[1] & 0b11111000) >>> 3) / 31;
|
const r = ((buffer[1] & 0b11111000) >>> 3) / 31;
|
||||||
const g =
|
const g =
|
||||||
((buffer[1] & 0b111) << 3) |
|
(((buffer[1] & 0b111) << 3) | ((buffer[0] & 0b11100000) >>> 5)) /
|
||||||
(((buffer[0] & 0b11100000) >>> 5) / 31);
|
63;
|
||||||
const b = buffer[0] & 0b11111;
|
const b = (buffer[0] & 0b11111) / 31;
|
||||||
|
|
||||||
data[bufferIndex] = Math.round(clamp(r * 255, 0, 255));
|
data[bufferIndex] = Math.round(clamp(r * 255, 0, 255));
|
||||||
data[bufferIndex + 1] = Math.round(clamp(g * 255, 0, 255));
|
data[bufferIndex + 1] = Math.round(clamp(g * 255, 0, 255));
|
||||||
@@ -186,7 +186,7 @@ export class PvrReadStream extends ReadStream {
|
|||||||
metadataSize: this.uint32(),
|
metadataSize: this.uint32(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (header.version !== 'PVR\x03') throw new TypeError('Endian mismatch');
|
if (header.version !== "PVR\x03") throw new TypeError("Endian mismatch");
|
||||||
|
|
||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
@@ -205,19 +205,19 @@ export class PvrReadStream extends ReadStream {
|
|||||||
resolveBitRatePixelFormat(
|
resolveBitRatePixelFormat(
|
||||||
pixelFormat: Exclude<ReturnType<typeof this.pixelFormat>, number>,
|
pixelFormat: Exclude<ReturnType<typeof this.pixelFormat>, number>,
|
||||||
) {
|
) {
|
||||||
if (pixelFormat.order === 'rgba') {
|
if (pixelFormat.order === "rgba") {
|
||||||
if (isEqual(pixelFormat.bitRates, [4, 4, 4, 4])) {
|
if (isEqual(pixelFormat.bitRates, [4, 4, 4, 4])) {
|
||||||
return ResolvedBitRatePixelFormat.R4G4B4A4;
|
return ResolvedBitRatePixelFormat.R4G4B4A4;
|
||||||
} else
|
} else
|
||||||
throw new TypeError(
|
throw new TypeError(
|
||||||
`Unhandled rgba bit rate ${pixelFormat.bitRates.join(', ')}`,
|
`Unhandled rgba bit rate ${pixelFormat.bitRates.join(", ")}`,
|
||||||
);
|
);
|
||||||
} else if (pixelFormat.order === 'rgb\0') {
|
} else if (pixelFormat.order === "rgb\0") {
|
||||||
if (isEqual(pixelFormat.bitRates, [5, 6, 5, 0])) {
|
if (isEqual(pixelFormat.bitRates, [5, 6, 5, 0])) {
|
||||||
return ResolvedBitRatePixelFormat.R5G6B5A0;
|
return ResolvedBitRatePixelFormat.R5G6B5A0;
|
||||||
} else
|
} else
|
||||||
throw new TypeError(
|
throw new TypeError(
|
||||||
`Unhandled rgb bit rate ${pixelFormat.bitRates.join(', ')}`,
|
`Unhandled rgb bit rate ${pixelFormat.bitRates.join(", ")}`,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
throw new TypeError(`Unhandled pixel order ${pixelFormat.order}`);
|
throw new TypeError(`Unhandled pixel order ${pixelFormat.order}`);
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ type DataNode = {
|
|||||||
qualityGroup?: string;
|
qualityGroup?: string;
|
||||||
fxName?: string;
|
fxName?: string;
|
||||||
textures?: Textures;
|
textures?: Textures;
|
||||||
|
customCullMode?: number;
|
||||||
|
enabledPresets?: EnabledPresets;
|
||||||
|
properties?: Properties;
|
||||||
} & (
|
} & (
|
||||||
| ({
|
| ({
|
||||||
configCount: number;
|
configCount: number;
|
||||||
@@ -24,7 +27,7 @@ type DataNode = {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
interface ConfigArchive {
|
export interface ConfigArchive {
|
||||||
configName: string;
|
configName: string;
|
||||||
fxName: string;
|
fxName: string;
|
||||||
properties: Properties;
|
properties: Properties;
|
||||||
|
|||||||
Submodule
+1
Submodule packages/cue4parse added at b42ab66a7a.
@@ -0,0 +1,3 @@
|
|||||||
|
[*.cs]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
## A streamlined .gitignore for modern .NET projects
|
||||||
|
## including temporary files, build results, and
|
||||||
|
## files generated by popular .NET tools. If you are
|
||||||
|
## developing with Visual Studio, the VS .gitignore
|
||||||
|
## https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
|
||||||
|
## has more thorough IDE-specific entries.
|
||||||
|
##
|
||||||
|
## Get latest from https://github.com/github/gitignore/blob/main/Dotnet.gitignore
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
[Dd]ebug/
|
||||||
|
[Dd]ebugPublic/
|
||||||
|
[Rr]elease/
|
||||||
|
[Rr]eleases/
|
||||||
|
x64/
|
||||||
|
x86/
|
||||||
|
[Ww][Ii][Nn]32/
|
||||||
|
[Aa][Rr][Mm]/
|
||||||
|
[Aa][Rr][Mm]64/
|
||||||
|
bld/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
[Ll]og/
|
||||||
|
[Ll]ogs/
|
||||||
|
|
||||||
|
# .NET Core
|
||||||
|
project.lock.json
|
||||||
|
project.fragment.lock.json
|
||||||
|
artifacts/
|
||||||
|
|
||||||
|
# ASP.NET Scaffolding
|
||||||
|
ScaffoldingReadMe.txt
|
||||||
|
|
||||||
|
# NuGet Packages
|
||||||
|
*.nupkg
|
||||||
|
# NuGet Symbol Packages
|
||||||
|
*.snupkg
|
||||||
|
|
||||||
|
# dotenv environment variables file
|
||||||
|
.env
|
||||||
|
|
||||||
|
# Others
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
CodeCoverage/
|
||||||
|
|
||||||
|
# MSBuild Binary and Structured Log
|
||||||
|
*.binlog
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
# NUnit
|
||||||
|
*.VisualState.xml
|
||||||
|
TestResult.xml
|
||||||
|
nunit-*.xml
|
||||||
@@ -0,0 +1,301 @@
|
|||||||
|
using System.Text.Json;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using BlitzKit.Game.Models;
|
||||||
|
using CUE4Parse_Conversion;
|
||||||
|
using CUE4Parse_Conversion.Materials;
|
||||||
|
using CUE4Parse_Conversion.Meshes;
|
||||||
|
using CUE4Parse_Conversion.Textures;
|
||||||
|
using CUE4Parse_Conversion.UEFormat.Enums;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports.Component;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports.Engine;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports.Material;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports.SkeletalMesh;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports.StaticMesh;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports.Texture;
|
||||||
|
using CUE4Parse.UE4.Assets.Objects;
|
||||||
|
using CUE4Parse.UE4.Assets.Objects.Properties;
|
||||||
|
using CUE4Parse.UE4.Objects.Engine;
|
||||||
|
using CUE4Parse.UE4.Objects.GameplayTags;
|
||||||
|
using CUE4Parse.UE4.Objects.UObject;
|
||||||
|
using Microsoft.JavaScript.NodeApi;
|
||||||
|
using SharpGLTF.Materials;
|
||||||
|
using SkiaSharp;
|
||||||
|
|
||||||
|
namespace BlitzKit.Game.JSExport;
|
||||||
|
|
||||||
|
[JSExport]
|
||||||
|
public partial class GameInterface
|
||||||
|
{
|
||||||
|
private readonly BlitzFileProvider provider;
|
||||||
|
|
||||||
|
public HashSet<string> files;
|
||||||
|
|
||||||
|
public GameInterface(string directory, string map, string temp)
|
||||||
|
{
|
||||||
|
provider = new(directory, map, temp);
|
||||||
|
files = [.. provider.Files.Keys];
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly Dictionary<string, string> texturePaths = new();
|
||||||
|
readonly string textureCache = "../../temp/textures.json";
|
||||||
|
|
||||||
|
public void DiscoverTextures(string[] tankTags)
|
||||||
|
{
|
||||||
|
if (File.Exists(textureCache))
|
||||||
|
{
|
||||||
|
Console.WriteLine("Found textures cache");
|
||||||
|
|
||||||
|
var content = File.ReadAllText(textureCache);
|
||||||
|
var cached = JsonSerializer.Deserialize<Dictionary<string, string>>(content);
|
||||||
|
|
||||||
|
foreach (var (key, value) in cached)
|
||||||
|
{
|
||||||
|
texturePaths[key] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine("Textures cache not found, building...");
|
||||||
|
|
||||||
|
var options = new ExporterOptions() { TextureFormat = ETextureFormat.Jpeg };
|
||||||
|
|
||||||
|
foreach (var tag in tankTags)
|
||||||
|
{
|
||||||
|
var pda = provider.Discovered<UPrimaryDataAsset>(tag);
|
||||||
|
|
||||||
|
foreach (var group in tankPartPrefixes.Values)
|
||||||
|
{
|
||||||
|
var dataTable = pda.Get<UDataTable>(group);
|
||||||
|
|
||||||
|
foreach (var row in dataTable.RowMap.Values)
|
||||||
|
{
|
||||||
|
var visualData = row.Get<UObject>("VisualData");
|
||||||
|
var meshSettings = visualData.Get<FStructFallback>("MeshSettings");
|
||||||
|
|
||||||
|
foreach (var property in meshSettings.Properties)
|
||||||
|
{
|
||||||
|
if (meshSettings.TryGet<UStaticMesh>(property.Name.Text, out var mesh))
|
||||||
|
{
|
||||||
|
mesh.TryConvert(out var convertedMesh);
|
||||||
|
|
||||||
|
var lod0 = convertedMesh.LODs.Find(lod => !lod.SkipLod);
|
||||||
|
|
||||||
|
if (lod0 == null || lod0.Sections == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var section in lod0.Sections.Value)
|
||||||
|
{
|
||||||
|
if (section.Material == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var materialInterface = section.Material.Load<UMaterialInterface>();
|
||||||
|
|
||||||
|
if (materialInterface == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var materialData = new MaterialData() { Parameters = new() };
|
||||||
|
|
||||||
|
materialInterface.GetParams(materialData.Parameters, options.MaterialFormat);
|
||||||
|
|
||||||
|
foreach (var parameterTexture in materialData.Parameters.Textures)
|
||||||
|
{
|
||||||
|
if (MonoGltf.knownChannels.TryGetValue(parameterTexture.Key, out var channel))
|
||||||
|
{
|
||||||
|
var path = parameterTexture.Value.GetPathName();
|
||||||
|
var name = Path.GetFileNameWithoutExtension(path);
|
||||||
|
|
||||||
|
texturePaths[name] = path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine($"Discovered {texturePaths.Count} textures");
|
||||||
|
Directory.CreateDirectory(Path.GetDirectoryName(textureCache));
|
||||||
|
|
||||||
|
var json = JsonSerializer.Serialize(texturePaths);
|
||||||
|
|
||||||
|
File.WriteAllText(textureCache, json);
|
||||||
|
|
||||||
|
Console.WriteLine("Saved textures cache");
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<string> Textures => [.. texturePaths.Keys];
|
||||||
|
|
||||||
|
public byte[] Texture(string name)
|
||||||
|
{
|
||||||
|
var path = texturePaths[name];
|
||||||
|
var texture = provider.LoadPackageObject<UTexture2D>(path);
|
||||||
|
var isRMAO = name.EndsWith("_RMAO");
|
||||||
|
var postProcess = isRMAO ? ImagePostProcess.RMAO : ImagePostProcess.None;
|
||||||
|
|
||||||
|
return provider.Image(texture, postProcess);
|
||||||
|
}
|
||||||
|
|
||||||
|
public HashSet<string> Files => files;
|
||||||
|
|
||||||
|
public byte[] TankBigIcon(string tag)
|
||||||
|
{
|
||||||
|
var pda = provider.Discovered<UPrimaryDataAsset>(tag);
|
||||||
|
var icon = pda.Get<FSoftObjectPath>("BigIcon");
|
||||||
|
return provider.Image(icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedRegex(@"T_UI_Flag_(\w+)_S")]
|
||||||
|
private static partial Regex FlagNameRegex();
|
||||||
|
|
||||||
|
public byte[] Flag(string nation)
|
||||||
|
{
|
||||||
|
var flagsBase = "Blitz/Content/UI/Textures/Flag/TankCard/";
|
||||||
|
|
||||||
|
foreach (var path in provider.Files.Keys)
|
||||||
|
{
|
||||||
|
if (!path.StartsWith(flagsBase))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var fileName = Path.GetFileNameWithoutExtension(path);
|
||||||
|
var match = FlagNameRegex().Match(fileName);
|
||||||
|
|
||||||
|
if (
|
||||||
|
match.Success
|
||||||
|
&& match.Groups[1].Value.Equals(nation, StringComparison.CurrentCultureIgnoreCase)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (provider.TryLoadPackageObject<UTexture2D>($"{path}.{fileName}", out var uTexture))
|
||||||
|
{
|
||||||
|
CTexture? cTexture = uTexture.Decode(ETexturePlatform.DesktopMobile);
|
||||||
|
|
||||||
|
if (cTexture is null)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"No flag found for {nation}");
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
SKBitmap bitmap = cTexture.ToSkBitmap();
|
||||||
|
SKData data = bitmap.Encode(SKEncodedImageFormat.Webp, 80);
|
||||||
|
|
||||||
|
return data.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine($"No flag found for {nation}");
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine($"No flag found for {nation}");
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] ConsumableIcon(string tag)
|
||||||
|
{
|
||||||
|
var pda = provider.Discovered<UPrimaryDataAsset>(tag);
|
||||||
|
var icon = pda.Get<FSoftObjectPath>("Icon");
|
||||||
|
return provider.Image(icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] EquipmentIcon(string tag)
|
||||||
|
{
|
||||||
|
var pda = provider.Discovered<UPrimaryDataAsset>(tag);
|
||||||
|
var icon = pda.Get<FSoftObjectPath>("Icon");
|
||||||
|
return provider.Image(icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly Dictionary<string, string> tankPartPrefixes = new()
|
||||||
|
{
|
||||||
|
{ "chassis", "DT_Chassis" },
|
||||||
|
{ "hull", "DT_Hulls" },
|
||||||
|
{ "turret", "DT_Turrets" },
|
||||||
|
{ "gun", "DT_Guns" },
|
||||||
|
};
|
||||||
|
|
||||||
|
public byte[] TankPart(string tag, string part)
|
||||||
|
{
|
||||||
|
var pda = provider.Discovered<UPrimaryDataAsset>(tag);
|
||||||
|
UDataTable? dataTable = null;
|
||||||
|
|
||||||
|
foreach (var (prefix, name) in tankPartPrefixes)
|
||||||
|
{
|
||||||
|
if (!part.StartsWith(prefix))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
dataTable = pda.Get<UDataTable>(name);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dataTable == null)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Unknown tank part (no matching data table): {part}");
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
dataTable.TryGetDataTableRow(part, StringComparison.Ordinal, out var row);
|
||||||
|
|
||||||
|
if (row == null)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Unknown tank part (no matching row): {part}");
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
var visualData = row.Get<UObject>("VisualData");
|
||||||
|
var meshSettings = visualData.Get<FStructFallback>("MeshSettings");
|
||||||
|
// var meshes = CollectMeshes(meshSettings);
|
||||||
|
// var gltf = new MonoGltf(meshes);
|
||||||
|
|
||||||
|
var gltf = new MonoGltf(meshSettings);
|
||||||
|
|
||||||
|
return gltf.Write($"{tag}/{part}");
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<(string, UObject)> CollectMeshes(FStructFallback settings)
|
||||||
|
{
|
||||||
|
var meshes = new List<(string, UObject)>();
|
||||||
|
|
||||||
|
foreach (var property in settings.Properties)
|
||||||
|
{
|
||||||
|
var key = property.Name.Text;
|
||||||
|
|
||||||
|
if (settings.TryGet<UStaticMesh>(key, out var staticMesh))
|
||||||
|
{
|
||||||
|
meshes.Add((key, staticMesh));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settings.TryGet<USkeletalMesh>(key, out var skeletalMesh))
|
||||||
|
{
|
||||||
|
meshes.Add((key, skeletalMesh));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settings.TryGet<FStructFallback[]>(key, out var array))
|
||||||
|
{
|
||||||
|
foreach (var item in array)
|
||||||
|
{
|
||||||
|
meshes.AddRange(CollectMeshes(item));
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Console.WriteLine(
|
||||||
|
// $"{key} -> {property.Tag} ({property.TagData}) [{property.PropertyTagFlags}]"
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
|
||||||
|
return meshes;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using CUE4Parse_Conversion.Textures;
|
||||||
|
using CUE4Parse.Compression;
|
||||||
|
using CUE4Parse.FileProvider;
|
||||||
|
using CUE4Parse.MappingsProvider;
|
||||||
|
using CUE4Parse.UE4.AssetRegistry;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports.Texture;
|
||||||
|
using CUE4Parse.UE4.Exceptions;
|
||||||
|
using CUE4Parse.UE4.Objects.Engine;
|
||||||
|
using CUE4Parse.UE4.Objects.UObject;
|
||||||
|
using CUE4Parse.UE4.Readers;
|
||||||
|
using CUE4Parse.UE4.Versions;
|
||||||
|
using CUE4Parse.Utils;
|
||||||
|
using SkiaSharp;
|
||||||
|
|
||||||
|
namespace BlitzKit.Game.Models;
|
||||||
|
|
||||||
|
public enum ImagePostProcess
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
RMAO,
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class BlitzFileProvider : DefaultFileProvider
|
||||||
|
{
|
||||||
|
[GeneratedRegex(@"\(GameplayTags=\(\(TagName=""(.+)""\)\)\)")]
|
||||||
|
private static partial Regex GameplayTagsRegex();
|
||||||
|
|
||||||
|
private readonly Dictionary<string, string> discovered = [];
|
||||||
|
|
||||||
|
public BlitzFileProvider(string directory, string map, string temp)
|
||||||
|
: base(
|
||||||
|
directory: directory,
|
||||||
|
searchOption: SearchOption.AllDirectories,
|
||||||
|
versions: new(EGame.GAME_UE5_5),
|
||||||
|
pathComparer: StringComparer.OrdinalIgnoreCase
|
||||||
|
)
|
||||||
|
{
|
||||||
|
MappingsContainer = new FileUsmapTypeMappingsProvider(map);
|
||||||
|
|
||||||
|
Initialize();
|
||||||
|
Mount();
|
||||||
|
|
||||||
|
// string oodlePath = $"{temp}/oodle.so";
|
||||||
|
// OodleHelper.DownloadOodleDll(ref oodlePath!);
|
||||||
|
OodleHelper.Initialize("../../stupid/oodle.so");
|
||||||
|
|
||||||
|
if (TryGetGameFile("Blitz/AssetRegistry.bin", out var file))
|
||||||
|
{
|
||||||
|
var bytes = file.Read();
|
||||||
|
var archive = new FByteArchive(file.Path, bytes, Versions);
|
||||||
|
var state = new FAssetRegistryState(archive);
|
||||||
|
|
||||||
|
foreach (var asset in state.PreallocatedAssetDataBuffers)
|
||||||
|
{
|
||||||
|
if (asset.TagsAndValues.TryGetValue("DiscoveryTags", out var tags))
|
||||||
|
{
|
||||||
|
var match = GameplayTagsRegex().Match(tags);
|
||||||
|
|
||||||
|
if (!match.Success)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var tag = match.Groups[1].Value;
|
||||||
|
discovered[tag] = asset.ObjectPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public T Discovered<T>(string path)
|
||||||
|
where T : UObject
|
||||||
|
{
|
||||||
|
return LoadPackageObject<T>(discovered[path]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UPrimaryDataAsset PDA(string path)
|
||||||
|
{
|
||||||
|
var name = Path.GetFileNameWithoutExtension(path);
|
||||||
|
var combined = $"{path}.{name}";
|
||||||
|
return LoadPackageObject<UPrimaryDataAsset>(combined);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] Image(FSoftObjectPath path)
|
||||||
|
{
|
||||||
|
var uTexture = path.Load<UTexture2D>();
|
||||||
|
return Image(uTexture);
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly SKEncodedImageFormat imageFormat = SKEncodedImageFormat.Webp;
|
||||||
|
private readonly int imageQuality = 80;
|
||||||
|
|
||||||
|
public byte[] Image(UTexture2D uTexture, ImagePostProcess postProcess = ImagePostProcess.None)
|
||||||
|
{
|
||||||
|
var cTexture = uTexture.Decode(ETexturePlatform.DesktopMobile);
|
||||||
|
|
||||||
|
ArgumentNullException.ThrowIfNull(cTexture);
|
||||||
|
|
||||||
|
var bitmap = cTexture.ToSkBitmap();
|
||||||
|
|
||||||
|
return Image(bitmap, postProcess);
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte[] Image(SKBitmap bitmap, ImagePostProcess postProcess)
|
||||||
|
{
|
||||||
|
if (postProcess != ImagePostProcess.None)
|
||||||
|
{
|
||||||
|
for (int y = 0; y < bitmap.Height; y++)
|
||||||
|
{
|
||||||
|
for (int x = 0; x < bitmap.Width; x++)
|
||||||
|
{
|
||||||
|
var color = bitmap.GetPixel(x, y);
|
||||||
|
|
||||||
|
switch (postProcess)
|
||||||
|
{
|
||||||
|
case ImagePostProcess.RMAO:
|
||||||
|
bitmap.SetPixel(x, y, new SKColor(color.Blue, color.Red, color.Green, color.Alpha));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var data = bitmap.Encode(imageFormat, imageQuality);
|
||||||
|
|
||||||
|
return data.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,364 @@
|
|||||||
|
using System.Numerics;
|
||||||
|
using CUE4Parse_Conversion;
|
||||||
|
using CUE4Parse_Conversion.Materials;
|
||||||
|
using CUE4Parse_Conversion.Meshes;
|
||||||
|
using CUE4Parse_Conversion.Meshes.glTF;
|
||||||
|
using CUE4Parse_Conversion.Meshes.PSK;
|
||||||
|
using CUE4Parse_Conversion.Textures;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports.Material;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports.SkeletalMesh;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports.StaticMesh;
|
||||||
|
using CUE4Parse.UE4.Assets.Objects;
|
||||||
|
using CUE4Parse.UE4.Objects.Core.Math;
|
||||||
|
using CUE4Parse.UE4.Objects.Meshes;
|
||||||
|
using SharpGLTF.Geometry;
|
||||||
|
using SharpGLTF.Geometry.VertexTypes;
|
||||||
|
using SharpGLTF.Materials;
|
||||||
|
using SharpGLTF.Memory;
|
||||||
|
using SharpGLTF.Scenes;
|
||||||
|
using SharpGLTF.Schema2;
|
||||||
|
|
||||||
|
namespace BlitzKit.Game.Models;
|
||||||
|
|
||||||
|
using ConfiguredMeshBuilder = MeshBuilder<
|
||||||
|
VertexPositionNormalTangent,
|
||||||
|
VertexColorXTextureX,
|
||||||
|
VertexEmpty
|
||||||
|
>;
|
||||||
|
|
||||||
|
public class MonoGltf
|
||||||
|
{
|
||||||
|
readonly SceneBuilder scene = new();
|
||||||
|
readonly Dictionary<string, MaterialBuilder> materialMap = [];
|
||||||
|
|
||||||
|
static readonly MaterialBuilder emptyMaterial = new("empty_material");
|
||||||
|
static readonly ExporterOptions options = new() { TextureFormat = ETextureFormat.Jpeg };
|
||||||
|
public static readonly Dictionary<string, KnownChannel[]> knownChannels = new()
|
||||||
|
{
|
||||||
|
{ "BaseColor", [KnownChannel.BaseColor] },
|
||||||
|
{ "Normal", [KnownChannel.Normal] },
|
||||||
|
{ "RMAO", [KnownChannel.MetallicRoughness, KnownChannel.Occlusion] },
|
||||||
|
// { "CDE", ?? },
|
||||||
|
};
|
||||||
|
static readonly byte[] stubBytes = File.ReadAllBytes("../game/stub/small.png");
|
||||||
|
static readonly float scaleCorrection = 0.01f;
|
||||||
|
|
||||||
|
public MonoGltf(FStructFallback settings)
|
||||||
|
{
|
||||||
|
var root = new NodeBuilder("root");
|
||||||
|
|
||||||
|
Traverse(settings, root);
|
||||||
|
scene.AddNode(root);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Traverse(FStructFallback settings, NodeBuilder parent)
|
||||||
|
{
|
||||||
|
foreach (var property in settings.Properties)
|
||||||
|
{
|
||||||
|
var key = property.Name.Text;
|
||||||
|
|
||||||
|
if (settings.TryGet<UStaticMesh>(key, out var staticMesh))
|
||||||
|
{
|
||||||
|
AddMesh(parent.CreateNode(key), staticMesh);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settings.TryGet<USkeletalMesh>(key, out var skeletalMesh))
|
||||||
|
{
|
||||||
|
AddMesh(parent.CreateNode(key), skeletalMesh);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settings.TryGet<FStructFallback[]>(key, out var array))
|
||||||
|
{
|
||||||
|
foreach (var item in array)
|
||||||
|
{
|
||||||
|
Traverse(item, parent.CreateNode(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key == "BoneTransform")
|
||||||
|
{
|
||||||
|
var transform = settings.Get<FStructFallback>(key);
|
||||||
|
|
||||||
|
if (transform.TryGet<FQuat>("Rotation", out var rotation))
|
||||||
|
{
|
||||||
|
parent.WithLocalRotation(SwapYZ(rotation));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (transform.TryGet<FVector>("Translation", out var translation))
|
||||||
|
{
|
||||||
|
parent.WithLocalTranslation(SwapYZ(translation) * scaleCorrection);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (transform.TryGet<FVector>("Scale3D", out var scale))
|
||||||
|
{
|
||||||
|
parent.WithLocalScale(SwapYZ(scale));
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Console.WriteLine(
|
||||||
|
// $"{key} -> {property.Tag} ({property.TagData}) [{property.PropertyTagFlags}]"
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddMesh(NodeBuilder meshNode, UObject mesh)
|
||||||
|
{
|
||||||
|
if (mesh is UStaticMesh staticMesh)
|
||||||
|
{
|
||||||
|
staticMesh.TryConvert(out var convertedStaticMesh);
|
||||||
|
|
||||||
|
var lod0 = convertedStaticMesh.LODs.Find(lod => !lod.SkipLod)!;
|
||||||
|
|
||||||
|
var i = 0;
|
||||||
|
foreach (var section in lod0.Sections!.Value)
|
||||||
|
{
|
||||||
|
var sectionNode = meshNode.CreateNode($"{i++}");
|
||||||
|
var configured = ParseSection(section, lod0, lod0.Verts!);
|
||||||
|
|
||||||
|
scene.AddRigidMesh(configured, sectionNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mesh is USkeletalMesh skeletalMesh)
|
||||||
|
{
|
||||||
|
skeletalMesh.TryConvert(out var convertedSkeletalMesh);
|
||||||
|
|
||||||
|
var lod0 = convertedSkeletalMesh.LODs.Find(lod => !lod.SkipLod)!;
|
||||||
|
|
||||||
|
var i = 0;
|
||||||
|
foreach (var section in lod0.Sections!.Value)
|
||||||
|
{
|
||||||
|
var sectionNode = meshNode.CreateNode($"{i++}");
|
||||||
|
var configured = ParseSection(section, lod0, lod0.Verts!);
|
||||||
|
|
||||||
|
scene.AddRigidMesh(configured, sectionNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfiguredMeshBuilder ParseSection(CMeshSection section, CBaseMeshLod lod, CMeshVertex[] vertices)
|
||||||
|
{
|
||||||
|
var meshBuilder = new ConfiguredMeshBuilder();
|
||||||
|
MaterialBuilder materialBuilder;
|
||||||
|
|
||||||
|
if (section.Material == null || section.MaterialName == null)
|
||||||
|
{
|
||||||
|
materialBuilder = emptyMaterial;
|
||||||
|
}
|
||||||
|
else if (materialMap.TryGetValue(section.MaterialName, out MaterialBuilder? value))
|
||||||
|
{
|
||||||
|
materialBuilder = value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var materialInterface = section.Material.Load<UMaterialInterface>()!;
|
||||||
|
var materialData = new MaterialData() { Parameters = new() };
|
||||||
|
|
||||||
|
materialInterface.GetParams(materialData.Parameters, options.MaterialFormat);
|
||||||
|
materialBuilder = new();
|
||||||
|
materialMap.Add(section.MaterialName, materialBuilder);
|
||||||
|
|
||||||
|
foreach (var parameterTexture in materialData.Parameters.Textures)
|
||||||
|
{
|
||||||
|
if (knownChannels.TryGetValue(parameterTexture.Key, out var channels))
|
||||||
|
{
|
||||||
|
var texture = parameterTexture.Value;
|
||||||
|
var name = Path.GetFileNameWithoutExtension(texture.GetPathName());
|
||||||
|
var path = $"../../../textures/{name}.webp";
|
||||||
|
|
||||||
|
var lastIndex = stubBytes.Length - 1;
|
||||||
|
stubBytes[lastIndex] = (byte)(++stubBytes[lastIndex] % 255);
|
||||||
|
var uniqueBytes = (byte[])stubBytes.Clone();
|
||||||
|
var stubImage = new MemoryImage(uniqueBytes);
|
||||||
|
|
||||||
|
foreach (var channel in channels)
|
||||||
|
{
|
||||||
|
materialBuilder.WithChannelImage(channel, stubImage);
|
||||||
|
materialBuilder.GetChannel(channel).Texture.PrimaryImage.Name = path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var primitive = meshBuilder.UsePrimitive(materialBuilder);
|
||||||
|
|
||||||
|
for (int faceIndex = 0; faceIndex < section.NumFaces; faceIndex++)
|
||||||
|
{
|
||||||
|
var wedgeIndex = new int[3];
|
||||||
|
for (var k = 0; k < wedgeIndex.Length; k++)
|
||||||
|
{
|
||||||
|
wedgeIndex[k] = (int)lod.Indices!.Value[section.FirstIndex + faceIndex * 3 + k];
|
||||||
|
}
|
||||||
|
|
||||||
|
var vertex1 = vertices[wedgeIndex[0]];
|
||||||
|
var vertex2 = vertices[wedgeIndex[1]];
|
||||||
|
var vertex3 = vertices[wedgeIndex[2]];
|
||||||
|
|
||||||
|
var (v1, v2, v3) = PrepareTriangles(vertex1, vertex2, vertex3);
|
||||||
|
var (c1, c2, c3) = PrepareUVsAndTexCoords(lod, vertex1, vertex2, vertex3, wedgeIndex);
|
||||||
|
|
||||||
|
primitive.AddTriangle((v1, c1), (v2, c2), (v3, c3));
|
||||||
|
}
|
||||||
|
|
||||||
|
return meshBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] Write(string name)
|
||||||
|
{
|
||||||
|
var model = scene.ToGltf2();
|
||||||
|
|
||||||
|
model.Asset.Copyright = null;
|
||||||
|
model.Asset.Generator = null;
|
||||||
|
|
||||||
|
var mappedTextures = new Dictionary<MemoryImage, string>();
|
||||||
|
|
||||||
|
foreach (var image in model.LogicalImages)
|
||||||
|
{
|
||||||
|
mappedTextures[image.Content] = image.Name!;
|
||||||
|
image.Name = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var stream = new MemoryStream();
|
||||||
|
var context = WriteContext
|
||||||
|
.CreateFromStream(stream)
|
||||||
|
.WithSettingsFrom(
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
ImageWriting = ResourceWriteMode.SatelliteFile,
|
||||||
|
ImageWriteCallback = (context, assetName, image) =>
|
||||||
|
{
|
||||||
|
return mappedTextures[image];
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
context.WriteBinarySchema2(name, model);
|
||||||
|
|
||||||
|
return stream.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static (
|
||||||
|
VertexPositionNormalTangent,
|
||||||
|
VertexPositionNormalTangent,
|
||||||
|
VertexPositionNormalTangent
|
||||||
|
) PrepareTriangles(CMeshVertex vert1, CMeshVertex vert2, CMeshVertex vert3)
|
||||||
|
{
|
||||||
|
var v1 = new VertexPositionNormalTangent(
|
||||||
|
SwapYZ(vert1.Position * scaleCorrection),
|
||||||
|
SwapYZAndNormalize((FVector)vert1.Normal),
|
||||||
|
SwapYZAndNormalize((Vector4)vert1.Tangent)
|
||||||
|
);
|
||||||
|
var v2 = new VertexPositionNormalTangent(
|
||||||
|
SwapYZ(vert2.Position * scaleCorrection),
|
||||||
|
SwapYZAndNormalize((FVector)vert2.Normal),
|
||||||
|
SwapYZAndNormalize((Vector4)vert2.Tangent)
|
||||||
|
);
|
||||||
|
var v3 = new VertexPositionNormalTangent(
|
||||||
|
SwapYZ(vert3.Position * scaleCorrection),
|
||||||
|
SwapYZAndNormalize((FVector)vert3.Normal),
|
||||||
|
SwapYZAndNormalize((Vector4)vert3.Tangent)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (v1, v2, v3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FVector SwapYZ(FVector vec)
|
||||||
|
{
|
||||||
|
var res = new FVector(vec.X, vec.Z, vec.Y);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Quaternion SwapYZ(Quaternion q)
|
||||||
|
{
|
||||||
|
return Quaternion.Normalize(new Quaternion(q.X, q.Z, q.Y, -q.W));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FVector SwapYZAndNormalize(FVector vec)
|
||||||
|
{
|
||||||
|
var res = SwapYZ(vec);
|
||||||
|
res.Normalize();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Vector4 SwapYZAndNormalize(Vector4 vec)
|
||||||
|
{
|
||||||
|
return Vector4.Normalize(new Vector4(vec.X, vec.Z, vec.Y, vec.W));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static (
|
||||||
|
VertexColorXTextureX,
|
||||||
|
VertexColorXTextureX,
|
||||||
|
VertexColorXTextureX
|
||||||
|
) PrepareUVsAndTexCoords(
|
||||||
|
CBaseMeshLod lod,
|
||||||
|
CMeshVertex vert1,
|
||||||
|
CMeshVertex vert2,
|
||||||
|
CMeshVertex vert3,
|
||||||
|
int[] indices
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return PrepareUVsAndTexCoords(
|
||||||
|
lod.VertexColors ?? new FColor[lod.NumVerts],
|
||||||
|
vert1,
|
||||||
|
vert2,
|
||||||
|
vert3,
|
||||||
|
lod.ExtraUV!.Value,
|
||||||
|
indices
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static (
|
||||||
|
VertexColorXTextureX,
|
||||||
|
VertexColorXTextureX,
|
||||||
|
VertexColorXTextureX
|
||||||
|
) PrepareUVsAndTexCoords(
|
||||||
|
FColor[] colors,
|
||||||
|
CMeshVertex vert1,
|
||||||
|
CMeshVertex vert2,
|
||||||
|
CMeshVertex vert3,
|
||||||
|
FMeshUVFloat[][] uvs,
|
||||||
|
int[] indices
|
||||||
|
)
|
||||||
|
{
|
||||||
|
var (uvs1, uvs2, uvs3) = PrepareUVs(vert1, vert2, vert3, uvs, indices);
|
||||||
|
|
||||||
|
var c1 = new VertexColorXTextureX((Vector4)colors[indices[0]] / 255, uvs1);
|
||||||
|
var c2 = new VertexColorXTextureX((Vector4)colors[indices[1]] / 255, uvs2);
|
||||||
|
var c3 = new VertexColorXTextureX((Vector4)colors[indices[2]] / 255, uvs3);
|
||||||
|
|
||||||
|
return (c1, c2, c3);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static (List<Vector2>, List<Vector2>, List<Vector2>) PrepareUVs(
|
||||||
|
CMeshVertex vert1,
|
||||||
|
CMeshVertex vert2,
|
||||||
|
CMeshVertex vert3,
|
||||||
|
FMeshUVFloat[][] uvs,
|
||||||
|
int[] indices
|
||||||
|
)
|
||||||
|
{
|
||||||
|
var uvs1 = new List<Vector2>() { (Vector2)vert1.UV };
|
||||||
|
var uvs2 = new List<Vector2>() { (Vector2)vert2.UV };
|
||||||
|
var uvs3 = new List<Vector2>() { (Vector2)vert3.UV };
|
||||||
|
|
||||||
|
foreach (var uv in uvs)
|
||||||
|
{
|
||||||
|
uvs1.Add((Vector2)uv[indices[0]]);
|
||||||
|
uvs2.Add((Vector2)uv[indices[1]]);
|
||||||
|
uvs3.Add((Vector2)uv[indices[2]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (uvs1, uvs2, uvs3);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<RootNamespace>BlitzKit.Game</RootNamespace>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<NodeApiAssemblyJSModuleType>esm</NodeApiAssemblyJSModuleType>
|
||||||
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
|
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="../cue4parse/CUE4Parse/CUE4Parse.csproj" />
|
||||||
|
<ProjectReference Include="../cue4parse/CUE4Parse-Conversion/CUE4Parse-Conversion.csproj" />
|
||||||
|
<PackageReference Include="Microsoft.JavaScript.NodeApi" Version="0.9.19" />
|
||||||
|
<PackageReference Include="Microsoft.JavaScript.NodeApi.Generator" Version="0.9.19" />
|
||||||
|
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.9" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<Solution>
|
||||||
|
<Project Path="game.csproj" />
|
||||||
|
</Solution>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "@blitzkit/game",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"main": "src/index.ts",
|
||||||
|
"scripts": {
|
||||||
|
"build": "dotnet build"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"node-api-dotnet": "^0.9.19"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from "../bin/Debug/net9.0/linux-x64/game.js";
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 95 B |
@@ -1,4 +1,2 @@
|
|||||||
export * from "./literals";
|
export * from "./literals";
|
||||||
export * from "./strings";
|
export * from "./strings";
|
||||||
export * from "./unwrapper";
|
|
||||||
export * from "./wrapper";
|
|
||||||
@@ -1,16 +1,45 @@
|
|||||||
export function literals(
|
export function literals(
|
||||||
string: string,
|
string: string,
|
||||||
literals?: Record<string, string | number | undefined>
|
literals?: Record<string, string | number | undefined>,
|
||||||
) {
|
) {
|
||||||
for (const key in literals) {
|
for (const key in literals) {
|
||||||
const mutated = string.replaceAll(`{${key}}`, `${literals[key]}`);
|
string = string.replaceAll(`{${key}}`, `${literals[key]}`);
|
||||||
|
|
||||||
if (import.meta.env.DEV && mutated === string) {
|
|
||||||
console.warn(`Could not find literal {${key}} in string "${string}"`);
|
|
||||||
}
|
|
||||||
|
|
||||||
string = mutated;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function literalsArray<Type, Literal = Type | string>(
|
||||||
|
string: string,
|
||||||
|
literals?: Record<string, Literal>,
|
||||||
|
) {
|
||||||
|
if (!literals) return [string];
|
||||||
|
|
||||||
|
let array: (string | Literal)[] = [string];
|
||||||
|
|
||||||
|
for (const key in literals) {
|
||||||
|
const value = literals[key];
|
||||||
|
const next: (string | Literal)[] = [];
|
||||||
|
|
||||||
|
for (const chunk of array) {
|
||||||
|
if (typeof chunk !== "string") {
|
||||||
|
next.push(chunk);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const parts = chunk.split(`{${key}}`);
|
||||||
|
|
||||||
|
for (let index = 0; index < parts.length; index++) {
|
||||||
|
if (parts[index]) next.push(parts[index]);
|
||||||
|
|
||||||
|
if (index < parts.length - 1) {
|
||||||
|
next.push(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
array = next;
|
||||||
|
}
|
||||||
|
|
||||||
|
return array;
|
||||||
|
}
|
||||||
@@ -1,68 +1,3 @@
|
|||||||
import { merge } from "ts-deepmerge";
|
import type en from "../strings/en.json";
|
||||||
import locales from "../locales.json";
|
|
||||||
import en from "../strings/en.json";
|
|
||||||
import es from "../strings/es.json";
|
|
||||||
import fr from "../strings/fr.json";
|
|
||||||
import ja from "../strings/ja.json";
|
|
||||||
import pl from "../strings/pl.json";
|
|
||||||
import pt from "../strings/pt.json";
|
|
||||||
import ru from "../strings/ru.json";
|
|
||||||
import uk from "../strings/uk.json";
|
|
||||||
import zh from "../strings/zh.json";
|
|
||||||
|
|
||||||
export type BlitzKitStrings = typeof en;
|
export type Strings = typeof en;
|
||||||
|
|
||||||
const stringsRaw: Record<string, TranslationTree> = {
|
|
||||||
en,
|
|
||||||
es,
|
|
||||||
fr,
|
|
||||||
ja,
|
|
||||||
pl,
|
|
||||||
pt,
|
|
||||||
ru,
|
|
||||||
uk,
|
|
||||||
zh,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const STRINGS: Record<string, BlitzKitStrings> = {};
|
|
||||||
|
|
||||||
for (const locale in stringsRaw) {
|
|
||||||
if (locale === locales.default) {
|
|
||||||
STRINGS[locales.default] = stringsRaw[locales.default] as BlitzKitStrings;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const localeStrings = stringsRaw[locale];
|
|
||||||
STRINGS[locale] = merge(
|
|
||||||
stringsRaw[locales.default],
|
|
||||||
localeStrings,
|
|
||||||
) as BlitzKitStrings;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const SUPPORTED_LOCALE_BLITZ_MAP: Record<string, string> = {
|
|
||||||
en: "en",
|
|
||||||
es: "es",
|
|
||||||
fr: "fr",
|
|
||||||
ja: "ja",
|
|
||||||
pt: "pt",
|
|
||||||
ru: "ru",
|
|
||||||
uk: "uk",
|
|
||||||
zh: "zh-Hans",
|
|
||||||
pl: "pl",
|
|
||||||
};
|
|
||||||
|
|
||||||
export const SUPPORTED_LOCALE_FLAGS: Record<string, string> = {
|
|
||||||
en: "🇺🇸",
|
|
||||||
es: "🇪🇸",
|
|
||||||
fr: "🇫🇷",
|
|
||||||
ja: "🇯🇵",
|
|
||||||
pt: "🇵🇹",
|
|
||||||
ru: "🇷🇺",
|
|
||||||
uk: "🇺🇦",
|
|
||||||
zh: "🇨🇳",
|
|
||||||
pl: "🇵🇱",
|
|
||||||
};
|
|
||||||
|
|
||||||
export type TranslationTree = { [key: string]: TranslationNode };
|
|
||||||
|
|
||||||
export type TranslationNode = string | TranslationTree;
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { I18nString } from "../../core/src";
|
|
||||||
import locales from "../locales.json";
|
|
||||||
|
|
||||||
export function unwrapper(locale = locales.default) {
|
|
||||||
return function (i18nString: I18nString) {
|
|
||||||
if (locale in i18nString.locales) {
|
|
||||||
return i18nString.locales[locale];
|
|
||||||
}
|
|
||||||
|
|
||||||
return i18nString.locales[locales.default];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loaded 100 of 495 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user