Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fb64e690f | ||
|
|
54798c30b1 | ||
|
|
4c0f7b61e4 | ||
|
|
206ac373d2 | ||
|
|
c626e84f7d | ||
|
|
90ec5fa80b | ||
|
|
d496b46b6f | ||
|
|
7af1fdcf6b | ||
|
|
199e156e53 | ||
|
|
f5578ee788 | ||
|
|
c0a3628b3b | ||
|
|
fa8922e0a6 | ||
|
|
bf6991ce06 | ||
|
|
7f49245f15 | ||
|
|
f55313e0cd | ||
|
|
69c388f243 | ||
|
|
35788657a8 | ||
|
|
d531698867 | ||
|
|
cc4177bf14 | ||
|
|
d377067441 | ||
|
|
b2f026c212 | ||
|
|
07cdb0788c | ||
|
|
01f919ddd3 | ||
|
|
4b1fda9680 | ||
|
|
79d03233ae | ||
|
|
522b40aff1 | ||
|
|
06c878dd2c | ||
|
|
f5c589373d | ||
|
|
2689568650 | ||
|
|
fabf649608 | ||
|
|
080af86e1b | ||
|
|
e5b58cd5ff | ||
|
|
3500389628 | ||
|
|
1129f0d60b | ||
|
|
b3a6a47a6a | ||
|
|
bdb3844bcc | ||
|
|
f0bb25efc1 | ||
|
|
bfd23db3ff | ||
|
|
9c63177f03 | ||
|
|
24b4e32f50 | ||
|
|
2e7bde8861 | ||
|
|
56c626e8a1 | ||
|
|
c12eb9f68a | ||
|
|
8bc94e7c10 | ||
|
|
e8e6161911 | ||
|
|
d4f6b1a003 | ||
|
|
6cafbc1ffe | ||
|
|
b3336289e8 | ||
|
|
3b92b43cb3 | ||
|
|
2f3dca8f4c | ||
|
|
0c76f76a5b | ||
|
|
d37e0390fb | ||
|
|
a185dbe644 | ||
|
|
5b9fb1ea00 | ||
|
|
5106b7c97d | ||
|
|
d88cb02d94 | ||
|
|
7fd128ac49 | ||
|
|
a637dca083 | ||
|
|
23a33c7722 | ||
|
|
918a0d73b9 | ||
|
|
ca9f991bcb | ||
|
|
2e9388d3c7 | ||
|
|
383196bdd3 | ||
|
|
e69e66f5f7 | ||
|
|
b9c5c3c931 | ||
|
|
edb9104d77 | ||
|
|
e0feb45f48 | ||
|
|
bc211822aa | ||
|
|
e33ae0f81b | ||
|
|
8467fb98d6 | ||
|
|
62cb2c7217 | ||
|
|
f2331261cf | ||
|
|
26ae7bcbdf | ||
|
|
291b93b7d7 | ||
|
|
73fccbb2bb | ||
|
|
7e92f8ac50 | ||
|
|
da767213cb | ||
|
|
d81eddba44 | ||
|
|
83599539b5 | ||
|
|
c145aa9499 | ||
|
|
ffeaba6a18 | ||
|
|
c68df74943 | ||
|
|
1c3e98678f | ||
|
|
b1a1e07f7d | ||
|
|
46f8c72bef | ||
|
|
a4f2902365 | ||
|
|
bcda936585 | ||
|
|
c16a5f1701 | ||
|
|
569f803ab2 | ||
|
|
7bd797cb3a | ||
|
|
1e875540fc | ||
|
|
bcde6907c8 | ||
|
|
a19c772bba | ||
|
|
24ca684db3 | ||
|
|
6fd8b83d39 | ||
|
|
3ecc87431a | ||
|
|
082e41bd76 | ||
|
|
6f0bfa6b22 | ||
|
|
bcb8669898 | ||
|
|
4bdb4f47fa | ||
|
|
a51cbc51de | ||
|
|
060d00ccc4 | ||
|
|
1ddc51f6c7 | ||
|
|
b222cbe41c | ||
|
|
53b4c0db69 | ||
|
|
ebaef28f06 | ||
|
|
0948b52957 | ||
|
|
bc51c59fe1 | ||
|
|
17a3d45e92 | ||
|
|
2fd8416887 | ||
|
|
46f11af717 | ||
|
|
c0670e9025 | ||
|
|
bc9cc4ba2a | ||
|
|
38ee4c6f12 | ||
|
|
72aa528db2 | ||
|
|
5d63b8c239 | ||
|
|
f78c1ea75f | ||
|
|
38989689f5 | ||
|
|
1e5094f3ff | ||
|
|
067178e94d | ||
|
|
58002958bf | ||
|
|
ca030688cb | ||
|
|
b883f5b9e2 | ||
|
|
85f815c538 | ||
|
|
b2ddd5f286 | ||
|
|
11bbcc7993 | ||
|
|
70f7b862e3 | ||
|
|
544eb92a6b | ||
|
|
7a123b68db | ||
|
|
b89925e86b | ||
|
|
fc1f3cdb55 | ||
|
|
19717aeb79 | ||
|
|
60a115b7d8 | ||
|
|
bc85b354a0 | ||
|
|
1b611fa7c4 | ||
|
|
34ba3ffdde | ||
|
|
af4d2dbfd0 | ||
|
|
0b12f65949 | ||
|
|
b8beb6e8be | ||
|
|
09ba8663e6 | ||
|
|
b7558c33da | ||
|
|
9174f3c9d0 | ||
|
|
2c8c04387b | ||
|
|
b1e5502b04 | ||
|
|
ddf2c2b2ac | ||
|
|
2a70602f7e | ||
|
|
c128d8ab0c | ||
|
|
0e57c37296 | ||
|
|
e0c0ec6fc3 | ||
|
|
31bb92c089 | ||
|
|
417385f231 | ||
|
|
62bfab0960 | ||
|
|
809f807da8 | ||
|
|
8f098d435a | ||
|
|
574b1eec92 | ||
|
|
7bd8629706 | ||
|
|
9d7c60e92d | ||
|
|
12cf05cb50 | ||
|
|
acd7162aa1 | ||
|
|
efbb8376ef | ||
|
|
bc4fa60f67 | ||
|
|
f13b0f2255 | ||
|
|
4ea8615fb5 | ||
|
|
7877eaa89b | ||
|
|
a8a50ac948 | ||
|
|
4206286c21 | ||
|
|
eec9a4c9e6 | ||
|
|
469ffa145a | ||
|
|
e1fdab42c0 | ||
|
|
39238a6491 | ||
|
|
fdc662fedf | ||
|
|
9d805f63d5 | ||
|
|
68273ea295 | ||
|
|
def5e4fa4f | ||
|
|
f3b1240990 | ||
|
|
8c25037cb8 | ||
|
|
31936d6e6c | ||
|
|
cc622ef189 | ||
|
|
6ef0448d9f | ||
|
|
01dc3137d8 | ||
|
|
543e963d1d | ||
|
|
c12a66eeab | ||
|
|
a9f2ba776a | ||
|
|
e7525006b5 | ||
|
|
ded71bf4f9 | ||
|
|
1b9cf8b604 | ||
|
|
01e7353ef4 | ||
|
|
73294af296 | ||
|
|
c3dc844167 | ||
|
|
1eaa276b76 | ||
|
|
2b37e08f19 | ||
|
|
de52b525fb | ||
|
|
8c39b6e3df | ||
|
|
75c6bf2b68 | ||
|
|
0308a10690 | ||
|
|
eab8bac68c | ||
|
|
19783ccbd6 | ||
|
|
10799e52ce | ||
|
|
92bb4af5ec | ||
|
|
846c2a4962 | ||
|
|
84300389f9 | ||
|
|
cb2846a256 | ||
|
|
9cfa2357b0 | ||
|
|
eaa67ba1fe | ||
|
|
d8a5f57787 | ||
|
|
13651650ab | ||
|
|
901f1bfe42 | ||
|
|
8bb5032ee4 | ||
|
|
bf59d127f9 | ||
|
|
4fb0aa3936 | ||
|
|
ed8a1c2f57 | ||
|
|
059358cff4 | ||
|
|
939acad30c | ||
|
|
4d09b3deb1 | ||
|
|
a5c4dad3d4 | ||
|
|
2cb5e4e173 | ||
|
|
708bcab2f3 | ||
|
|
2de077a3ab | ||
|
|
63084d1855 | ||
|
|
1575b803c0 | ||
|
|
afe041f969 | ||
|
|
9644692084 | ||
|
|
b52c3c6c68 | ||
|
|
0260fc6fbc | ||
|
|
73bd76bcdb | ||
|
|
2960f85671 | ||
|
|
34c742555d | ||
|
|
3b1066fade | ||
|
|
6753cedd33 | ||
|
|
2951ccdad5 | ||
|
|
93e405c370 | ||
|
|
016fe1c3d3 | ||
|
|
c816f7a923 | ||
|
|
43b6453fcb | ||
|
|
559fb30da9 | ||
|
|
273ab97d3f | ||
|
|
fcac511a28 | ||
|
|
b811be4284 | ||
|
|
1a19e56523 | ||
|
|
e5a235ba41 | ||
|
|
1448584f2f | ||
|
|
4433855047 | ||
|
|
02f63ee5f0 | ||
|
|
36f0299e51 | ||
|
|
170056cc55 | ||
|
|
a212d2142c | ||
|
|
d89575b25d | ||
|
|
8f9306a3db | ||
|
|
5f9e631011 | ||
|
|
b290c88c1d | ||
|
|
2e888525c6 | ||
|
|
d54c08dc4e | ||
|
|
821076ae59 | ||
|
|
13e11e4e09 | ||
|
|
0ab53a7825 | ||
|
|
15cb472189 | ||
|
|
39a6e2c38e | ||
|
|
7c6c0a2b81 | ||
|
|
3c63323814 | ||
|
|
44f00e042e | ||
|
|
3a99205194 | ||
|
|
c2e550e33d | ||
|
|
b01a03c6ce | ||
|
|
0251bfc842 | ||
|
|
89d4cadb61 | ||
|
|
e33fdffd99 | ||
|
|
082996b152 | ||
|
|
e9c3953085 | ||
|
|
9f2ced6bfd | ||
|
|
281549add3 | ||
|
|
91945a3b27 | ||
|
|
162c7c9e59 | ||
|
|
ba46a2b801 | ||
|
|
13af8688a3 | ||
|
|
fcf7c5c056 | ||
|
|
ab8c52bb75 | ||
|
|
08d4e301d2 | ||
|
|
428a0bbad5 | ||
|
|
4da4cf5259 | ||
|
|
72a24b2770 | ||
|
|
9141f3d63f | ||
|
|
c34edbd3ac | ||
|
|
eea2024549 | ||
|
|
ee74c5ea5b | ||
|
|
158ceca599 | ||
|
|
b8f3c3eece | ||
|
|
e835498e59 | ||
|
|
0250546ab5 | ||
|
|
f820d05082 | ||
|
|
9ba239caf0 | ||
|
|
51a59fe2d4 | ||
|
|
6753d8a073 | ||
|
|
46719cd32a | ||
|
|
47b8f75447 | ||
|
|
ea68c8e82c | ||
|
|
8d1745d47e | ||
|
|
aa93ae6918 | ||
|
|
66cb197b53 | ||
|
|
94cf7ebea8 | ||
|
|
5405da365b | ||
|
|
a0df425115 | ||
|
|
62cf1265f8 | ||
|
|
ba7e772e56 | ||
|
|
8f8c91e0b0 | ||
|
|
5bbe93bcec | ||
|
|
561b59d235 | ||
|
|
38870ca3f7 | ||
|
|
cbe7b42fb8 | ||
|
|
ad1ad80026 | ||
|
|
a6c3ac36ef | ||
|
|
a9e88f6943 | ||
|
|
77ac1453f3 | ||
|
|
e094267223 | ||
|
|
b03589f6f0 | ||
|
|
3486dde8c1 | ||
|
|
c08bf359f5 | ||
|
|
002d0d4bc0 | ||
|
|
7db02aa579 | ||
|
|
b47e6436e7 | ||
|
|
7b6e291a0a | ||
|
|
b8f6394d94 | ||
|
|
0b5c2e42fb | ||
|
|
fce5f19100 | ||
|
|
05ad24c8f5 | ||
|
|
5295aa37be | ||
|
|
3e12d6bb9d | ||
|
|
019514b699 | ||
|
|
a32ee2a344 | ||
|
|
ea480aa365 | ||
|
|
d70a980058 | ||
|
|
3157bc5e1b | ||
|
|
e72b703ab2 | ||
|
|
c1f3c0dc6b | ||
|
|
30f7db1bc2 | ||
|
|
07a147a043 | ||
|
|
9488602f5b | ||
|
|
a0c9895122 | ||
|
|
c1bd91a7f9 | ||
|
|
1d65ff3e0c | ||
|
|
f7fac5ad26 | ||
|
|
e45f055493 | ||
|
|
8946f115c0 | ||
|
|
86353dc1cf | ||
|
|
5168fb4098 | ||
|
|
c04192e15e | ||
|
|
638c2c73da | ||
|
|
f368769068 | ||
|
|
9f347fa1f2 | ||
|
|
b44f897528 | ||
|
|
efd1a80ee1 | ||
|
|
a70100c835 | ||
|
|
f51e365ec4 | ||
|
|
a5e0f33f02 | ||
|
|
dc85b49f9c | ||
|
|
72c90b3e92 | ||
|
|
df566709c8 | ||
|
|
3617e11792 | ||
|
|
b243b12d1c | ||
|
|
d0d28baee0 | ||
|
|
001b0c356f | ||
|
|
4984c522ba | ||
|
|
be64934eb4 | ||
|
|
7669c2d76b | ||
|
|
00244846cb | ||
|
|
480fda34ce | ||
|
|
103c1b4338 | ||
|
|
2acee91524 | ||
|
|
6f42e2835c | ||
|
|
e724069cbd | ||
|
|
417858f21a | ||
|
|
a362301515 | ||
|
|
86fd714923 | ||
|
|
871b746cce | ||
|
|
d12440f60a | ||
|
|
4bb78b2532 | ||
|
|
3cd23cd718 | ||
|
|
59abda933f | ||
|
|
47f5f86da1 | ||
|
|
6094875ffb | ||
|
|
0644c9a67f | ||
|
|
c91ab29a23 | ||
|
|
8f4e33fd5a | ||
|
|
8cf5012602 | ||
|
|
23a23e36bb | ||
|
|
0480445bae | ||
|
|
ae07b8de4c | ||
|
|
4c746cbb86 | ||
|
|
890a4d142b | ||
|
|
ff9bda29cf | ||
|
|
5ca9e29f3d | ||
|
|
c804a3d564 | ||
|
|
369ba08780 | ||
|
|
0692933148 | ||
|
|
26852981ba | ||
|
|
8199bd550d | ||
|
|
c56eaa258d | ||
|
|
d4e8ec125f | ||
|
|
3e3ed35fb0 | ||
|
|
3530e8d0f0 | ||
|
|
a1f6bbdf1f | ||
|
|
b053018958 | ||
|
|
5adc69977b | ||
|
|
a741cc305a | ||
|
|
96f5ad8b96 | ||
|
|
18dbb658ff | ||
|
|
512134162d | ||
|
|
7e1949ccc7 | ||
|
|
db0c4a1d71 | ||
|
|
1c64305678 | ||
|
|
95b8532660 | ||
|
|
9b3c7451b7 | ||
|
|
1911508552 | ||
|
|
f5ac301c7e | ||
|
|
e37b91c2e3 | ||
|
|
0a92dc0d2d | ||
|
|
754b16af10 | ||
|
|
b434bc4c78 | ||
|
|
dba2e2f170 | ||
|
|
312077a74a | ||
|
|
817d77a437 | ||
|
|
13b85e7164 | ||
|
|
352e174af2 | ||
|
|
aadcaedae5 | ||
|
|
40c69382a1 | ||
|
|
8f4ea5f2fd | ||
|
|
a11975adec | ||
|
|
578f6f4d0f | ||
|
|
ae267adf27 | ||
|
|
c76fc97922 | ||
|
|
730ad56677 | ||
|
|
80b161b9fc | ||
|
|
66016dedf0 | ||
|
|
7314f1d9b1 | ||
|
|
605edd547d | ||
|
|
864c29933a | ||
|
|
ff15a37e10 | ||
|
|
237f676af8 | ||
|
|
5e0e80e965 | ||
|
|
586cd84349 | ||
|
|
230b2df5fd | ||
|
|
033d361cea | ||
|
|
dbbde066f8 | ||
|
|
785e9650e5 | ||
|
|
0b697a94bd | ||
|
|
163c41f568 | ||
|
|
0582339332 | ||
|
|
062e6e9626 | ||
|
|
6dfb727fa2 | ||
|
|
d469f990f6 | ||
|
|
909474d4cb | ||
|
|
c9eee14b21 | ||
|
|
7fe35243db | ||
|
|
647c9240a5 | ||
|
|
fe0fdc0964 | ||
|
|
9dc4483d70 | ||
|
|
9ed2b79a4b | ||
|
|
28a9f9a849 | ||
|
|
5044a5be48 | ||
|
|
c4053b9ba8 | ||
|
|
53c00258ac | ||
|
|
99123b733d | ||
|
|
92c81d60db | ||
|
|
9218eb09d6 | ||
|
|
cae4836e17 | ||
|
|
172b410d82 | ||
|
|
371dcad568 | ||
|
|
32ee10445d | ||
|
|
f9d0659bd4 | ||
|
|
f6b4bb3923 | ||
|
|
9ccd183607 | ||
|
|
5e06a606ef | ||
|
|
2f6b186ea8 | ||
|
|
dd8875e951 | ||
|
|
232fc3140c | ||
|
|
8e6d2b9873 | ||
|
|
6239a72bce | ||
|
|
9e0c4ddb9a | ||
|
|
4a6b5e3aa9 | ||
|
|
a7d8f08522 | ||
|
|
6aa4686c30 | ||
|
|
f9ccb06d1f | ||
|
|
1f378137f1 | ||
|
|
7235291e69 | ||
|
|
1f39ecefe4 | ||
|
|
5a25f335cd | ||
|
|
88a6ab2d95 | ||
|
|
5208cf8678 | ||
|
|
857cba902a | ||
|
|
6753a72d97 | ||
|
|
14fb62bda4 | ||
|
|
21122c620b | ||
|
|
cb6ce4f183 | ||
|
|
884531700b | ||
|
|
6ca9e637dc | ||
|
|
0a4e696bc1 | ||
|
|
2cf0bda352 | ||
|
|
35d03c9e21 | ||
|
|
c10060decc | ||
|
|
d408df8b4c | ||
|
|
b3ecb1e9b9 | ||
|
|
9306773b5b | ||
|
|
1245fab7ae | ||
|
|
a6e8dd6632 | ||
|
|
56d8392f12 | ||
|
|
39e4bce254 | ||
|
|
b745ad2fa7 | ||
|
|
ff66d99fc6 | ||
|
|
f15bee34fb | ||
|
|
60164cfb78 | ||
|
|
d543e42268 | ||
|
|
9bd26ef3bf | ||
|
|
0d5b2aedc7 | ||
|
|
3ea872c6a4 | ||
|
|
e65582a432 | ||
|
|
88cc37a6af | ||
|
|
b40b7b2472 | ||
|
|
73f7e84192 | ||
|
|
c9d5b46ae8 | ||
|
|
d4e16048e9 | ||
|
|
daa549e650 | ||
|
|
fe562915cb | ||
|
|
fff42b61e1 | ||
|
|
90ee71c9ca | ||
|
|
a1c80c3d27 | ||
|
|
8b10f2cc4a | ||
|
|
28dde23115 | ||
|
|
b433129354 | ||
|
|
7e0fb82905 | ||
|
|
75bacd5586 | ||
|
|
21daf9f3bb | ||
|
|
fa625dc887 | ||
|
|
376b3f04e5 | ||
|
|
12ee9d381d | ||
|
|
b90938108a | ||
|
|
7b136e61a1 | ||
|
|
0f9f15b268 | ||
|
|
fdd8aac017 | ||
|
|
ce4f7a55b6 | ||
|
|
def75da1d8 | ||
|
|
2b81c71c5a | ||
|
|
436a519db8 | ||
|
|
c624136dc7 | ||
|
|
cd546b274f | ||
|
|
2f650af0f7 | ||
|
|
4ffb7cac7c | ||
|
|
6361b09129 | ||
|
|
cb87a3067c | ||
|
|
510eebd2f4 | ||
|
|
15a8e53e22 | ||
|
|
99fb44633e | ||
|
|
9a8c0399be | ||
|
|
3f264d6a49 | ||
|
|
818a6b38cb | ||
|
|
d60a102c0d | ||
|
|
0627f678ea | ||
|
|
4ad10deb00 | ||
|
|
f61725a021 | ||
|
|
6d2bb7b131 | ||
|
|
9db43db3cf | ||
|
|
7a22ce5af5 | ||
|
|
68239351b5 | ||
|
|
61eab0bca8 | ||
|
|
2aefe3f9e3 | ||
|
|
adb0bb2e69 | ||
|
|
b1a59aa871 | ||
|
|
0a19157dbb | ||
|
|
382a23b661 | ||
|
|
98107291f5 | ||
|
|
c6779a714b | ||
|
|
ef8f0fd72d | ||
|
|
634bd2ea07 | ||
|
|
f8f88ff8f2 | ||
|
|
8a2dc24f7e | ||
|
|
dcc3ab6e4e | ||
|
|
dabeab8612 | ||
|
|
66dbc5b2ed | ||
|
|
2e2ab9b2d9 | ||
|
|
662e0bb9ce | ||
|
|
3f40e94235 | ||
|
|
483b625f2d | ||
|
|
d18cf625d0 | ||
|
|
b42df81b48 | ||
|
|
536fed5448 | ||
|
|
dc01eff812 | ||
|
|
5471c7fa32 | ||
|
|
83e28b4dac | ||
|
|
af95897bde | ||
|
|
4c2f6bea25 | ||
|
|
fdf77a43cb | ||
|
|
f1855a569a | ||
|
|
a0434b6ed2 | ||
|
|
365c714213 | ||
|
|
875abf4d32 | ||
|
|
6b9bf76da2 | ||
|
|
610c75d274 | ||
|
|
81826d0549 | ||
|
|
8caf4069dc | ||
|
|
6c496e616d | ||
|
|
3d5dd54ec0 | ||
|
|
e7bfe81940 | ||
|
|
fb9c04c779 | ||
|
|
84a1af8100 | ||
|
|
b804e60bac | ||
|
|
604e751bf4 | ||
|
|
2ce083222e | ||
|
|
9a44b1fcfb | ||
|
|
9df47777d0 | ||
|
|
aa78bc4045 | ||
|
|
4bfe34ba53 | ||
|
|
ad0fc69596 | ||
|
|
cfe71e15a4 | ||
|
|
bf7a319770 | ||
|
|
cadc84b32f | ||
|
|
7bde92c7f1 | ||
|
|
965d36cdc5 | ||
|
|
f8ef0063e4 | ||
|
|
fb4e00afc4 | ||
|
|
6ed9a191b9 | ||
|
|
b503f4fa8f | ||
|
|
7020e5641f | ||
|
|
5b4601b671 | ||
|
|
3e952faad3 | ||
|
|
c51abc1c64 | ||
|
|
c7e2780d17 | ||
|
|
28e2139683 | ||
|
|
20c839394a | ||
|
|
c5e1a7d6ab | ||
|
|
579d7570af | ||
|
|
1d1d751d43 | ||
|
|
86664b5491 | ||
|
|
b7e9898163 | ||
|
|
d4c0b01343 | ||
|
|
af67126156 | ||
|
|
9930360405 | ||
|
|
4fb61d6dbd | ||
|
|
bcb7ca5c4c | ||
|
|
d1fb5da002 | ||
|
|
17935fbe89 | ||
|
|
48578407db | ||
|
|
bda0c4ef1b | ||
|
|
7ea5e444b3 | ||
|
|
bef362935a | ||
|
|
f3144be382 | ||
|
|
818ee1d447 | ||
|
|
67e45ada85 | ||
|
|
bdc7132337 | ||
|
|
c5214f8d89 | ||
|
|
2be4dbea7a | ||
|
|
b951c81bf5 | ||
|
|
8c221a1295 | ||
|
|
c41f721a96 | ||
|
|
6910f3c95e | ||
|
|
e23f898c5f | ||
|
|
3cf81afc4a | ||
|
|
ca463a0f0e | ||
|
|
a76572ebe3 | ||
|
|
1a92cbd951 | ||
|
|
54c5faf929 | ||
|
|
d1d9e9e4d1 | ||
|
|
5ca64f839e | ||
|
|
4e7cd6f681 | ||
|
|
ba9f593716 | ||
|
|
9d3d74c7c5 | ||
|
|
aae26523ff | ||
|
|
338a2a14bf | ||
|
|
1a66cab435 | ||
|
|
3363c9ab58 | ||
|
|
10f64902aa | ||
|
|
25e1f4caa4 | ||
|
|
222fa89422 | ||
|
|
750e145f03 | ||
|
|
3bbbbfa402 | ||
|
|
f728751fa9 | ||
|
|
f5425d0e54 | ||
|
|
debaaccf4c | ||
|
|
a3e20501af | ||
|
|
c87a75f3fd | ||
|
|
55729c5eda | ||
|
|
06cbcc2339 | ||
|
|
1afe860e76 | ||
|
|
c0ac935652 | ||
|
|
7c76b0f5a5 | ||
|
|
42091c54b7 | ||
|
|
396b48d017 | ||
|
|
5bf83da726 | ||
|
|
bb1c0c7625 | ||
|
|
1170676141 | ||
|
|
7baaaa9db9 | ||
|
|
c1ecef0179 | ||
|
|
393da234e4 | ||
|
|
032d98e6bd | ||
|
|
f4a90cd531 | ||
|
|
82f03583fe | ||
|
|
81c1a50052 | ||
|
|
c7207799e2 | ||
|
|
e0a719ee93 | ||
|
|
ee6d2e7d82 | ||
|
|
14710b5218 | ||
|
|
4b5e0d1c1c | ||
|
|
9968e8346c | ||
|
|
bc4da17f10 | ||
|
|
da56c563fc | ||
|
|
95f4dbf6a0 | ||
|
|
6c36f343ea | ||
|
|
9257ebdd1e | ||
|
|
8f1017195f | ||
|
|
20da294b36 | ||
|
|
a63415461a | ||
|
|
2bb4c78551 | ||
|
|
2909e61721 | ||
|
|
171da2a194 | ||
|
|
933c468e2d | ||
|
|
0d1eb9b12e | ||
|
|
02a03b4d68 | ||
|
|
ef9f3bd361 | ||
|
|
f18b6ee754 | ||
|
|
deb9e463e1 | ||
|
|
c799534009 | ||
|
|
aea01072fb | ||
|
|
ca8dd5a702 | ||
|
|
e79c4a1e3f | ||
|
|
e19d0d948a | ||
|
|
a160ccd095 | ||
|
|
d2d0477186 | ||
|
|
c742c0725d | ||
|
|
9e6343a111 | ||
|
|
faf33b5f2d | ||
|
|
8a78ac7d82 | ||
|
|
d7c7814b3a | ||
|
|
15bf02f829 | ||
|
|
4f62a594b3 | ||
|
|
64253d0120 | ||
|
|
286936131d | ||
|
|
95588ef6b6 | ||
|
|
daef04ccd8 | ||
|
|
86e385c548 | ||
|
|
cc193b99d6 | ||
|
|
c026007937 | ||
|
|
dbc117a9d4 | ||
|
|
34665bd97a | ||
|
|
6d05e607b3 | ||
|
|
14bfc3018b | ||
|
|
7e4f195f94 | ||
|
|
4b6de934a5 | ||
|
|
14fbb595fd | ||
|
|
18a5fb80d0 | ||
|
|
551ef79f03 | ||
|
|
81aec6bad2 | ||
|
|
d08949c597 | ||
|
|
212aee0373 | ||
|
|
059b78c9fb | ||
|
|
11ba5fc28e | ||
|
|
fbde9ec64f | ||
|
|
6600bba58c | ||
|
|
9e340d2e16 | ||
|
|
6f784e9e94 | ||
|
|
62f6aabf05 | ||
|
|
46457a8bdc | ||
|
|
1081e836f5 | ||
|
|
dfe1e37592 | ||
|
|
0b9db21c10 | ||
|
|
57527115d4 | ||
|
|
8d2679c458 | ||
|
|
ca00f18a6a | ||
|
|
466f68701f | ||
|
|
1bb83da253 | ||
|
|
bd1e17bac9 | ||
|
|
322f95e42e | ||
|
|
3ea77f5899 | ||
|
|
882e61ff44 | ||
|
|
d991be4934 | ||
|
|
dfba8bd15f | ||
|
|
87e23673fb | ||
|
|
8fbd1acf4a | ||
|
|
d7dfbaa799 | ||
|
|
04ce20857e | ||
|
|
4550246d63 | ||
|
|
dd673f44ae | ||
|
|
3245284ecc | ||
|
|
3d9872a671 | ||
|
|
f02db2a2d8 | ||
|
|
d1ebb79432 | ||
|
|
44f03a1fce | ||
|
|
6b6ee94d9b | ||
|
|
81c2ca80bc | ||
|
|
c83cec8ed7 | ||
|
|
93ffe5c507 | ||
|
|
8cd1a70333 | ||
|
|
06ae024c2c | ||
|
|
ce8fd0f22f | ||
|
|
7dc1aff1dc | ||
|
|
a60003127f | ||
|
|
7d1ba58806 | ||
|
|
963d71e221 | ||
|
|
2a804fda1c | ||
|
|
597a1a04d2 | ||
|
|
aec6f49ea1 | ||
|
|
e1ad710de5 | ||
|
|
edc8447617 | ||
|
|
f726d4f8e8 | ||
|
|
1f333f6b88 | ||
|
|
9b855fca47 | ||
|
|
c5f433fdf4 | ||
|
|
fd61dae1c1 | ||
|
|
2c45f9759f | ||
|
|
0d3261f748 | ||
|
|
d38e873800 | ||
|
|
ca38914095 | ||
|
|
ee5beeea45 | ||
|
|
a9d40d9f49 | ||
|
|
b8be916c18 | ||
|
|
24d0313fd3 | ||
|
|
c3d2a81327 | ||
|
|
dfeb117663 | ||
|
|
495a830506 | ||
|
|
a730f67ca5 | ||
|
|
9a3867770d | ||
|
|
f8a66bb5e7 | ||
|
|
4b00e1342e | ||
|
|
f9e0584f00 | ||
|
|
900c290e75 | ||
|
|
69e1577d18 | ||
|
|
a6d9044c3a | ||
|
|
9e23d60ef1 | ||
|
|
f12449119c | ||
|
|
533bfc4458 | ||
|
|
1317c2879c | ||
|
|
f9e51f894a | ||
|
|
6fdd4ba833 | ||
|
|
9495ae2336 | ||
|
|
43f634e198 | ||
|
|
ad51be7afc | ||
|
|
15b8bfdf8f | ||
|
|
cb8ae47be6 | ||
|
|
db846c0680 | ||
|
|
630a37025e | ||
|
|
d3bbc7f2b0 | ||
|
|
4e0321ca5f | ||
|
|
ec00bdf9de | ||
|
|
01dd7ad9c6 | ||
|
|
d726005c38 | ||
|
|
4f3e868367 | ||
|
|
ed8bab7df8 | ||
|
|
9bdb14e13a | ||
|
|
b827f7f730 | ||
|
|
07e3660388 | ||
|
|
970ab9004e | ||
|
|
862445259e | ||
|
|
e96538bae0 | ||
|
|
7447ccc487 | ||
|
|
bcd3a00f91 | ||
|
|
8c3675546f | ||
|
|
ec64dab720 | ||
|
|
db976c4ae9 | ||
|
|
0db96795b3 | ||
|
|
59bae96c1b | ||
|
|
d062a0da1b | ||
|
|
d2668974f7 | ||
|
|
78e4c82f20 | ||
|
|
f965452c5d | ||
|
|
be644bb3d9 | ||
|
|
97cc9509c0 | ||
|
|
6dc7a10c2e | ||
|
|
19298b9ad6 | ||
|
|
97d427a6a8 | ||
|
|
bff6eb0503 | ||
|
|
dc9ab2067d | ||
|
|
e8e1f7bafb | ||
|
|
e50a456025 | ||
|
|
d442bbca1a | ||
|
|
92e35bd0ac | ||
|
|
cb9d283f62 | ||
|
|
8aba19e05b | ||
|
|
b7b4035492 | ||
|
|
3667fd82b7 | ||
|
|
691d5cde27 | ||
|
|
7f431b07e1 | ||
|
|
8264f19ad4 | ||
|
|
e3864b86a4 | ||
|
|
e947cfba45 | ||
|
|
e69590c035 | ||
|
|
8b19393d7c | ||
|
|
9480603572 | ||
|
|
90c6535a4c | ||
|
|
258588921a | ||
|
|
525b309037 | ||
|
|
2f941b9224 | ||
|
|
259c4240b5 | ||
|
|
9eb7157fce |
No files matched your search
@@ -1,34 +0,0 @@
|
||||
name: CD Asia Ratings Latest
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
host:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Use node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
cache: "npm"
|
||||
|
||||
- name: Install Yarn
|
||||
run: npm install --location=global yarn
|
||||
|
||||
- name: Use node_modules cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Generate leaderboard
|
||||
run: GH_TOKEN=${{ secrets.GH_TOKEN }} yarn publish:ratingsleaderboard --region=asia --latest
|
||||
@@ -1,34 +0,0 @@
|
||||
name: CD Asia Ratings Leaderboards
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 17 * * *"
|
||||
|
||||
jobs:
|
||||
host:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Use node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
cache: "npm"
|
||||
|
||||
- name: Install Yarn
|
||||
run: npm install --location=global yarn
|
||||
|
||||
- name: Use node_modules cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Generate leaderboard
|
||||
run: GH_TOKEN=${{ secrets.GH_TOKEN }} yarn publish:ratingsleaderboard --region=asia
|
||||
@@ -0,0 +1,53 @@
|
||||
name: CD Build Assets
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: dev
|
||||
workflow_dispatch:
|
||||
# schedule:
|
||||
# - cron: '0 0 * * *'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Use node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install Yarn
|
||||
run: npm install --location=global yarn
|
||||
|
||||
- name: Use node_modules cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Add fixed sharp
|
||||
run: yarn add [email protected] --ignore-engines
|
||||
|
||||
- name: Setup DepotDownloader
|
||||
run: yarn setup:depotdownloader
|
||||
|
||||
- name: Run DepotDownloader
|
||||
run: ./temp/depotDownloader/DepotDownloader.exe -app 444200 -username ${{ secrets.DEPOT_DOWNLOADER_USERNAME }} -password "${{ secrets.DEPOT_DOWNLOADER_PASSWORD }}"
|
||||
|
||||
- name: Build assets
|
||||
run: |
|
||||
$env:GH_TOKEN = "${{ secrets.GH_TOKEN }}"
|
||||
$env:DISCORD_TOKEN = "${{ secrets.DISCORD_TOKEN }}"
|
||||
yarn build:assets --all-targets --depot ${{ github.ref == 'refs/heads/main' && '--production' || '' }}
|
||||
@@ -2,7 +2,7 @@ name: CD Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
branches: main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
name: CD Host
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: main
|
||||
schedule:
|
||||
- cron: '0 */5 * * *'
|
||||
workflow_dispatch:
|
||||
@@ -29,4 +31,4 @@ jobs:
|
||||
unzip bot.zip
|
||||
|
||||
- name: Run bot
|
||||
run: NODE_ENV=production GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} WARGAMING_APPLICATION_ID=${{ WARGAMING_APPLICATION_ID }} node --enable-source-maps --trace-warnings bot/index.cjs
|
||||
run: NODE_ENV=production GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DISCORD_BLITZ_DB=${{ secrets.DISCORD_BLITZ_DB }} node --enable-source-maps index.cjs
|
||||
@@ -1,8 +1,12 @@
|
||||
name: CD Europe Ratings Latest
|
||||
name: CD Ratings Asia
|
||||
|
||||
# latest: '0 0 * * *'
|
||||
# asia midnight: '0 17 * * *'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
- cron: '0 0 * * *'
|
||||
- cron: '0 17 * * *'
|
||||
|
||||
jobs:
|
||||
host:
|
||||
@@ -16,7 +20,7 @@ jobs:
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
cache: "npm"
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install Yarn
|
||||
run: npm install --location=global yarn
|
||||
@@ -24,11 +28,11 @@ jobs:
|
||||
- name: Use node_modules cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
path: '**/node_modules'
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Generate leaderboard
|
||||
run: GH_TOKEN=${{ secrets.GH_TOKEN }} yarn publish:ratingsleaderboard --region=eu --latest
|
||||
run: GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} yarn publish:ratingsleaderboard --region=asia --target=${{ github.event.schedule == '0 0 * * *' && 'latest' || 'midnight' }}
|
||||
@@ -1,8 +1,12 @@
|
||||
name: CD North America Ratings Latest
|
||||
name: CD Ratings Europe
|
||||
|
||||
# latest: '0 0 * * *'
|
||||
# eu midnight: '0 23 * * *'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
- cron: '0 23 * * *'
|
||||
|
||||
jobs:
|
||||
host:
|
||||
@@ -31,4 +35,4 @@ jobs:
|
||||
run: yarn
|
||||
|
||||
- name: Generate leaderboard
|
||||
run: GH_TOKEN=${{ secrets.GH_TOKEN }} yarn publish:ratingsleaderboard --region=na --latest
|
||||
run: GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} yarn publish:ratingsleaderboard --region=eu --target=${{ github.event.schedule == '0 0 * * *' && 'latest' || 'midnight' }}
|
||||
@@ -1,8 +1,12 @@
|
||||
name: CD Europe Ratings Leaderboards
|
||||
name: CD Ratings North America
|
||||
|
||||
# latest: '0 0 * * *'
|
||||
# na midnight: '0 5 * * *'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 23 * * *"
|
||||
- cron: '0 0 * * *'
|
||||
- cron: '0 5 * * *'
|
||||
|
||||
jobs:
|
||||
host:
|
||||
@@ -16,7 +20,7 @@ jobs:
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
cache: "npm"
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install Yarn
|
||||
run: npm install --location=global yarn
|
||||
@@ -24,11 +28,11 @@ jobs:
|
||||
- name: Use node_modules cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
path: '**/node_modules'
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Generate leaderboard
|
||||
run: GH_TOKEN=${{ secrets.GH_TOKEN }} yarn publish:ratingsleaderboard --region=eu
|
||||
run: GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} yarn publish:ratingsleaderboard --region=na --target=${{ github.event.schedule == '0 0 * * *' && 'latest' || 'midnight' }}
|
||||
@@ -1,6 +1,6 @@
|
||||
name: CI Build
|
||||
name: CI Build Bot
|
||||
|
||||
on: [push, pull_request]
|
||||
on: push
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: CI Build
|
||||
name: CI Build Docs
|
||||
|
||||
on: [push, pull_request]
|
||||
on: push
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: CI Build
|
||||
name: CI Build Website
|
||||
|
||||
on: [push, pull_request]
|
||||
on: push
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
name: CD North America Ratings Leaderboards
|
||||
name: CI Version
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 5 * * *'
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
host:
|
||||
@@ -31,4 +29,4 @@ jobs:
|
||||
run: yarn
|
||||
|
||||
- name: Generate leaderboard
|
||||
run: GH_TOKEN=${{ secrets.GH_TOKEN }} yarn publish:ratingsleaderboard --region=na
|
||||
run: yarn lint:version
|
||||
@@ -13,4 +13,8 @@ test.*
|
||||
/docs/.vitepress/cache
|
||||
servers.csv
|
||||
.next/
|
||||
tsconfig.tsbuildinfo
|
||||
tsconfig.tsbuildinfo
|
||||
temp/
|
||||
/.yarn
|
||||
/.VSCodeCounter
|
||||
/.yarn
|
||||
@@ -1,49 +1,151 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"AABBOX",
|
||||
"Abhi",
|
||||
"accountinfo",
|
||||
"aeson",
|
||||
"alphatest",
|
||||
"apcr",
|
||||
"artefacts",
|
||||
"atgm",
|
||||
"AYUV",
|
||||
"bbox",
|
||||
"bepaint",
|
||||
"betakrieg",
|
||||
"BINORMAL",
|
||||
"Binormals",
|
||||
"bkwd",
|
||||
"blitzstars",
|
||||
"Camo",
|
||||
"CDON",
|
||||
"classname",
|
||||
"cleandist",
|
||||
"cockroackdb",
|
||||
"Coef",
|
||||
"cooldown",
|
||||
"corsproxy",
|
||||
"CUBEMAP",
|
||||
"CUBETEXCOORD",
|
||||
"customperiod",
|
||||
"datasource",
|
||||
"Ddpf",
|
||||
"Ddsd",
|
||||
"debugflags",
|
||||
"deburr",
|
||||
"decalmask",
|
||||
"defence",
|
||||
"degressive",
|
||||
"devkrieg",
|
||||
"diacriticless",
|
||||
"donotremove",
|
||||
"drei",
|
||||
"Droodles",
|
||||
"dvpl",
|
||||
"DVPLCRC",
|
||||
"dxgi",
|
||||
"Everytime",
|
||||
"FASTNAME",
|
||||
"FOURCC",
|
||||
"fsformat",
|
||||
"Fullscreen",
|
||||
"fullstats",
|
||||
"fuzzysort",
|
||||
"gamemode",
|
||||
"glsl",
|
||||
"GLTF",
|
||||
"haha",
|
||||
"highp",
|
||||
"iife",
|
||||
"immer",
|
||||
"Inclusivity",
|
||||
"JOINTINDEX",
|
||||
"JOINTWEIGHT",
|
||||
"kranvagn",
|
||||
"krieg",
|
||||
"Leaderboard",
|
||||
"leaderboards",
|
||||
"lerp",
|
||||
"LINEARSIZE",
|
||||
"loddist",
|
||||
"lods",
|
||||
"metallicness",
|
||||
"minitelrose",
|
||||
"MIPMAPCOUNT",
|
||||
"modeltransform",
|
||||
"MURICA",
|
||||
"NEGATIVEX",
|
||||
"NEGATIVEY",
|
||||
"NEGATIVEZ",
|
||||
"nmatname",
|
||||
"noout",
|
||||
"normalmap",
|
||||
"Oopsy",
|
||||
"OPTML",
|
||||
"outdir",
|
||||
"outfile",
|
||||
"ownedtanks",
|
||||
"PIXELFORMAT",
|
||||
"playerachievements",
|
||||
"playerinfo",
|
||||
"pngjs",
|
||||
"POSITIVEX",
|
||||
"POSITIVEY",
|
||||
"POSITIVEZ",
|
||||
"Promisable",
|
||||
"Pyogenics",
|
||||
"ratingsleaderboard",
|
||||
"ratingsplot",
|
||||
"raycaster",
|
||||
"researchable",
|
||||
"Resvg",
|
||||
"roboto",
|
||||
"SCPG",
|
||||
"searchclans",
|
||||
"searchplayers",
|
||||
"searchtanks",
|
||||
"SHAREDEXP",
|
||||
"SKLLD",
|
||||
"Smri",
|
||||
"Specularity",
|
||||
"SSAO",
|
||||
"startcase",
|
||||
"statsfull",
|
||||
"steamapps",
|
||||
"Stringifying",
|
||||
"struct",
|
||||
"structs",
|
||||
"strvk",
|
||||
"subnation",
|
||||
"Synx",
|
||||
"tankaverages",
|
||||
"Tankerch",
|
||||
"tankopedia",
|
||||
"tankopedias",
|
||||
"tankstats",
|
||||
"texconv",
|
||||
"TEXCOORD",
|
||||
"tresabhi",
|
||||
"tungstentip",
|
||||
"TYPELESS",
|
||||
"ubjson",
|
||||
"Unicum",
|
||||
"UNORM",
|
||||
"Unregistering",
|
||||
"vickers",
|
||||
"vitepress",
|
||||
"Vovko",
|
||||
"wargaming",
|
||||
"webp",
|
||||
"winrate",
|
||||
"wireframe",
|
||||
"wotblitz",
|
||||
"xffn",
|
||||
"xkdkw",
|
||||
"XMLDVPL",
|
||||
"YAMLDVPL",
|
||||
"zustand"
|
||||
],
|
||||
"deno.enable": false,
|
||||
"deno.unstable": false
|
||||
"deno.unstable": false,
|
||||
"cSpell.enableFiletypes": ["glsl"]
|
||||
}
|
||||
@@ -1,21 +1,23 @@
|
||||
# blitzkrieg
|
||||
# Blitzkrieg
|
||||
|
||||
A Discord bot for anything and everything related to World of Tanks Blitz.
|
||||
[](https://codeium.com)
|
||||
|
||||
## Invite the Bot
|
||||
Tools for everything World of Tanks Blitz
|
||||
|
||||
Join the [Discord server](https://discord.gg/nDt7AjGJQH), click on the bot's profile, and click "Add to Server".
|
||||
## Invite the bot
|
||||
|
||||
## Using
|
||||
Go to [application directory for Blitzkrieg](https://discord.com/application-directory/1097673957865443370) and click "Add to Server." Voila! You're ready to go.
|
||||
|
||||
### Installing dependencies
|
||||

|
||||
|
||||
```bash
|
||||
yarn
|
||||
```
|
||||
## Visit the website
|
||||
|
||||
### Running
|
||||
### https://blitz-krieg.vercel.app/
|
||||
|
||||
```bash
|
||||
yarn start discord-token=<token> wargaming-application-id=<id>
|
||||
```
|
||||

|
||||
|
||||
## Visit the documentation website
|
||||
|
||||
### https://tresabhi.github.io/blitzkrieg/
|
||||
|
||||

|
||||
@@ -8,5 +8,7 @@
|
||||
"sklld_peasant_role": "896878529512370228",
|
||||
|
||||
"tres_guild_id": "734786591205359697",
|
||||
"tres_log_channel": "1109262265850544148"
|
||||
"tres_log_channel": "1109262265850544148",
|
||||
|
||||
"test_guild_id": "1124729294829142116"
|
||||
}
|
||||
@@ -13,7 +13,7 @@ export default defineConfig({
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{ text: 'Home', link: '/' },
|
||||
{ text: 'Guide', link: '/guide/about' },
|
||||
{ text: 'Guide', link: '/guide/introduction' },
|
||||
],
|
||||
|
||||
sidebar: [
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# Blitzkrieg 1.13.1
|
||||
|
||||
The quickest minor update in town 🤠
|
||||
|
||||
## Changes
|
||||
|
||||
- Added a title, description, and icon to the website
|
||||
- Added display options to the session tracker
|
||||
|
||||
## Fixes
|
||||
|
||||
- Center aligned stats in breakdown to work better on low width devices
|
||||
- Center aligned the Blitzkrieg logo in the navbar
|
||||
|
||||
## Technical Changes
|
||||
|
||||
- Added up-to-date information to `README.md` and embed docs
|
||||
@@ -0,0 +1,7 @@
|
||||
# Blitzkrieg 1.13.2
|
||||
|
||||
One lonely albeit important fix.
|
||||
|
||||
## Fixes
|
||||
|
||||
- Gradients for `/stats` now use Radix's new hex values
|
||||
@@ -0,0 +1,7 @@
|
||||
# Blitzkrieg 1.13.3
|
||||
|
||||
Streamer's delight!
|
||||
|
||||
## Features
|
||||
|
||||
- Added config context menu for the session tracker embed
|
||||
@@ -0,0 +1,45 @@
|
||||
# Blitzkrieg 1.14.0
|
||||
|
||||
Elegance has never been met like this before
|
||||
|
||||
## Features
|
||||
|
||||
- Added `/link`
|
||||
- Unlike `/verify`, `/link` links you Discord and Blitz accounts across all servers
|
||||
- This command does not change your nickname
|
||||
- `/link` now simply displays a deprecation message
|
||||
- Usernames can still be inputted per-command to override your linked account
|
||||
- `/stats` and `/full-stats` are now way simpler
|
||||
- `/stats <type> <period>` has been replaced with `/stats <30|60|90|...>` (likewise, `/full-stats`)
|
||||
- These commands now have filters without having to opt into `multi-tank`
|
||||
- Added `/breakdown`
|
||||
- Unlike `/today`, `/breakdown` lets you select any period of time
|
||||
- `/breakdown` now simply displays a deprecation message
|
||||
- `/about commands` are now sorted alphabetically
|
||||
- Added a `/reset` button to the options dropdown and embed context-menu
|
||||
|
||||
## Changes
|
||||
|
||||
- Simplified no ongoing ratings season edge case
|
||||
- Updated welcome message for Skilled server to use `/link` and other up-to-date information
|
||||
- Tier weights are now reported in Arabic numerals instead of Roman
|
||||
- Removed tank images from `/owned-tanks`
|
||||
- Wargaming messed up their API and almost no tanks have any images anymore
|
||||
|
||||
## Fixes
|
||||
|
||||
- Banners now use a more economical `.webp` format just like the home page
|
||||
- Removed unused color palettes
|
||||
|
||||
## Technical changes
|
||||
|
||||
- Guild commands are now handled more efficiently
|
||||
- Removed nickname-based Blitz username inference
|
||||
- Code split a lot of common functionalities
|
||||
- Re-arranged `core` folder
|
||||
- Added midnight and latest ratings leaderboard caches
|
||||
- Merged renderers into their primary user files
|
||||
- Added sharding
|
||||
- Disabled for now but good for future proofing
|
||||
- Switched to a way cleaner logging schema
|
||||
- Hosting is now done in 6 hour periods instead of 5
|
||||
@@ -0,0 +1,17 @@
|
||||
# Blitzkrieg 1.14.1
|
||||
|
||||
Oopsy daisy, a memory leak!
|
||||
|
||||
## Changes
|
||||
|
||||
- Simplified message for users to use `/link`
|
||||
|
||||
## Fixes
|
||||
|
||||
- Fixed a memory leak in the render thread manager
|
||||
|
||||
## Technical changes
|
||||
|
||||
- Added `UserError` extending `Error`
|
||||
- This lets the bot avoid spamming the debug console for mistakes users make
|
||||
- Reduced render threads to 2
|
||||
@@ -0,0 +1,8 @@
|
||||
# Blitzkrieg 1.14.2
|
||||
|
||||
A late night hot fix for my homies
|
||||
|
||||
## Fixes
|
||||
|
||||
- Clan info is now fetched using `clan_id` instead of `account_id`
|
||||
- Generic stats row names are now bounded by a max width
|
||||
@@ -0,0 +1,24 @@
|
||||
# Blitzkrieg 1.14.3
|
||||
|
||||
Pull your brush out and start polishing.
|
||||
|
||||
## Changes
|
||||
|
||||

|
||||
|
||||
- Rows in `/breakdown` are now chunked into `8` per image
|
||||
- This is true unless the number of pages exceeds `10` in which case the rows are even distributed across all `10` pages
|
||||
- `10` is the maximum number of images that Discord allows
|
||||
- Short region names are used in username autocomplete instead of their full names
|
||||
- Example: "North America" is "NA" now
|
||||
|
||||
## Fixes
|
||||
|
||||
- Removed reference to username inference in the username option description
|
||||
- Removed an unnecessary type `asd` that did absolutely nothing used nowhere
|
||||
|
||||
## Technical changes
|
||||
|
||||
- Image orders are now preserved even if processed in parallel and all completed out of order
|
||||
- `fetchBlitz` is now throttled to `10` requests per second
|
||||
- Request overflows are managed by queueing
|
||||
@@ -0,0 +1,7 @@
|
||||
# Blitzkrieg 1.14.4
|
||||
|
||||
Streamers get some knowledge today
|
||||
|
||||
## Changes
|
||||
|
||||
- Added a video in the embed button prompt
|
||||
@@ -0,0 +1,72 @@
|
||||
# Blitzkrieg 1.15.0
|
||||
|
||||
Ratings will never be the same.
|
||||
|
||||
## Features
|
||||
|
||||

|
||||
|
||||
- Blitzkrieg ratings leaderboard
|
||||
- Available at https://blitz-krieg.vercel.app/tools/ratings
|
||||
- **Highly experimental; [please report bugs on Discord server](https://discord.gg/nDt7AjGJQH)**
|
||||
- Current season leaderboards are live meaning that there may be scores and positions that are out of order
|
||||
- Options
|
||||
- Regions can be swapped between NA, EU, and Asia
|
||||
- The current season and all archived season (from 49 and onwards) are available
|
||||
- Jump: used to jump to certain players
|
||||
- Score: finds the first player with at least your desired score
|
||||
- Position: finds the player at that position
|
||||
- League: finds the top-most player in that league
|
||||
- Player: finds the player
|
||||
- **Jumping to scores and positions for the current season is a compounding function (hence the loading screen) and is limited to the speed of Wargaming's APIs which is pretty darn slow**
|
||||
- Page controls
|
||||
- Flip between pages left and right
|
||||
- 33 players are loaded at once
|
||||
- Left control is disabled on the first page and vice versa
|
||||
- Page turning controls are also disabled if the next/previous page hasn't loaded yet
|
||||
- Page numbers can be manually typed in the text field too
|
||||
- This is available both at the top and the bottom of the screen
|
||||
- Players
|
||||
- Shows the position of the player
|
||||
- Shows the player nickname and clan name
|
||||
- "Deleted player ID" us shown when loading a deleted player
|
||||
- A skeleton is shown when the player and clan is loading
|
||||
- Shows the player percentile
|
||||
- Shows reward for the position
|
||||
- This is blank when there is no reward
|
||||
- This column isn't available for archived seasons
|
||||
- Shows the score
|
||||
- A skeleton is shown when loading
|
||||
- Click on a row to highlight it
|
||||
- Using a jump button also highlights a row
|
||||
- `/credits`: thanks who helped made this project
|
||||
|
||||
## Changes
|
||||
|
||||
- Error messages that user face are now even more simplified
|
||||
- Increased username and clan autocomplete size limits to `25`
|
||||
- Added capability for per-page accent theming
|
||||
- Example: the ratings page is red while the session tracker is blue
|
||||
- Simplified welcome message for SKLLD clan server
|
||||
|
||||
## Technical Changes
|
||||
|
||||
- Isolated tankopedia info
|
||||
- Implemented `corsproxy.io` for non-timeout tolerant endpoints
|
||||
- Latest archived season number is now data driven
|
||||
- Ratings archives are now public
|
||||
- This eliminates the need of `octokit`
|
||||
- Ratings leaderboard archiver is now error tolerant
|
||||
- Fetch attempts are made every `1000ms`
|
||||
- Blitz errors are now managed better freeing up the queue faster
|
||||
- Isolated first archived season number
|
||||
- Added more advanced PSAs
|
||||
- These can now feature images or embeds
|
||||
- These can now modify message contents
|
||||
- These can also now be secret
|
||||
|
||||
## Experimental Changes
|
||||
|
||||
- Added tankopedia extractor
|
||||
- Retrieves tankopedia data from the game files
|
||||
- This is not utilized as of right now
|
||||
@@ -0,0 +1,24 @@
|
||||
# Blitzkrieg 1.15.1
|
||||
|
||||
'MURICA!
|
||||
|
||||
## Changes
|
||||
|
||||
- "Neighbor" is now spelled in the American way
|
||||
- Updated documentation website with the latest information
|
||||
|
||||
## Fixes
|
||||
|
||||
- Fixed the guide link on the documentation website
|
||||
|
||||
## Technical features
|
||||
|
||||
- Added capability to fetch patiently while also parsing the JSON
|
||||
|
||||
## Technical changes
|
||||
|
||||
- Removed neighbor relative position caching
|
||||
|
||||
## Technical fixes
|
||||
|
||||
- `/ratings` now uses the non-caching APIs
|
||||
@@ -0,0 +1,23 @@
|
||||
# Blitzkrieg 1.15.10
|
||||
|
||||
The 10th patch for the `1.15` update is here, breaking the record of the most patches for a single update!
|
||||
|
||||
## Features
|
||||
|
||||
- Added `/today`
|
||||
- This is a direct alias for `/breakdown today`
|
||||
- Drastically simplified ratings command
|
||||
- `/ratings current` and `/ratings archive` have been now merged
|
||||
- Where the data is fetched from is now decided directly from the chosen season number
|
||||
- Simplified many error messages
|
||||
- Title bar description text is now centered when there is no image
|
||||
- It always felt awkward when there was no image on the left but the left still aligned to the right
|
||||
- Removed `/link`'s requirement to select a username explicitly from the search results
|
||||
- Full names for regions are now used in the `/link` command
|
||||
- So "NA" turns into "North America"
|
||||
|
||||
## Fixes
|
||||
|
||||
- Fixed contrast issues with WN8 percentile colors behind white text
|
||||
- Archived ratings neighbors now functions once again
|
||||
- Disabled tankopedia; this feature isn't finished yet and the changes were accidentally leaked
|
||||
@@ -0,0 +1,11 @@
|
||||
# Blitzkrieg 1.15.11
|
||||
|
||||
There's an easter egg somewhere in this update 🤔
|
||||
|
||||
## Features
|
||||
|
||||
- Added `/permissions` which lists all permissions required to run the bot and checks if the bot has them or not
|
||||
|
||||
## Changes
|
||||
|
||||
- Error messages now do no use embeds, instead utilize simple headings and paragraphs
|
||||
@@ -0,0 +1,8 @@
|
||||
# Blitzkrieg 1.15.12
|
||||
|
||||
Sometimes embeds need love too.
|
||||
|
||||
## Changes
|
||||
|
||||
- Session embeds are now translucent by default
|
||||
- Session embed titles are now the username of the player by default
|
||||
@@ -0,0 +1,7 @@
|
||||
# Blitzkrieg 1.15.13
|
||||
|
||||
I have run out of things to say here. This patch fixes like 1 thing haha.
|
||||
|
||||
# Technical Fixes
|
||||
|
||||
- Tank deltas are now filtered by last battle time
|
||||
@@ -0,0 +1,9 @@
|
||||
# Blitzkrieg 1.15.2
|
||||
|
||||
Infinity reduced to a finite value.
|
||||
|
||||
## Fixes
|
||||
|
||||
- Added a maximum value to the jump to position button
|
||||
- Removed neighbor checking for the seeding player
|
||||
- This fixes the jump to position button not loading at all
|
||||
@@ -0,0 +1,30 @@
|
||||
# Blitzkrieg 1.15.3
|
||||
|
||||
The bot now gets more expressive!
|
||||
|
||||
## Features
|
||||
|
||||
- The bot can now have presence messages; examples:
|
||||
- "Living in {number} servers"
|
||||
- "Server {number} users"
|
||||
- "Observing {number} channels"
|
||||
- More will be added in the future! Give me some ideas
|
||||
|
||||
## Changes
|
||||
|
||||
- Moved `/credits` to `/about creators`
|
||||
- `/debug` command now ditches embeds and has better information to serve
|
||||
|
||||
## Technical Features
|
||||
|
||||
- Added a workflow and lint for package and changelog version miss match
|
||||
|
||||
## Technical Changes
|
||||
|
||||
- Removed manual trigger for Asian latest ratings leaderboard archiver
|
||||
- Leaderboard archiver now accepts an explicit target like `midnight` or `latest`
|
||||
- Combined midnight and latest leaderboard archival workflow into one file
|
||||
|
||||
## Technical Fixed
|
||||
|
||||
- Reviewed all workflow triggers and updated them
|
||||
@@ -0,0 +1,13 @@
|
||||
# Blitzkrieg 1.15.4
|
||||
|
||||
Unlocking future potential
|
||||
|
||||
## Technical Changes
|
||||
|
||||
- Moved the word "Ratings" to the front of the workflow name
|
||||
- Renamed `blitzkrieg-db` to `blitzkrieg-assets`
|
||||
- Moved the region folders from the root to `regions`
|
||||
|
||||
## Technical Fixes
|
||||
|
||||
- The ratings leaderboard archiver now correctly skips undefined players
|
||||
@@ -0,0 +1,7 @@
|
||||
# Blitzkrieg 1.15.5
|
||||
|
||||
Oops, this should've been in the last patch.
|
||||
|
||||
## Fixes
|
||||
|
||||
- User and channel cache is now guild cache exhaustive
|
||||
@@ -0,0 +1,11 @@
|
||||
# Blitzkrieg 1.15.6
|
||||
|
||||
This should have also been in the last update lol.
|
||||
|
||||
## Changes
|
||||
|
||||
- Changed the format of `/about creators` and added one more person
|
||||
|
||||
## Fixes
|
||||
|
||||
- Archived ratings leaderboards are now fetched from the correct URL path
|
||||
@@ -0,0 +1,20 @@
|
||||
# Blitzkrieg 1.15.7
|
||||
|
||||
Simple yet powerful theming options for the session tracker
|
||||
|
||||
## Features
|
||||
|
||||
- The accent color of the session tracker (hence the embed too) can now be tweaked
|
||||
- Access this setting via the dropdown from Options > Accent color
|
||||
|
||||
## Fixes
|
||||
|
||||
- Reimplemented the commas for last numbers in the overflow count of the ratings leaderboard
|
||||
- For example, "+1234567 more" will now read "+1,234,567 more"
|
||||
|
||||
## Technical Features
|
||||
|
||||
- Added class names for more in-depth customization for those who are comfortable with CSS
|
||||
- `session-tracker-root`
|
||||
- `session-tracker-row`
|
||||
- `session-tracker-row-stat`
|
||||
@@ -0,0 +1,9 @@
|
||||
# Blitzkrieg 1.15.8
|
||||
|
||||
A request fulfilled \:\)
|
||||
|
||||
## Features
|
||||
|
||||
- Added custom titles in session tracker
|
||||
- Change the title through Options > Edit title...
|
||||
- Colors are shown when selecting a theme color for the session tracker
|
||||
@@ -0,0 +1,13 @@
|
||||
# Blitzkrieg 1.15.9
|
||||
|
||||
~~Curiosity killed the cat~~ Ratings killed the Blitzkrieg
|
||||
|
||||
## Fixes
|
||||
|
||||
- Deleted ratings players are now handled properly
|
||||
|
||||
## Technical Fixes
|
||||
|
||||
- Latest archived season number
|
||||
- Is now cached properly
|
||||
- Is now fetched in a chaining fashion correctly
|
||||
@@ -0,0 +1,72 @@
|
||||
# Blitzkrieg 1.16.0
|
||||
|
||||
This version introduces the long awaited (and desperately needed) Blitzkrieg Tankopedia.
|
||||
|
||||
## Credits
|
||||
|
||||
- [Pyogenics](https://github.com/pyogenics): technical documentation on WoTB 3d models
|
||||
- [aeson](https://discord.gg/WHdER7ZPAD): human encyclopedia on WoTB file layout
|
||||
- [\[OPTML\]](https://discord.gg/Su8w9KtEVE), [\_34](https://www.twitch.tv/34wotb), [Droodles_YT](https://www.youtube.com/@DroodlesBlitz): Tankopedia beta-testing
|
||||
- Minitelrose, ChickenMan7777: external module exceptions
|
||||
|
||||
## Features
|
||||
|
||||
- Added Tankopedia
|
||||
- Check out the tool here: https://blitz-krieg.vercel.app/tools/tankopedia
|
||||
- The root page features a search engine for efficiently finding tanks
|
||||
- Search bar: lets you search tanks via it's name
|
||||
- Sort: lets you sort tanks by their statistics and generic things like names and tiers
|
||||
- Reset button (trash icon): resets all filters and sorts
|
||||
- Test tanks: lets you control wether you want to include test tanks
|
||||
- Tree type filter: filters tech tree, premium, and collector tanks
|
||||
- Nations: filters tanks by nation
|
||||
- Tank type filter: filters tanks by tank designation
|
||||
- Tier filter: filters tanks by tier
|
||||
- The search result itself displays the national flag, tier, type, image, and name of the tank
|
||||
- Clicking on the tank redirects you to the tank's page
|
||||
- Tankopedia page
|
||||
- Tank sandbox: the first thing you'll see is a 3D model of the tank
|
||||
- On slim mobile devices, click "Load model" to reveal it
|
||||
- Model tab
|
||||
- This model has all PBR features and is identical to the one in the game
|
||||
- You can click and drag the turret to rotate it
|
||||
- You can do the same with the gun but with the added control of elevating and depressing it
|
||||
- Armor tab
|
||||
- Shows red where the tank (the protagonist) cannot be penetrated
|
||||
- You can switch the shells that the shooter (the antagonist) shoots
|
||||
- By default, the antagonist tank is the same as the protagonist
|
||||
- You can change antagonists using the antagonist bar
|
||||
- Searching through antagonists is identical to the root search page
|
||||
- You may also swap the protagonist and antagonist using the swap button
|
||||
- Click on the tank's armor anywhere to get intimate details about it
|
||||
- Shows spaced armor, gaps between layers of armor, ricochets, penetration losses over events, thickness, angled thicknesses, and angles
|
||||
- View button (eye icon): allows you to pose the tank in a few preset configurations
|
||||
- Sandbox settings
|
||||
- Green penetration: shows the penetrable parts of the tank as green instead of using transparency
|
||||
- Show grid: shows a grid under the tank
|
||||
- View environment: shows the lighting environment around the tank
|
||||
- Lighting: preset lighting environments
|
||||
- Wireframe: displays armor as vertices instead of faces
|
||||
- Fullscreen button: toggles fullscreen
|
||||
- Note that some functionalities are disabled in fullscreen
|
||||
- Modules: switch around modules to view it change live in the 3D model and affect stats
|
||||
- Provisions, equipments, miscellaneous, and consumables also affect stats
|
||||
- Stats
|
||||
- As you switch around the configurations of the tank, the change in stats are displayed using green and red arrows with delta numbers
|
||||
- Statistics also display their units
|
||||
- Fire section
|
||||
- This deals with statistics relating to the firepower of the tank
|
||||
- You can switch shells that the stats are based on using the buttons to the right of the title
|
||||
- You can also view the penetration loss over distance using the slider if available under the penetration section
|
||||
- Statistics for maneuverability, survivability, and crew training are also displayed
|
||||
|
||||
## Changes
|
||||
|
||||
- Navigation bar
|
||||
- Added credit to myself along with the logo and moved the whole thing to the left side
|
||||
- Added a link to the discord icon to the right
|
||||
- Removed polka dots from the background
|
||||
|
||||
## Fixes
|
||||
|
||||
- The `/ratings` command once again has the username field as an optional parameter
|
||||
@@ -0,0 +1,28 @@
|
||||
# Blitzkrieg 1.16.1
|
||||
|
||||
Armor sandbox gains 25% rendering speed and 40% memory efficiency with added accuracy and features.
|
||||
|
||||
## Features
|
||||
|
||||
- Multiple layers of spaced armors are now calculated properly by the visual armor highlighting
|
||||
- Added opaque mode to view armor highlighting without any transparency
|
||||
- Added breakdown on layers of armor penetrated
|
||||
- Penetration of each layer is shown represented by a color and an index
|
||||
- Green: penetration
|
||||
- Red: blocked
|
||||
- Yellow: ricochet
|
||||
- This also shows layers encountered after a ricochet
|
||||
|
||||
## Fixes
|
||||
|
||||
- Accuracy now doesn't drop the further the shot is placed from the origin
|
||||
- HE shells no longer loose penetration like how HEAT shells do when traveling between layers of armor
|
||||
- Persistent settings are now merged in the correct order making them truly persistent now
|
||||
- Enhanced armor and calibrated shells are now properly synced from the get go
|
||||
|
||||
## Technical Changes
|
||||
|
||||
- Spaced armor and external module scenes have been merged
|
||||
- They now use additive blending
|
||||
- Colors are now normalized by the penetration value instead of maximum armor plate thickness
|
||||
- Shell normalization now doesn't violate arccosine's domain
|
||||
@@ -0,0 +1,101 @@
|
||||
# Cedilla Object Notation
|
||||
|
||||
This documentation uses an experimental binary notation syntax called "Buffer Up".
|
||||
|
||||
1. JSON compressed as CDON, written directly to disk (a direct 50% reduction).
|
||||
2. CDON further compressed with LZ4 (a clean 90% reduction).
|
||||
3. The raw JSON file as fetched from a random data source.
|
||||
4. CDON decompressed once again to JSON. Note that this file is a little larger than the original JSON file as it contains a lot more decimal places due to float precision (this shouldn't affect the size in memory).
|
||||
|
||||

|
||||
|
||||
FS stands for "Fast String".
|
||||
|
||||
```cpp
|
||||
primary CedillaObjectNotation {
|
||||
utf8"CDON" magic;
|
||||
Header header;
|
||||
primary Body<header.fsFormat> body;
|
||||
}
|
||||
|
||||
Header {
|
||||
uint16 version;
|
||||
FSFormat fsFormat;
|
||||
StringTable<fsFormat> stringTable;
|
||||
}
|
||||
|
||||
FSFormat enum<uint8> {
|
||||
Format8,
|
||||
Format16,
|
||||
Format32,
|
||||
}
|
||||
|
||||
FSPrimitive<FSFormat fsFormat> match(fsFormat) {
|
||||
Format8: uint8;
|
||||
Format16: uint16;
|
||||
Format32: uint32;
|
||||
}
|
||||
|
||||
StringTable<FSFormat fsFormat> {
|
||||
FSPrimitive<fsFormat> count;
|
||||
String[count] strings;
|
||||
}
|
||||
|
||||
Body<FSFormat fsFormat> {
|
||||
primary Value<fsFormat> object;
|
||||
}
|
||||
|
||||
ValueType enum<uint8> {
|
||||
Null,
|
||||
Boolean,
|
||||
Uint8,
|
||||
Uint16,
|
||||
Uint32,
|
||||
Uint64,
|
||||
Int8,
|
||||
Int16,
|
||||
Int32,
|
||||
Int64,
|
||||
Float32,
|
||||
Float64,
|
||||
String,
|
||||
FS,
|
||||
Array,
|
||||
Object,
|
||||
}
|
||||
|
||||
String {
|
||||
uint32 length;
|
||||
primary utf8<length> value;
|
||||
}
|
||||
|
||||
StringValue Value & { (ValueType.String | ValueType.FS) type }
|
||||
|
||||
Value<FSFormat fsFormat> {
|
||||
ValueType type;
|
||||
match<type> {
|
||||
Boolean: { uint8 value; }
|
||||
Uint8: { uint8 value; }
|
||||
Uint16: { uint16 value; }
|
||||
Uint32: { uint32 value; }
|
||||
Uint64: { uint64 value; }
|
||||
Int8: { int8 value; }
|
||||
Int16: { int16 value; }
|
||||
Int32: { int32 value; }
|
||||
Int64: { int64 value; }
|
||||
Float32: { float32 value; }
|
||||
Float64: { float64 value; }
|
||||
String: { String value; }
|
||||
FS: { FSPrimitive<fsFormat> index; }
|
||||
Array: {
|
||||
uint32 count;
|
||||
Value[count] values;
|
||||
}
|
||||
Object: {
|
||||
uint32 count;
|
||||
StringValue[count] keys;
|
||||
Value[count] values;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,15 @@
|
||||
# Team
|
||||
|
||||
- TrèsAbhi: creator & programmer
|
||||
- Prince_NA: game advisor & tester
|
||||
|
||||
# Contributors
|
||||
|
||||
- S0AP: bot verification process & initial advertizement platform
|
||||
- Vovko: discord bot rendering pipeline
|
||||
- Maddox: game file decompression
|
||||
- Pyogenics: tank model decompression
|
||||
- Aeson: game files layout
|
||||
- Minitelrose, ChickenMan7777: 3-caliber rule edge cases
|
||||
- \_34, HisRoyalFatness, Synx, xkdkw: embed UX
|
||||
- [OPTML], Aeson, \_34, Droodles: beta testing tankopedia
|
||||
@@ -0,0 +1,17 @@
|
||||
# Damage Per Minute (DPM)
|
||||
|
||||
The damage per minute of a tank is the average damage that can be dealt in that tank with the first shell (usually AP) in 60 seconds.
|
||||
|
||||
## Regular and Auto Loaders
|
||||
|
||||
The damage per minute for these types of guns are calculated by allowing the gun to shoot as soon as the shell is loaded (and in the case of auto loaders, the clip is dumped as fast as the inter-clip time will allow).
|
||||
|
||||
## Auto Reloaders
|
||||
|
||||
These types of guns have 3 DPM values.
|
||||
|
||||
- Damage per minute: calculated if you were to treat the shells like a normal auto loader where you dump all shells, wait for all shells to reload, and repeat.
|
||||
- Maximum: some tanks gain DPM the deeper they go into the clip and others maintain a higher DPM the less shells used. The "maximum" DPM is calculated if you were to treat the gun as a single-shot regular gun with the shell with the lowest reload. The shell with the highest DPM is listed as "Optimal shell index."
|
||||
- Effective: this is the maximum DPM tacked on with dumping the remaining shells at the beginning or the end of the 60 seconds.
|
||||
- If "Optimal shell index" is 1, the clip must be dumped first then used as a single shot.
|
||||
- If "Optimal shell index" is any other number, the gun should be treated as a single shot then dumped for the highest effective DPM.
|
||||
@@ -1,23 +1,23 @@
|
||||
# Embeds
|
||||
|
||||
Embeds are generated by a few commands as a URL that can be loaded in a browser/streaming software.
|
||||
Embeds are URLs generated by commands or tools that represent the "naked" version of the respective command or tool
|
||||
|
||||
## Creating Embeds
|
||||
|
||||
1. Use a command of your liking (for example, `/stats`).
|
||||
2. Customize the command however you like and the URL generated for the embed will match your needs.
|
||||
3. Send the command and when the bot is "done thinking," an "Embed" button will appear below the bot's reply.
|
||||
1. Use a command or tool and click on "Embed" if it's available
|
||||
2. Make sure to tweak the settings of the command or tool because embeds replicate everything
|
||||
|
||||
## Using Embeds in Streaming Softwares
|
||||
|
||||
1. Click on the "Embed" button.
|
||||
2. Copy the URL from your browser.
|
||||
3. Paste the URL into a Browser Source.
|
||||
4. Set the refresh rate/FPS to something very low like `0.0167` (that's 1 frame every 60 seconds).
|
||||
1. Click on the "Embed" button
|
||||
- If this was generated by a command, copy the URL from the browser
|
||||
- If this was generated by a tool, the URL has been copied to your clipboard already
|
||||
2. Paste this URL into your streaming service as a "Browser Source"
|
||||
- Tool embeds use local storage so data won't be transferred from you browser to your streaming software
|
||||
- Make sure to visit the tool's page in your streaming software (using the "Interact" feature) and then open the embed
|
||||
- Set your browser source refresh rate to `1Hz` because that's how fast embeds refresh
|
||||
|
||||
## How Embeds Behave
|
||||
|
||||
- They load like any normal website albeit with a significant delay.
|
||||
- They auto refresh every `60s`.
|
||||
- All embeds and images generated by Blitzkrieg have a width of `640px` but the height varies and must be found manually through trial and error.
|
||||
- It's okay to have a Browser Source that has a height larger than needed as Blitzkrieg embeds are transparent.
|
||||
- They load like any normal website
|
||||
- They auto refresh every `1s`
|
||||
@@ -1,17 +0,0 @@
|
||||
# Installing Blitzkrieg
|
||||
|
||||
It's easy as 1, 2, 3!
|
||||
|
||||
## Step 1
|
||||
|
||||
Join a server that already has Blitzkrieg or [join our official Discord server](https://discord.gg/nDt7AjGJQH).
|
||||
|
||||
## Step 2
|
||||
|
||||
View the bot's profile and click "Add to Server".
|
||||
|
||||
<video src="https://i.imgur.com/Zq0P3m2.mp4" autoplay loop muted width=320 title="how to install"></video>
|
||||
|
||||
## Step 3
|
||||
|
||||
Review the permissions the bot is asking for and add it to your server!
|
||||
@@ -1,6 +1,10 @@
|
||||
# Introduction
|
||||
|
||||
Blitzkrieg is a multipurpose bot for anything and everything World of Tanks Blitz.
|
||||
🎉 Services for everything and anything World of Tanks Blitz
|
||||
|
||||
## Bot
|
||||
|
||||
Blitzkrieg is available as a Discord bot and can be [installed very easily](/guide/invite).
|
||||
|
||||
- Track statistics
|
||||
- Find inactive players in a clan
|
||||
@@ -8,3 +12,11 @@ Blitzkrieg is a multipurpose bot for anything and everything World of Tanks Blit
|
||||
- Create embeds for streams
|
||||
- Track a player/tanks statistical evolution
|
||||
- ...and a variety of other similar things
|
||||
|
||||
## Website
|
||||
|
||||
Provides a bunch of very helpful tools; https://blitz-krieg.vercel.app/
|
||||
|
||||
- Session tracker
|
||||
- Ratings leaderboard
|
||||
- Way more to come
|
||||
@@ -1,7 +0,0 @@
|
||||
# Permissions
|
||||
|
||||
The following Discord permissions are required by the bot to ensure full functionality:
|
||||
|
||||
- Manage nicknames
|
||||
- Read messages / view channels
|
||||
- Attach files
|
||||
@@ -12,10 +12,10 @@ hero:
|
||||
actions:
|
||||
- theme: brand
|
||||
text: Add to Discord Server
|
||||
link: guide/install
|
||||
link: /guide/invite
|
||||
- theme: alt
|
||||
text: Guide
|
||||
link: /guide/about
|
||||
link: /guide/introduction
|
||||
|
||||
features:
|
||||
- title: Clean and Efficient UI
|
||||
|
||||
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 183 KiB |
@@ -1,12 +1,21 @@
|
||||
import { createVanillaExtractPlugin } from '@vanilla-extract/next-plugin';
|
||||
|
||||
const withVanillaExtract = createVanillaExtractPlugin();
|
||||
const withVanillaExtract = createVanillaExtractPlugin({ tests: /\.css$/ });
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
...withVanillaExtract(),
|
||||
...withVanillaExtract({
|
||||
webpack: (config) => {
|
||||
config.module.rules.push({
|
||||
test: /\.glsl$/,
|
||||
type: 'asset/source',
|
||||
});
|
||||
return config;
|
||||
},
|
||||
}),
|
||||
|
||||
distDir: 'dist/website',
|
||||
reactStrictMode: false,
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"main": "server.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "node --enable-source-maps --trace-warnings server.cjs"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "blitzkrieg",
|
||||
"version": "1.13.0",
|
||||
"description": "🎉 All-in-one Discord bot for everything World of Tanks Blitz",
|
||||
"version": "1.16.0",
|
||||
"description": "🎉 Tools for everything World of Tanks Blitz",
|
||||
"main": "src/server.ts",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -9,58 +9,93 @@
|
||||
"build:website": "next build",
|
||||
"build:docs": "vitepress build docs",
|
||||
"build:ratingsleaderboard": "vite-node --script scripts/buildRatingsLeaderboard",
|
||||
"build:assets": "vite-node --max_old_space_size=16384 --script scripts/buildAssets/index",
|
||||
"build:test": "vite-node --script scripts/buildTest",
|
||||
"build:ratingsplot": "vite-node --script scripts/buildRatingsPlot",
|
||||
"dev:bot": "yarn build:bot && yarn start:bot",
|
||||
"dev:docs": "vitepress dev docs",
|
||||
"dev:website": "next dev",
|
||||
"start:bot": "node --enable-source-maps --trace-warnings dist/bot/index.cjs",
|
||||
"start:bot": "node --enable-source-maps dist/bot/index.cjs",
|
||||
"start:website": "next start",
|
||||
"host:docs": "vitepress preview docs",
|
||||
"publish:ratingsleaderboard": "vite-node --script scripts/buildRatingsLeaderboard --publish",
|
||||
"zip": "zip -r dist.zip dist",
|
||||
"lint": "npx tsc",
|
||||
"lint:website": "next lint",
|
||||
"format": "prettier --write \"**/*.@(json|js|jsx|css|md|ts|tsx|html|xml|yml|gltf)\"",
|
||||
"lint:version": "vite-node --script scripts/checkVersionMissMatch",
|
||||
"knip": "knip",
|
||||
"update": "yarn upgrade --latest"
|
||||
"update": "yarn upgrade --latest",
|
||||
"setup:depotdownloader": "vite-node --script scripts/setupDepotDownloader"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@gltf-transform/core": "^3.9.0",
|
||||
"@octokit/plugin-throttling": "^8.1.3",
|
||||
"@octokit/rest": "^20.0.1",
|
||||
"@prisma/client": "^5.4.1",
|
||||
"@radix-ui/colors": "^3.0.0-rc.4",
|
||||
"@radix-ui/react-icons": "^1.3.0",
|
||||
"@radix-ui/themes": "^1.1.2",
|
||||
"@radix-ui/themes": "^2.0.1",
|
||||
"@react-three/drei": "^9.93.0",
|
||||
"@react-three/fiber": "^8.15.14",
|
||||
"@resvg/resvg-js": "^2.4.1",
|
||||
"@types/three": "^0.160.0",
|
||||
"@vanilla-extract/css": "^1.13.0",
|
||||
"@vercel/analytics": "^1.2.2",
|
||||
"bepaint": "^0.1.0-beta.3",
|
||||
"decompress": "^4.2.1",
|
||||
"discord.js": "^14.13.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"esbuild": "^0.19.3",
|
||||
"express": "^4.18.2",
|
||||
"false": "^0.0.4",
|
||||
"fuzzysort": "^2.0.4",
|
||||
"immer": "^10.0.2",
|
||||
"js-yaml": "^4.1.0",
|
||||
"lodash": "^4.17.21",
|
||||
"lz4js": "^0.2.0",
|
||||
"markdown-escape": "^2.0.0",
|
||||
"next": "^13.5.2",
|
||||
"next": "^14.1.0",
|
||||
"parse-dds": "^1.2.1",
|
||||
"postprocessing": "^6.34.1",
|
||||
"react": "^18.2.0",
|
||||
"react-device-detect": "^2.2.3",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-fuzzysort": "^1.0.1",
|
||||
"react-promise-suspense": "^0.3.4",
|
||||
"react-spinners": "^0.13.8",
|
||||
"satori": "^0.10.8",
|
||||
"sharp": "0.33.1",
|
||||
"three": "0.159.0",
|
||||
"three-stdlib": "^2.29.4",
|
||||
"vite-node": "^0.34.5",
|
||||
"vitepress": "^1.0.0-rc.20",
|
||||
"vitepress-plugin-auto-sidebar": "^1.1.0",
|
||||
"yaml": "^2.3.4",
|
||||
"zustand": "^4.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@total-typescript/ts-reset": "^0.5.1",
|
||||
"@types/decompress": "^4.2.7",
|
||||
"@types/escape-html": "^1.0.2",
|
||||
"@types/express": "^4.17.18",
|
||||
"@types/js-yaml": "^4.0.8",
|
||||
"@types/lodash": "^4.14.199",
|
||||
"@types/lz4": "^0.6.4",
|
||||
"@types/markdown-escape": "^1.1.0",
|
||||
"@types/node": "^20.6.5",
|
||||
"@types/parse-dds": "^1.0.3",
|
||||
"@types/pngjs": "^6.0.4",
|
||||
"@types/react": "^18.2.22",
|
||||
"@vanilla-extract/next-plugin": "^2.3.1",
|
||||
"compare-versions": "^6.1.0",
|
||||
"knip": "^2.27.1",
|
||||
"crc": "^4.3.2",
|
||||
"fast-xml-parser": "^4.3.2",
|
||||
"knip": "^3.4.0",
|
||||
"lz4": "^0.6.5",
|
||||
"prettier": "^3.0.3",
|
||||
"prisma": "^5.4.1",
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
},
|
||||
"packageManager": "[email protected]"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "discord_blitz" (
|
||||
"discord" INT8 NOT NULL,
|
||||
"region" STRING NOT NULL,
|
||||
"blitz" INT4 NOT NULL,
|
||||
|
||||
CONSTRAINT "discord_blitz_pkey" PRIMARY KEY ("discord")
|
||||
);
|
||||
@@ -0,0 +1,3 @@
|
||||
# Please do not edit this file manually
|
||||
# It should be added in your version-control system (i.e. Git)
|
||||
provider = "cockroachdb"
|
||||
@@ -0,0 +1,14 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "cockroachdb"
|
||||
url = env("DISCORD_BLITZ_DB")
|
||||
}
|
||||
|
||||
model discord_blitz {
|
||||
discord BigInt @id
|
||||
region String
|
||||
blitz Int
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.6 MiB |
|
After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 8.2 MiB After Width: | Height: | Size: 5.4 MiB |
|
Before Width: | Height: | Size: 2.0 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 3.8 MiB After Width: | Height: | Size: 2.4 MiB |
|
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 2.4 MiB After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 177 KiB |
@@ -1,27 +1,44 @@
|
||||
import { build } from 'esbuild';
|
||||
import { cp, readdir } from 'fs/promises';
|
||||
|
||||
console.log('Building bot...');
|
||||
readdir('src/workers').then((workers) => {
|
||||
const files = [
|
||||
'bot',
|
||||
'index',
|
||||
|
||||
await build({
|
||||
entryPoints: ['src/bot.ts'],
|
||||
outfile: 'dist/bot/index.cjs',
|
||||
...workers.map((file) => `workers/${file.replace('.ts', '')}`),
|
||||
];
|
||||
|
||||
platform: 'node',
|
||||
tsconfig: 'tsconfig.esbuild.json',
|
||||
loader: {
|
||||
'.node': 'copy',
|
||||
'.ttf': 'file',
|
||||
},
|
||||
format: 'cjs',
|
||||
jsx: 'transform',
|
||||
build({
|
||||
entryPoints: files.map((file) => `src/${file}.ts`),
|
||||
outdir: 'dist/bot',
|
||||
|
||||
bundle: true,
|
||||
sourcemap: true,
|
||||
minifyIdentifiers: false, // cause goofy errors
|
||||
minifySyntax: true,
|
||||
minifyWhitespace: true,
|
||||
platform: 'node',
|
||||
tsconfig: 'tsconfig.esbuild.json',
|
||||
loader: {
|
||||
'.node': 'copy',
|
||||
'.ttf': 'file',
|
||||
},
|
||||
format: 'cjs',
|
||||
jsx: 'transform',
|
||||
outExtension: {
|
||||
'.js': '.cjs',
|
||||
},
|
||||
|
||||
logLevel: 'info',
|
||||
bundle: true,
|
||||
sourcemap: true,
|
||||
minifyIdentifiers: false, // causes goofy errors
|
||||
minifySyntax: true,
|
||||
minifyWhitespace: true,
|
||||
|
||||
logLevel: 'info',
|
||||
});
|
||||
});
|
||||
|
||||
console.log('Built bot');
|
||||
// copy schema.prisma
|
||||
cp('prisma/schema.prisma', 'dist/bot/schema.prisma');
|
||||
readdir('node_modules/prisma').then((files) =>
|
||||
files
|
||||
.filter((file) => file.endsWith('.node'))
|
||||
.map((file) => cp(`node_modules/prisma/${file}`, `dist/bot/${file}`)),
|
||||
);
|
||||
@@ -0,0 +1,48 @@
|
||||
import { readdir } from 'fs/promises';
|
||||
import sharp from 'sharp';
|
||||
import { readDVPLFile } from '../../src/core/blitz/readDVPLFile';
|
||||
import { readStringDVPL } from '../../src/core/blitz/readStringDVPL';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
|
||||
export async function boosterIcons(production: boolean) {
|
||||
const boosterFiles = (await readdir(`${DATA}/${POI.boosterIcons}`)).filter(
|
||||
(file) => !file.endsWith('@2x.txt.dvpl') && !file.startsWith('texture0'),
|
||||
);
|
||||
const image = sharp(
|
||||
await readDVPLFile(`${DATA}/${POI.boosterIcons}/texture0.packed.webp.dvpl`),
|
||||
);
|
||||
const changes: FileChange[] = [];
|
||||
|
||||
await Promise.all(
|
||||
boosterFiles.map(async (file) => {
|
||||
const name = file.match(/booster_(.+).txt.dvpl/)![1];
|
||||
const sizes = (
|
||||
await readStringDVPL(`${DATA}/${POI.boosterIcons}/${file}`)
|
||||
)
|
||||
.split('\n')[4]
|
||||
.split(' ')
|
||||
.map(Number);
|
||||
const content = (
|
||||
await image
|
||||
.clone()
|
||||
.extract({
|
||||
left: sizes[0],
|
||||
top: sizes[1],
|
||||
width: sizes[2],
|
||||
height: sizes[3],
|
||||
})
|
||||
.toBuffer()
|
||||
).toString('base64');
|
||||
|
||||
changes.push({
|
||||
path: `icons/boosters/${name}.webp`,
|
||||
content,
|
||||
encoding: 'base64',
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('booster icons', changes, production);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { readDVPLFile } from '../../src/core/blitz/readDVPLFile';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
|
||||
export async function camouflageIcons(production: boolean) {
|
||||
console.log('Building camouflage icons...');
|
||||
const content = await readDVPLFile(
|
||||
`${DATA}/${POI.defaultCamoIcon.replace('.webp', '.packed.webp.dvpl')}`,
|
||||
).then((content) => content.toString('base64'));
|
||||
const changes: FileChange[] = [
|
||||
{
|
||||
content,
|
||||
encoding: 'base64',
|
||||
path: 'icons/camo.webp',
|
||||
},
|
||||
];
|
||||
|
||||
await commitAssets('camo icons', changes, production);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { readdir } from 'fs/promises';
|
||||
import { readBase64DVPL } from '../../src/core/blitz/readBase64DVPL';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
|
||||
export async function circleFlags(production: boolean) {
|
||||
const flags = await readdir(`${DATA}/${POI.flags}`);
|
||||
const changes = await Promise.all(
|
||||
flags
|
||||
.filter(
|
||||
(flag) =>
|
||||
flag.startsWith('flag_profile-stat_') &&
|
||||
!flag.endsWith('@2x.packed.webp.dvpl'),
|
||||
)
|
||||
.map(async (flag) => {
|
||||
const content = await readBase64DVPL(`${DATA}/${POI.flags}/${flag}`);
|
||||
const name = flag.match(/flag_profile-stat_(.+)\.packed\.webp/)![1];
|
||||
|
||||
return {
|
||||
content,
|
||||
encoding: 'base64',
|
||||
path: `flags/circle/${name}.webp`,
|
||||
} satisfies FileChange;
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('circle flags', changes, production);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import { readdir } from 'fs/promises';
|
||||
import { argv } from 'process';
|
||||
|
||||
const isDepot = argv.includes('--depot');
|
||||
export const DATA = isDepot
|
||||
? await (async () => {
|
||||
const [installationVersion] = await readdir('depots/444202');
|
||||
return `depots/444202/${installationVersion}/Data`;
|
||||
})()
|
||||
: 'C:/Program Files (x86)/Steam/steamapps/common/World of Tanks Blitz/Data';
|
||||
|
||||
export const POI = {
|
||||
vehicleDefinitions: 'XML/item_defs/vehicles',
|
||||
strings: 'Strings',
|
||||
cachedStrings: 'https://stufficons.wgcdn.co/localizations/en.yaml',
|
||||
tankParameters: '3d/Tanks/Parameters',
|
||||
smallIcons: 'Gfx/UI/BattleScreenHUD/SmallTankIcons',
|
||||
bigIcons: 'Gfx/UI/BigTankIcons',
|
||||
flags: 'Gfx/Lobby/flags',
|
||||
'3d': '3d',
|
||||
bigShellIcons: 'Gfx/Shared/tank-supply/ammunition/big',
|
||||
moduleIcons: 'Gfx/UI/ModulesTechTree',
|
||||
collisionMeshes: '3d/Tanks/CollisionMeshes',
|
||||
optionalDevices: 'XML/item_defs/vehicles/common/optional_devices.xml',
|
||||
optionalDeviceSlots:
|
||||
'XML/item_defs/vehicles/common/optional_device_slots.xml',
|
||||
optionalDeviceImageMappings:
|
||||
'UI/Screens3/Lobby/Inventory/OptionalDevices/OptionalDevicesItemImage.style.yaml',
|
||||
optionalDevicesImage:
|
||||
'Gfx/UI/InventoryIcons/Big/OptionalDevices/texture0.packed.webp',
|
||||
consumablesCommon: 'XML/item_defs/vehicles/common/consumables/common.xml',
|
||||
consumableIcons: 'Gfx/UI/InventoryIcons/Big/Consumables',
|
||||
provisionIcons: 'Gfx/UI/InventoryIcons/Big/Provisions',
|
||||
equipmentItemImageMappings:
|
||||
'UI/Screens3/Lobby/Inventory/Equipment/EquipmentItemImage.style.yaml',
|
||||
provisionsCommon: 'XML/item_defs/vehicles/common/provisions/common.xml',
|
||||
defaultCamoIcon: 'Gfx/UI/Hangar/IconCamouflage.webp',
|
||||
boosterIcons: 'Gfx/Shared/boosters',
|
||||
} as const;
|
||||
@@ -0,0 +1,164 @@
|
||||
import sharp from 'sharp';
|
||||
import { readDVPLFile } from '../../src/core/blitz/readDVPLFile';
|
||||
import { readStringDVPL } from '../../src/core/blitz/readStringDVPL';
|
||||
import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL';
|
||||
import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
import { ConsumablesCommon, ProvisionsCommon } from './definitions';
|
||||
|
||||
interface Mappings {
|
||||
Header: { version: number };
|
||||
StyleSheets: {
|
||||
selectors: string[];
|
||||
properties: { 'bg-sprite': string };
|
||||
}[];
|
||||
}
|
||||
|
||||
export async function consumableProvisionIcons(production: boolean) {
|
||||
console.log('Building consumable and provision icons...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
const consumablesTexture = sharp(
|
||||
await readDVPLFile(
|
||||
`${DATA}/${POI.consumableIcons}/texture0.packed.webp.dvpl`,
|
||||
),
|
||||
);
|
||||
const provisionsTexture = sharp(
|
||||
await readDVPLFile(
|
||||
`${DATA}/${POI.provisionIcons}/texture0.packed.webp.dvpl`,
|
||||
),
|
||||
);
|
||||
|
||||
const equipmentItemImageMappings = await readYAMLDVPL<Mappings>(
|
||||
`${DATA}/${POI.equipmentItemImageMappings}.dvpl`,
|
||||
);
|
||||
const consumablesCommon = await readXMLDVPL<{
|
||||
root: ConsumablesCommon;
|
||||
}>(`${DATA}/${POI.consumablesCommon}.dvpl`);
|
||||
const provisionsCommon = await readXMLDVPL<{
|
||||
root: ProvisionsCommon;
|
||||
}>(`${DATA}/${POI.provisionsCommon}.dvpl`);
|
||||
const styleSheets = Object.values(equipmentItemImageMappings.StyleSheets);
|
||||
|
||||
await Promise.all(
|
||||
Object.values(consumablesCommon.root).map(async (consumable) => {
|
||||
const styleSheet = styleSheets.find((styleSheet) =>
|
||||
styleSheet.selectors.includes(
|
||||
`.equipment_item.${consumable.icon} * .equipment-img`,
|
||||
),
|
||||
);
|
||||
|
||||
if (!styleSheet) {
|
||||
console.warn(
|
||||
`No style sheet found for consumable ${consumable.icon}; skipping...`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const configPath = styleSheet.properties['bg-sprite']
|
||||
.replace('~res:/', '')
|
||||
.replace('.psd', '')
|
||||
.replace('.txt', '');
|
||||
|
||||
if (configPath.startsWith('Gfx/Shared')) {
|
||||
const image = sharp(
|
||||
await readDVPLFile(`${DATA}/${configPath}.packed.webp.dvpl`),
|
||||
);
|
||||
const content = (
|
||||
await image.trim({ threshold: 100 }).toBuffer()
|
||||
).toString('base64');
|
||||
|
||||
changes.push({
|
||||
path: `icons/consumables/${consumable.id}.webp`,
|
||||
encoding: 'base64',
|
||||
content,
|
||||
});
|
||||
} else {
|
||||
const sizes = (await readStringDVPL(`${DATA}/${configPath}.txt.dvpl`))
|
||||
.split('\n')[4]
|
||||
.split(' ')
|
||||
.map(Number);
|
||||
const content = (
|
||||
await consumablesTexture
|
||||
.clone()
|
||||
.extract({
|
||||
left: sizes[0],
|
||||
top: sizes[1],
|
||||
width: sizes[2],
|
||||
height: sizes[3],
|
||||
})
|
||||
.toBuffer()
|
||||
).toString('base64');
|
||||
|
||||
changes.push({
|
||||
path: `icons/consumables/${consumable.id}.webp`,
|
||||
encoding: 'base64',
|
||||
content,
|
||||
});
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
await Promise.all(
|
||||
Object.values(provisionsCommon.root).map(async (provision) => {
|
||||
const styleSheet = styleSheets.find((styleSheet) =>
|
||||
styleSheet.selectors.includes(
|
||||
`.equipment_item.${provision.icon} * .equipment-img`,
|
||||
),
|
||||
);
|
||||
|
||||
if (!styleSheet) {
|
||||
console.warn(
|
||||
`No style sheet found for provision ${provision.icon}; skipping...`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const configPath = styleSheet.properties['bg-sprite']
|
||||
.replace('~res:/', '')
|
||||
.replace('.psd', '')
|
||||
.replace('.txt', '');
|
||||
|
||||
if (configPath.startsWith('Gfx/Shared')) {
|
||||
const image = sharp(
|
||||
await readDVPLFile(`${DATA}/${configPath}.packed.webp.dvpl`),
|
||||
);
|
||||
const content = (
|
||||
await image.trim({ threshold: 100 }).toBuffer()
|
||||
).toString('base64');
|
||||
|
||||
changes.push({
|
||||
path: `icons/provisions/${provision.id}.webp`,
|
||||
encoding: 'base64',
|
||||
content,
|
||||
});
|
||||
} else {
|
||||
const sizes = (await readStringDVPL(`${DATA}/${configPath}.txt.dvpl`))
|
||||
.split('\n')[4]
|
||||
.split(' ')
|
||||
.map(Number);
|
||||
const content = (
|
||||
await provisionsTexture
|
||||
.clone()
|
||||
.extract({
|
||||
left: sizes[0],
|
||||
top: sizes[1],
|
||||
width: sizes[2],
|
||||
height: sizes[3],
|
||||
})
|
||||
.toBuffer()
|
||||
).toString('base64');
|
||||
|
||||
changes.push({
|
||||
path: `icons/provisions/${provision.id}.webp`,
|
||||
encoding: 'base64',
|
||||
content,
|
||||
});
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('consumable and provision icons', changes, production);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
import sharp from 'sharp';
|
||||
import { readDVPLFile } from '../../src/core/blitz/readDVPLFile';
|
||||
import { readStringDVPL } from '../../src/core/blitz/readStringDVPL';
|
||||
import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL';
|
||||
import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
import { OptionalDevices } from './definitions';
|
||||
|
||||
interface Mappings {
|
||||
Header: { version: number };
|
||||
|
||||
StyleSheets: {
|
||||
selectors: string[];
|
||||
properties: { 'bg-sprite': string };
|
||||
}[];
|
||||
}
|
||||
|
||||
export async function equipmentIcons(production: boolean) {
|
||||
console.log('Building equipment icons...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
const optionalDevices = await readXMLDVPL<{ root: OptionalDevices }>(
|
||||
`${DATA}/${POI.optionalDevices}.dvpl`,
|
||||
);
|
||||
const mappings = await readYAMLDVPL<Mappings>(
|
||||
`${DATA}/${POI.optionalDeviceImageMappings}.dvpl`,
|
||||
);
|
||||
const image = sharp(
|
||||
await readDVPLFile(`${DATA}/${POI.optionalDevicesImage}.dvpl`),
|
||||
);
|
||||
|
||||
await Promise.all(
|
||||
Object.entries(optionalDevices.root).map(
|
||||
async ([optionalDeviceKey, optionalDevice]) => {
|
||||
if (optionalDeviceKey === 'nextAvailableId') return;
|
||||
|
||||
const mapping = mappings.StyleSheets.find((mapping) =>
|
||||
mapping.selectors.includes(
|
||||
`.optional_device_item.${optionalDevice.icon} #Img`,
|
||||
),
|
||||
);
|
||||
|
||||
if (!mapping) {
|
||||
console.warn(
|
||||
`No mapping found for ${optionalDevice.icon}; skipping...`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const configPathRaw = mapping.properties['bg-sprite'];
|
||||
const configPath = configPathRaw.replace('~res:/', '');
|
||||
|
||||
if (configPath.startsWith('Gfx/Lobby')) {
|
||||
const configPathWebp = configPath.replace('.txt', '');
|
||||
const image = sharp(
|
||||
await readDVPLFile(`${DATA}/${configPathWebp}.packed.webp.dvpl`),
|
||||
);
|
||||
const content = (await image.trim().toBuffer()).toString('base64');
|
||||
|
||||
changes.push({
|
||||
path: `icons/equipment/${optionalDevice.id}.webp`,
|
||||
encoding: 'base64',
|
||||
content,
|
||||
});
|
||||
} else {
|
||||
const config = await readStringDVPL(`${DATA}/${configPath}.dvpl`);
|
||||
const sizes = config.split('\n')[4].split(' ').map(Number);
|
||||
const content = (
|
||||
await image
|
||||
.clone()
|
||||
.extract({
|
||||
left: sizes[0],
|
||||
top: sizes[1],
|
||||
width: sizes[2],
|
||||
height: sizes[3],
|
||||
})
|
||||
.toBuffer()
|
||||
).toString('base64');
|
||||
|
||||
changes.push({
|
||||
path: `icons/equipment/${optionalDevice.id}.webp`,
|
||||
encoding: 'base64',
|
||||
content,
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
await commitAssets('equipment icons', changes, production);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import { config } from 'dotenv';
|
||||
import { argv } from 'process';
|
||||
|
||||
config();
|
||||
|
||||
const allTargets = argv.includes('--all-targets');
|
||||
const targets = argv
|
||||
.find((argument) => argument.startsWith('--target'))
|
||||
?.split('=')[1]
|
||||
.split(',');
|
||||
const production = argv.includes('--production');
|
||||
|
||||
import { boosterIcons } from './boosterIcons';
|
||||
import { camouflageIcons } from './camouflageIcons';
|
||||
import { circleFlags } from './circleFlags';
|
||||
import { consumableProvisionIcons } from './consumableProvisionIcons';
|
||||
import { definitions } from './definitions';
|
||||
import { equipmentIcons } from './equipmentIcons';
|
||||
import { moduleIcons } from './moduleIcons';
|
||||
import { scratchedFlags } from './scratchedFlags';
|
||||
import { shellIcons } from './shellIcons';
|
||||
import { tankArmors } from './tankArmors';
|
||||
import { tankIcons } from './tankIcons';
|
||||
import { tankModels } from './tankModels';
|
||||
|
||||
if (!targets && !allTargets) throw new Error('No target(s) specified');
|
||||
|
||||
const methods = [
|
||||
definitions,
|
||||
tankIcons,
|
||||
scratchedFlags,
|
||||
circleFlags,
|
||||
shellIcons,
|
||||
moduleIcons,
|
||||
equipmentIcons,
|
||||
consumableProvisionIcons,
|
||||
camouflageIcons,
|
||||
boosterIcons,
|
||||
tankArmors,
|
||||
tankModels,
|
||||
];
|
||||
|
||||
for (const method of methods) {
|
||||
if (allTargets || targets?.includes(method.name)) await method(production);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { readdir } from 'fs/promises';
|
||||
import { readBase64DVPL } from '../../src/core/blitz/readBase64DVPL';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
|
||||
export async function moduleIcons(production: boolean) {
|
||||
console.log('Building module icons...');
|
||||
|
||||
const changes = await Promise.all(
|
||||
(await readdir(`${DATA}/${POI.moduleIcons}`))
|
||||
.filter(
|
||||
(file) =>
|
||||
!file.endsWith('@2x.packed.webp.dvpl') && file.startsWith('vehicle'),
|
||||
)
|
||||
.map(async (file) => {
|
||||
const nameRaw = file.match(/vehicle(.+)\.packed\.webp\.dvpl/)![1];
|
||||
const name = nameRaw[0].toLowerCase() + nameRaw.slice(1);
|
||||
const content = await readBase64DVPL(
|
||||
`${DATA}/${POI.moduleIcons}/${file}`,
|
||||
);
|
||||
|
||||
return {
|
||||
content,
|
||||
path: `icons/modules/${name}.webp`,
|
||||
encoding: 'base64',
|
||||
} satisfies FileChange;
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('module icons', changes, production);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { readdir } from 'fs/promises';
|
||||
import { readBase64DVPL } from '../../src/core/blitz/readBase64DVPL';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
|
||||
export async function scratchedFlags(production: boolean) {
|
||||
console.log('Building scratched flags...');
|
||||
|
||||
const flags = await readdir(`${DATA}/${POI.flags}`);
|
||||
const changes = await Promise.all(
|
||||
flags
|
||||
.filter(
|
||||
(flag) =>
|
||||
flag.startsWith('flag_tutor-tank_') &&
|
||||
!flag.endsWith('@2x.packed.webp.dvpl'),
|
||||
)
|
||||
.map(async (flag) => {
|
||||
const content = await readBase64DVPL(`${DATA}/${POI.flags}/${flag}`);
|
||||
const name = flag.match(/flag_tutor-tank_(.+)\.packed\.webp/)![1];
|
||||
|
||||
return {
|
||||
content,
|
||||
encoding: 'base64',
|
||||
path: `flags/scratched/${name}.webp`,
|
||||
} satisfies FileChange;
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('scratched flags', changes, production);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import { readdir } from 'fs/promises';
|
||||
import sharp from 'sharp';
|
||||
import { readDVPLFile } from '../../src/core/blitz/readDVPLFile';
|
||||
import { readStringDVPL } from '../../src/core/blitz/readStringDVPL';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
|
||||
export async function shellIcons(production: boolean) {
|
||||
console.log('Building shell icons...');
|
||||
|
||||
const image = sharp(
|
||||
await readDVPLFile(
|
||||
`${DATA}/${POI.bigShellIcons}/texture0.packed.webp.dvpl`,
|
||||
),
|
||||
);
|
||||
|
||||
const changes = await Promise.all(
|
||||
(await readdir(`${DATA}/${POI.bigShellIcons}`))
|
||||
.filter((file) => file.endsWith('_l.txt.dvpl'))
|
||||
.map(async (file) => {
|
||||
const name = file.match(/(.+)_l\.txt\.dvpl/)![1];
|
||||
const sizes = (
|
||||
await readStringDVPL(`${DATA}/${POI.bigShellIcons}/${file}`)
|
||||
)
|
||||
.split('\n')[4]
|
||||
.split(' ')
|
||||
.map(Number);
|
||||
|
||||
return {
|
||||
content: (
|
||||
await image
|
||||
.clone()
|
||||
.extract({
|
||||
left: sizes[0],
|
||||
top: sizes[1],
|
||||
width: sizes[2],
|
||||
height: sizes[3],
|
||||
})
|
||||
.toBuffer()
|
||||
).toString('base64'),
|
||||
encoding: 'base64',
|
||||
path: `icons/shells/${name}.webp`,
|
||||
} satisfies FileChange;
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('shell icons', changes, production);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import { NodeIO } from '@gltf-transform/core';
|
||||
import { readdir } from 'fs/promises';
|
||||
import { extractArmor } from '../../src/core/blitz/extractArmor';
|
||||
import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL';
|
||||
import { toUniqueId } from '../../src/core/blitz/toUniqueId';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
import { VehicleDefinitionList } from './definitions';
|
||||
|
||||
export async function tankArmors(production: boolean) {
|
||||
console.log('Building tank armors...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
const nodeIO = new NodeIO();
|
||||
const nations = await readdir(`${DATA}/${POI.vehicleDefinitions}`).then(
|
||||
(nations) => nations.filter((nation) => nation !== 'common'),
|
||||
);
|
||||
|
||||
await Promise.all(
|
||||
nations.map(async (nation) => {
|
||||
const tanks = await readXMLDVPL<{ root: VehicleDefinitionList }>(
|
||||
`${DATA}/${POI.vehicleDefinitions}/${nation}/list.xml.dvpl`,
|
||||
);
|
||||
|
||||
await Promise.all(
|
||||
Object.entries(tanks.root).map(async ([tankKey, tank]) => {
|
||||
if (tankKey.includes('tutorial_bot')) return;
|
||||
|
||||
const id = toUniqueId(nation, tank.id);
|
||||
|
||||
console.log(`Building armor ${id} @ ${nation}/${tankKey}`);
|
||||
|
||||
const model = await extractArmor(DATA, `${nation}-${tankKey}`);
|
||||
|
||||
changes.push({
|
||||
path: `3d/tanks/armor/${id}.glb`,
|
||||
encoding: 'base64',
|
||||
content: Buffer.from(await nodeIO.writeBinary(model)).toString(
|
||||
'base64',
|
||||
),
|
||||
});
|
||||
}),
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('tank armor', changes, production);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
import { readdir } from 'fs/promises';
|
||||
import { Vector3Tuple } from 'three';
|
||||
import { NATION_IDS } from '../../src/constants/nations';
|
||||
import { readBase64DVPL } from '../../src/core/blitz/readBase64DVPL';
|
||||
import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL';
|
||||
import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
import { VehicleDefinitionList } from './definitions';
|
||||
|
||||
export interface TankParameters {
|
||||
resourcesPath: {
|
||||
smallIconPath: string;
|
||||
bigIconPath: string;
|
||||
blitzModelPath: string;
|
||||
};
|
||||
collision: {
|
||||
[key: string]: {
|
||||
points: Vector3Tuple;
|
||||
bbox: {
|
||||
min: Vector3Tuple;
|
||||
max: Vector3Tuple;
|
||||
};
|
||||
averageThickness?: Record<string, number>;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export async function tankIcons(production: boolean) {
|
||||
console.log('Building tank icons...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
const nations = await readdir(`${DATA}/${POI.vehicleDefinitions}`).then(
|
||||
(nations) => nations.filter((nation) => nation !== 'common'),
|
||||
);
|
||||
|
||||
await Promise.all(
|
||||
nations.map(async (nation) => {
|
||||
const tanks = await readXMLDVPL<{ root: VehicleDefinitionList }>(
|
||||
`${DATA}/${POI.vehicleDefinitions}/${nation}/list.xml.dvpl`,
|
||||
);
|
||||
|
||||
await Promise.all(
|
||||
Object.entries(tanks.root).map(async ([tankKey, tank]) => {
|
||||
if (tankKey.includes('tutorial_bot')) return;
|
||||
|
||||
const nationVehicleId = tank.id;
|
||||
const id = (nationVehicleId << 8) + (NATION_IDS[nation] << 4) + 1;
|
||||
const parameters = await readYAMLDVPL<TankParameters>(
|
||||
`${DATA}/${POI.tankParameters}/${nation}/${tankKey}.yaml.dvpl`,
|
||||
);
|
||||
const small = `${DATA}/${parameters.resourcesPath.smallIconPath
|
||||
.replace(/~res:\//, '')
|
||||
.replace(/\..+/, '')}.packed.webp.dvpl`;
|
||||
const big = `${DATA}/${parameters.resourcesPath.bigIconPath
|
||||
.replace(/~res:\//, '')
|
||||
.replace(/\..+/, '')}.packed.webp.dvpl`;
|
||||
|
||||
if (big) {
|
||||
changes.push({
|
||||
content: await readBase64DVPL(big),
|
||||
encoding: 'base64',
|
||||
path: `icons/tanks/big/${id}.webp`,
|
||||
});
|
||||
}
|
||||
if (small) {
|
||||
changes.push({
|
||||
content: await readBase64DVPL(small),
|
||||
encoding: 'base64',
|
||||
path: `icons/tanks/small/${id}.webp`,
|
||||
});
|
||||
}
|
||||
}),
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('tank icons', changes, production);
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
import { NodeIO } from '@gltf-transform/core';
|
||||
import { readdir } from 'fs/promises';
|
||||
import { Vector3Tuple } from 'three';
|
||||
import { extractModel } from '../../src/core/blitz/extractModel';
|
||||
import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL';
|
||||
import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL';
|
||||
import { toUniqueId } from '../../src/core/blitz/toUniqueId';
|
||||
// import { AssetCommit } from '../../src/core/github/assetCommit';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
import { VehicleDefinitionList } from './definitions';
|
||||
import { TankParameters } from './tankIcons';
|
||||
|
||||
interface VehicleCustomization {
|
||||
armorColor: string;
|
||||
}
|
||||
|
||||
export async function tankModels(production: boolean) {
|
||||
console.log('Building tank models...');
|
||||
|
||||
const nodeIO = new NodeIO();
|
||||
const nations = await readdir(`${DATA}/${POI.vehicleDefinitions}`).then(
|
||||
(nations) => nations.filter((nation) => nation !== 'common'),
|
||||
);
|
||||
|
||||
for (const nationIndex in nations) {
|
||||
const nation = nations[nationIndex];
|
||||
const changes: FileChange[] = [];
|
||||
// const assetCommit = new AssetCommit(`tank models ${nation}`, production);
|
||||
const tanks = await readXMLDVPL<{ root: VehicleDefinitionList }>(
|
||||
`${DATA}/${POI.vehicleDefinitions}/${nation}/list.xml.dvpl`,
|
||||
);
|
||||
const customization = await readXMLDVPL<{ root: VehicleCustomization }>(
|
||||
`${DATA}/${POI.vehicleDefinitions}/${nation}/customization.xml.dvpl`,
|
||||
);
|
||||
const baseColor = customization.root.armorColor
|
||||
.split(' ')
|
||||
.slice(0, 3)
|
||||
.map(Number)
|
||||
.map((channel) => channel / 255) as Vector3Tuple;
|
||||
|
||||
console.log(`Building models for ${nation}`);
|
||||
|
||||
await Promise.all(
|
||||
Object.entries(tanks.root).map(async ([tankKey, tank]) => {
|
||||
if (tankKey.includes('tutorial_bot')) return;
|
||||
|
||||
const id = toUniqueId(nation, tank.id);
|
||||
|
||||
console.log(`Building model ${id} @ ${nation}/${tankKey}`);
|
||||
|
||||
const parameters = await readYAMLDVPL<TankParameters>(
|
||||
`${DATA}/${POI.tankParameters}/${nation}/${tankKey}.yaml.dvpl`,
|
||||
);
|
||||
const model = await extractModel(
|
||||
DATA,
|
||||
parameters.resourcesPath.blitzModelPath.replace(/\.sc2$/, ''),
|
||||
baseColor,
|
||||
);
|
||||
|
||||
// writeFile(`test.${tankKey}.glb`, await nodeIO.writeBinary(model));
|
||||
|
||||
changes.push({
|
||||
path: `3d/tanks/models/${id}.glb`,
|
||||
content: Buffer.from(await nodeIO.writeBinary(model)).toString(
|
||||
'base64',
|
||||
),
|
||||
encoding: 'base64',
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
||||
// assetCommit.push();
|
||||
await commitAssets(`tank models ${nation}`, changes, production);
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,39 @@
|
||||
import { Octokit } from '@octokit/rest';
|
||||
import { rm, writeFile } from 'fs/promises';
|
||||
import { argv, env } from 'process';
|
||||
import { argv } from 'process';
|
||||
import {
|
||||
RatingsInfo,
|
||||
RatingsNeighbors,
|
||||
RatingsPlayer,
|
||||
} from '../src/commands/ratings';
|
||||
import commitMultipleFiles from './commitMultipleFiles.js';
|
||||
import commitMultipleFiles from '../src/core/blitzkrieg/commitMultipleFiles.js';
|
||||
import { patientFetchJSON } from '../src/core/blitzkrieg/patientFetchJSON';
|
||||
|
||||
/*
|
||||
* Central North American Time (UTC-5): use 0 5 * * *.
|
||||
* Central European Time (UTC+1): use 0 23 * * *.
|
||||
* Central Asia Standard Time (UTC+7): use 0 17 * * *.
|
||||
*
|
||||
* na/ratings/49/info.json: season info like rewards, start & end time, etc.
|
||||
* na/ratings/49/latest.json: the absolute latest leaderboard recorded at UTC+0 midnight
|
||||
* na/ratings/49/midnight.json: last midnight's leaderboard relative to the region
|
||||
* [region]/ratings/[season]/info.json: season info like rewards, start & end time, etc.
|
||||
* [region]/ratings/[season]/latest.json: the absolute latest leaderboard recorded at UTC+0 midnight
|
||||
* [region]/ratings/[season]/midnight.json: last midnight's leaderboard relative to the region
|
||||
*/
|
||||
|
||||
export type BlitzkriegRatingsLeaderboard = { id: number; score: number }[];
|
||||
export type BlitzkriegRatingsLeaderboardEntry = { id: number; score: number };
|
||||
export type BlitzkriegRatingsLeaderboard = BlitzkriegRatingsLeaderboardEntry[];
|
||||
|
||||
const publish = argv.includes('--publish');
|
||||
const latest = argv.includes('--latest');
|
||||
const target = argv
|
||||
.find((arg) => arg.startsWith('--target='))
|
||||
?.split('=')[1] as 'midnight' | 'latest' | undefined;
|
||||
const server = argv.find((arg) => arg.startsWith('--region='))?.split('=')[1];
|
||||
|
||||
if (!target) throw new Error('Target parameter not specified');
|
||||
if (!server) throw new Error('Region parameter not specified');
|
||||
|
||||
const NEIGHBORS = 1000;
|
||||
const PLAYERS = await fetch(
|
||||
const NEIGHBORS = 2 ** 8;
|
||||
const PLAYERS = await patientFetchJSON<RatingsInfo>(
|
||||
`https://${server}.wotblitz.com/en/api/rating-leaderboards/season/`,
|
||||
)
|
||||
.then((response) => response.json() as Promise<RatingsInfo>)
|
||||
.then((data) => (data.detail === undefined ? data.count : undefined));
|
||||
).then((data) => (data.detail === undefined ? data.count : undefined));
|
||||
|
||||
if (PLAYERS === undefined) {
|
||||
throw new Error('No current ratings season running');
|
||||
@@ -42,9 +44,9 @@ const leaderboard: BlitzkriegRatingsLeaderboard = [];
|
||||
let registered = 0;
|
||||
|
||||
async function branchFromPlayer(id: number) {
|
||||
const { neighbors } = await fetch(
|
||||
const { neighbors } = await patientFetchJSON<RatingsNeighbors>(
|
||||
`https://${server}.wotblitz.com/en/api/rating-leaderboards/user/${id}/?neighbors=${NEIGHBORS}`,
|
||||
).then((response) => response.json() as Promise<RatingsNeighbors>);
|
||||
);
|
||||
|
||||
const firstPlayer = neighbors[0];
|
||||
const lastPlayer = neighbors[neighbors.length - 1];
|
||||
@@ -73,9 +75,9 @@ async function branchFromPlayer(id: number) {
|
||||
}
|
||||
|
||||
async function branchFromLeague(id: number) {
|
||||
const { result } = await fetch(
|
||||
const { result } = await patientFetchJSON<{ result: RatingsPlayer[] }>(
|
||||
`https://${server}.wotblitz.com/en/api/rating-leaderboards/league/${id}/top/`,
|
||||
).then((response) => response.json() as Promise<{ result: RatingsPlayer[] }>);
|
||||
);
|
||||
|
||||
const firstPlayer = result[0];
|
||||
const lastPlayer = result[result.length - 1];
|
||||
@@ -98,7 +100,10 @@ await Promise.all([
|
||||
console.log('Converting to an array...');
|
||||
for (let index = 0; index < PLAYERS; index++) {
|
||||
const listing = players[index + 1];
|
||||
if (!listing) console.warn(`Position ${index + 1} had no player`);
|
||||
if (!listing) {
|
||||
console.warn(`Position ${index + 1} had no player`);
|
||||
continue;
|
||||
}
|
||||
|
||||
leaderboard[index] = {
|
||||
id: listing.spa_id,
|
||||
@@ -109,32 +114,23 @@ for (let index = 0; index < PLAYERS; index++) {
|
||||
const leaderboardJSON = JSON.stringify(leaderboard);
|
||||
|
||||
if (publish) {
|
||||
const octokit = new Octokit({ auth: env.GH_TOKEN });
|
||||
|
||||
const info = await fetch(
|
||||
const info = await patientFetchJSON<RatingsInfo & { detail: undefined }>(
|
||||
`https://${server}.wotblitz.com/en/api/rating-leaderboards/season/`,
|
||||
).then(
|
||||
(response) =>
|
||||
response.json() as Promise<RatingsInfo & { detail: undefined }>,
|
||||
);
|
||||
const normalizedServer = server === 'na' ? 'com' : server;
|
||||
|
||||
const infoPath = `${normalizedServer}/ratings/${info.current_season}/info.json`;
|
||||
const leaderboardPath = `${normalizedServer}/ratings/${info.current_season}/${
|
||||
latest ? 'latest' : 'midnight'
|
||||
}.json`;
|
||||
const infoPath = `regions/${normalizedServer}/ratings/${info.current_season}/info.json`;
|
||||
const leaderboardPath = `regions/${normalizedServer}/ratings/${info.current_season}/${target}.json`;
|
||||
const infoJSON = JSON.stringify(info);
|
||||
|
||||
console.log(`Publishing to season ${info.current_season}...`);
|
||||
commitMultipleFiles(
|
||||
octokit,
|
||||
'tresabhi',
|
||||
'blitzkrieg-db',
|
||||
'blitzkrieg-assets',
|
||||
'main',
|
||||
new Date().toString(),
|
||||
[
|
||||
{ path: infoPath, content: infoJSON },
|
||||
{ path: leaderboardPath, content: leaderboardJSON },
|
||||
{ path: infoPath, content: infoJSON, encoding: 'utf-8' },
|
||||
{ path: leaderboardPath, content: leaderboardJSON, encoding: 'utf-8' },
|
||||
],
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
import { writeFile } from 'fs/promises';
|
||||
import { Region } from '../src/constants/regions';
|
||||
import { getRatingsNeighbors } from '../src/core/blitz/getRatingsNeighbors';
|
||||
|
||||
const REGION: Region = 'com';
|
||||
const PLAYER = 1041988373;
|
||||
const ITERATIONS = 2 ** 4;
|
||||
const MAX_NEIGHBORS = 2 ** 7;
|
||||
const data: [number, number][] = [];
|
||||
let finished = 0;
|
||||
|
||||
for (let index = 0; index < ITERATIONS; index++) {
|
||||
const neighbors = Math.round((Math.random() * MAX_NEIGHBORS) / 2) * 2;
|
||||
const start = Date.now();
|
||||
|
||||
console.log(`🟡 Iteration ${index} with ${neighbors} neighbors`);
|
||||
|
||||
try {
|
||||
await getRatingsNeighbors(REGION, PLAYER, neighbors);
|
||||
|
||||
finished++;
|
||||
console.log(
|
||||
`🟢 (${Math.round(
|
||||
100 * (finished / ITERATIONS),
|
||||
)}%) Iteration ${index} with ${neighbors} neighbors`,
|
||||
);
|
||||
|
||||
const end = Date.now();
|
||||
const time = end - start;
|
||||
|
||||
data.push([neighbors, time]);
|
||||
} catch (error) {
|
||||
console.log(
|
||||
`🔴 Iteration ${index} with ${neighbors} neighbors\n\n${error}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('🟢 Done, sorting');
|
||||
data.sort(([neighborsA], [neighborsB]) => neighborsA - neighborsB);
|
||||
|
||||
console.log('🟢 Writing');
|
||||
writeFile(
|
||||
'dist/ratingsPlot.csv',
|
||||
data.map(([neighbors, time]) => `${neighbors},${time}`).join('\n'),
|
||||
);
|
||||
@@ -0,0 +1,12 @@
|
||||
import { readdir } from 'fs/promises';
|
||||
import packageJSON from '../package.json';
|
||||
|
||||
const { version } = packageJSON;
|
||||
const changelogs = await readdir('docs/changelogs');
|
||||
const hasVersion = changelogs.includes(`${version}.md`);
|
||||
|
||||
if (hasVersion) {
|
||||
console.log(`Version ${version} found in changelogs`);
|
||||
} else {
|
||||
throw new Error(`Version ${version} not found in changelogs`);
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
import { Octokit } from '@octokit/rest';
|
||||
|
||||
export default async function commitMultipleFiles(
|
||||
octokit: Octokit,
|
||||
owner: string,
|
||||
repo: string,
|
||||
branch: string,
|
||||
message: string,
|
||||
changes: { path: string; content: string }[],
|
||||
) {
|
||||
// Get the latest commit SHA on the specified branch
|
||||
const { data: refData } = await octokit.git.getRef({
|
||||
owner,
|
||||
repo,
|
||||
ref: `heads/${branch}`,
|
||||
});
|
||||
const latestCommitSha = refData.object.sha;
|
||||
|
||||
// Get the tree SHA for the latest commit
|
||||
const { data: commitData } = await octokit.git.getCommit({
|
||||
owner,
|
||||
repo,
|
||||
commit_sha: latestCommitSha,
|
||||
});
|
||||
const treeSha = commitData.tree.sha;
|
||||
|
||||
// Create blobs for each file
|
||||
const blobs = await Promise.all(
|
||||
changes.map(async (change) => {
|
||||
const { data: blobData } = await octokit.git.createBlob({
|
||||
owner,
|
||||
repo,
|
||||
content: change.content,
|
||||
encoding: 'utf-8',
|
||||
});
|
||||
|
||||
return {
|
||||
sha: blobData.sha,
|
||||
path: change.path,
|
||||
mode: '100644',
|
||||
type: 'blob',
|
||||
} as const;
|
||||
}),
|
||||
);
|
||||
|
||||
// Create a new tree with the new blobs
|
||||
const { data: treeData } = await octokit.git.createTree({
|
||||
owner,
|
||||
repo,
|
||||
base_tree: treeSha,
|
||||
tree: blobs,
|
||||
});
|
||||
|
||||
// Create a new commit with the new tree
|
||||
const { data: newCommitData } = await octokit.git.createCommit({
|
||||
owner,
|
||||
repo,
|
||||
message,
|
||||
tree: treeData.sha,
|
||||
parents: [latestCommitSha],
|
||||
});
|
||||
|
||||
// Update the branch reference to point to the new commit
|
||||
await octokit.git.updateRef({
|
||||
owner,
|
||||
repo,
|
||||
ref: `heads/${branch}`,
|
||||
sha: newCommitData.sha,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import decompress from 'decompress';
|
||||
import { existsSync } from 'fs';
|
||||
import { mkdir, readdir, writeFile } from 'fs/promises';
|
||||
|
||||
if (!existsSync('temp')) {
|
||||
console.log('Creating temp directory...');
|
||||
await mkdir('temp');
|
||||
}
|
||||
|
||||
console.log('Downloading depot downloader...');
|
||||
await fetch(
|
||||
'https://api.github.com/repos/SteamRE/DepotDownloader/releases/latest',
|
||||
)
|
||||
.then(
|
||||
(response) =>
|
||||
response.json() as Promise<{
|
||||
assets: { browser_download_url: string; name: string }[];
|
||||
}>,
|
||||
)
|
||||
.then(({ assets }) => {
|
||||
const asset = assets.find(({ name }) => name.includes('windows-x64'));
|
||||
if (!asset) throw new Error('No asset found');
|
||||
return fetch(asset.browser_download_url);
|
||||
})
|
||||
.then((response) => response.arrayBuffer())
|
||||
.then((arrayBuffer) =>
|
||||
writeFile('temp/depotDownloader.zip', Buffer.from(arrayBuffer)),
|
||||
);
|
||||
|
||||
console.log('Unzipping...');
|
||||
await decompress('temp/depotDownloader.zip', 'temp/depotDownloader');
|
||||
|
||||
console.log('Download complete; files:', await readdir('temp/depotDownloader'));
|
||||
@@ -0,0 +1,10 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { Region } from '../../../../../../constants/regions';
|
||||
import getRatingsInfo from '../../../../../../core/blitz/getRatingsInfo';
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
{ params }: { params: { region: Region } },
|
||||
) {
|
||||
return NextResponse.json(await getRatingsInfo(params.region));
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { Region } from '../../../../../../../constants/regions';
|
||||
import { getRatingsLeague } from '../../../../../../../core/blitz/getRatingsLeague';
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
{ params }: { params: { region: Region; league: number } },
|
||||
) {
|
||||
return NextResponse.json(
|
||||
await getRatingsLeague(params.region, params.league, true),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { Region } from '../../../../../../../constants/regions';
|
||||
import { searchCurrentRatingsPlayers } from '../../../../../../../core/blitz/searchCurrentRatingsPlayers';
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
{ params }: { params: { region: Region; username: string } },
|
||||
) {
|
||||
return NextResponse.json(
|
||||
await searchCurrentRatingsPlayers(params.region, params.username),
|
||||
);
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { tankopedia } from '../../../core/blitz/tankopedia';
|
||||
|
||||
export async function GET() {
|
||||
return NextResponse.json(await tankopedia);
|
||||
}
|
||||
@@ -1,21 +1,33 @@
|
||||
'use client';
|
||||
|
||||
import { ContextMenu } from '@radix-ui/themes';
|
||||
import { useEffect, useState } from 'react';
|
||||
import * as Breakdown from '../../../components/Breakdown';
|
||||
import { TreeTypeEnum } from '../../../components/Tanks';
|
||||
import { WARGAMING_APPLICATION_ID } from '../../../constants/wargamingApplicationID';
|
||||
import calculateWN8 from '../../../core/blitz/calculateWN8';
|
||||
import { diffNormalizedTankStats } from '../../../core/blitz/diffNormalizedTankStats';
|
||||
import getWN8Percentile from '../../../core/blitz/getWN8Percentile';
|
||||
import getWargamingResponse from '../../../core/blitz/getWargamingResponse';
|
||||
import { TankopediaEntry, tankopedia } from '../../../core/blitz/tankopedia';
|
||||
import fetchBlitz from '../../../core/blitz/fetchBlitz';
|
||||
import {
|
||||
TankDefinition,
|
||||
tankDefinitions,
|
||||
} from '../../../core/blitzkrieg/tankDefinitions';
|
||||
import { tankAverages } from '../../../core/blitzstars/tankAverages';
|
||||
import { useSession } from '../../../stores/session';
|
||||
import calculateWN8 from '../../../core/statistics/calculateWN8';
|
||||
import { deltaTankStats } from '../../../core/statistics/deltaTankStats';
|
||||
import getWN8Percentile from '../../../core/statistics/getWN8Percentile';
|
||||
import mutateSession, {
|
||||
resetSession,
|
||||
useSession,
|
||||
} from '../../../stores/session';
|
||||
import { IndividualTankStats, TanksStats } from '../../../types/tanksStats';
|
||||
import { CustomColumnDisplay } from '../../tools/session/components/CustomColumn';
|
||||
import { Menu } from '../../tools/session/components/Menu';
|
||||
|
||||
const REFRESH_RATE = 1 / 5;
|
||||
|
||||
export default function SessionPage() {
|
||||
interface SessionPageProps {
|
||||
naked?: boolean;
|
||||
}
|
||||
|
||||
export default function SessionPage({ naked = true }: SessionPageProps) {
|
||||
const session = useSession();
|
||||
const since = session.isTracking ? new Date(session.time) : undefined;
|
||||
const [diff, setDiff] = useState<
|
||||
@@ -24,7 +36,7 @@ export default function SessionPage() {
|
||||
|
||||
list: {
|
||||
stats: IndividualTankStats;
|
||||
tankopedia?: TankopediaEntry;
|
||||
tankDefinitions?: TankDefinition;
|
||||
career: IndividualTankStats;
|
||||
currentWN8?: number;
|
||||
careerWN8?: number;
|
||||
@@ -66,11 +78,19 @@ export default function SessionPage() {
|
||||
0,
|
||||
) / careerBattles;
|
||||
|
||||
useEffect(() => {
|
||||
if (session.title === 'Untitled session') {
|
||||
mutateSession((draft) => {
|
||||
if (draft.isTracking) draft.title = draft.nickname;
|
||||
});
|
||||
}
|
||||
}, [session.title]);
|
||||
|
||||
useEffect(() => {
|
||||
async function recalculateDiff() {
|
||||
if (session.isTracking) {
|
||||
const { id, region } = session;
|
||||
const careerRaw = await getWargamingResponse<TanksStats>(
|
||||
const careerRaw = await fetchBlitz<TanksStats>(
|
||||
`https://api.wotblitz.${region}/wotb/tanks/stats/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${id}`,
|
||||
);
|
||||
const career = careerRaw[id].reduce<
|
||||
@@ -82,7 +102,7 @@ export default function SessionPage() {
|
||||
}),
|
||||
{},
|
||||
);
|
||||
const awaitedTankopedia = await tankopedia;
|
||||
const awaitedTankDefinitions = await tankDefinitions;
|
||||
const awaitedTankAverages = await tankAverages;
|
||||
const careerWN8 =
|
||||
careerRaw[id].reduce(
|
||||
@@ -108,12 +128,12 @@ export default function SessionPage() {
|
||||
|
||||
list: (
|
||||
Object.values(
|
||||
diffNormalizedTankStats(session.tankStats, career),
|
||||
deltaTankStats(session.tankStats, career, session.time / 1000),
|
||||
) as IndividualTankStats[]
|
||||
).map((stats) => {
|
||||
return {
|
||||
stats,
|
||||
tankopedia: awaitedTankopedia[stats.tank_id],
|
||||
tankDefinitions: awaitedTankDefinitions[stats.tank_id],
|
||||
career: career[stats.tank_id],
|
||||
currentWN8: awaitedTankAverages[stats.tank_id]
|
||||
? calculateWN8(
|
||||
@@ -139,136 +159,183 @@ export default function SessionPage() {
|
||||
return () => clearInterval(interval);
|
||||
}, [session]);
|
||||
|
||||
const totalRowStats: Record<
|
||||
CustomColumnDisplay,
|
||||
Breakdown.RowStatItem | undefined
|
||||
> = {
|
||||
battles: {
|
||||
title: 'Battles',
|
||||
current: sessionBattles?.toLocaleString(),
|
||||
career: tankStatsArray
|
||||
.reduce((accumulator, stats) => accumulator + stats.all.battles, 0)
|
||||
.toLocaleString(),
|
||||
},
|
||||
winrate: {
|
||||
title: 'Winrate',
|
||||
current: sessionBattles ? `${(100 * sessionWinrate).toFixed(2)}%` : '--',
|
||||
career: `${(100 * careerWinrate).toFixed(2)}%`,
|
||||
delta: sessionBattles === 0 ? 0 : sessionWinrate - careerWinrate,
|
||||
},
|
||||
wn8: (() => {
|
||||
if (!diff) return undefined;
|
||||
|
||||
const battlesWithWN8 = diff.list.reduce(
|
||||
(accumulator, { currentWN8, stats }) =>
|
||||
(currentWN8 === undefined ? 0 : stats.all.battles) + accumulator,
|
||||
0,
|
||||
);
|
||||
const currentWN8 =
|
||||
diff.list.reduce(
|
||||
(accumulator, { currentWN8, stats }) =>
|
||||
stats.all.battles * (currentWN8 ?? 0) + accumulator,
|
||||
0,
|
||||
) / battlesWithWN8!;
|
||||
|
||||
return {
|
||||
title: 'WN8',
|
||||
current: battlesWithWN8
|
||||
? Math.round(currentWN8!).toLocaleString()
|
||||
: '--',
|
||||
percentile: battlesWithWN8 ? getWN8Percentile(currentWN8!) : undefined,
|
||||
career: Math.round(diff.careerWN8).toLocaleString(),
|
||||
};
|
||||
})(),
|
||||
damage: {
|
||||
title: 'Damage',
|
||||
delta: sessionBattles === 0 ? 0 : currentDamage - careerDamage,
|
||||
current: sessionBattles
|
||||
? Math.round(currentDamage).toLocaleString()
|
||||
: '--',
|
||||
career: Math.round(careerDamage).toLocaleString(),
|
||||
},
|
||||
none: undefined,
|
||||
};
|
||||
|
||||
return (
|
||||
<Breakdown.Root>
|
||||
{session.isTracking && since !== undefined && diff !== undefined && (
|
||||
<Breakdown.Row
|
||||
title={`Since ${since.toLocaleString(undefined, {
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
hour12: true,
|
||||
month: 'short',
|
||||
year: 'numeric',
|
||||
day: 'numeric',
|
||||
})}`}
|
||||
stats={[
|
||||
{
|
||||
title: 'Battles',
|
||||
current: sessionBattles!.toLocaleString(),
|
||||
career: tankStatsArray
|
||||
.reduce(
|
||||
(accumulator, stats) => accumulator + stats.all.battles,
|
||||
0,
|
||||
)
|
||||
.toLocaleString(),
|
||||
},
|
||||
{
|
||||
title: 'Winrate',
|
||||
current: sessionBattles
|
||||
? `${(100 * sessionWinrate).toFixed(2)}%`
|
||||
: '--',
|
||||
career: `${(100 * careerWinrate).toFixed(2)}%`,
|
||||
delta: sessionBattles === 0 ? 0 : sessionWinrate - careerWinrate,
|
||||
},
|
||||
(() => {
|
||||
const battlesWithWN8 = diff.list.reduce(
|
||||
(accumulator, { currentWN8, stats }) =>
|
||||
(currentWN8 === undefined ? 0 : stats.all.battles) +
|
||||
accumulator,
|
||||
0,
|
||||
);
|
||||
const currentWN8 =
|
||||
diff.list.reduce(
|
||||
(accumulator, { currentWN8, stats }) =>
|
||||
stats.all.battles * (currentWN8 ?? 0) + accumulator,
|
||||
0,
|
||||
) / battlesWithWN8;
|
||||
<ContextMenu.Root>
|
||||
<ContextMenu.Trigger>
|
||||
<div>
|
||||
<Breakdown.Root>
|
||||
{session.showTotal &&
|
||||
session.isTracking &&
|
||||
since !== undefined &&
|
||||
diff !== undefined && (
|
||||
<Breakdown.Row
|
||||
naked={naked}
|
||||
color={session.color}
|
||||
minimized={!session.showCareer}
|
||||
title={session.title}
|
||||
stats={session.customColumns.map((customColumn) => {
|
||||
const rowStat = totalRowStats[customColumn.display];
|
||||
|
||||
return {
|
||||
title: 'WN8',
|
||||
current: battlesWithWN8
|
||||
? Math.round(currentWN8).toLocaleString()
|
||||
: '--',
|
||||
percentile: battlesWithWN8
|
||||
? getWN8Percentile(currentWN8)
|
||||
: undefined,
|
||||
career: Math.round(diff.careerWN8).toLocaleString(),
|
||||
};
|
||||
})(),
|
||||
{
|
||||
title: 'Damage',
|
||||
delta: sessionBattles === 0 ? 0 : currentDamage - careerDamage,
|
||||
current: sessionBattles
|
||||
? Math.round(currentDamage).toLocaleString()
|
||||
: '--',
|
||||
career: Math.round(careerDamage).toLocaleString(),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
if (!rowStat) return undefined;
|
||||
|
||||
{diff?.list
|
||||
.sort((a, b) => b.stats.last_battle_time - a.stats.last_battle_time)
|
||||
.map(({ stats, tankopedia, career, careerWN8, currentWN8 }) => (
|
||||
<Breakdown.Row
|
||||
key={stats.tank_id}
|
||||
title={tankopedia?.name ?? `Unknown tank ${stats.tank_id}`}
|
||||
type="tank"
|
||||
tankType={tankopedia?.type}
|
||||
treeType={(() => {
|
||||
if (tankopedia?.is_collectible) return TreeTypeEnum.Collector;
|
||||
if (tankopedia?.is_premium) return TreeTypeEnum.Premium;
|
||||
})()}
|
||||
stats={[
|
||||
{
|
||||
title: 'Battles',
|
||||
current: stats.all.battles.toLocaleString(),
|
||||
career: career.all.battles.toLocaleString(),
|
||||
},
|
||||
{
|
||||
title: 'Winrate',
|
||||
current: `${(
|
||||
100 *
|
||||
(stats.all.wins / stats.all.battles)
|
||||
).toFixed(2)}%`,
|
||||
career: `${(
|
||||
100 *
|
||||
(career.all.wins / career.all.battles)
|
||||
).toFixed(2)}%`,
|
||||
delta:
|
||||
stats.all.wins / stats.all.battles -
|
||||
career.all.wins / career.all.battles,
|
||||
},
|
||||
{
|
||||
title: 'WN8',
|
||||
current:
|
||||
currentWN8 === undefined
|
||||
? undefined
|
||||
: Math.round(currentWN8).toLocaleString(),
|
||||
career:
|
||||
careerWN8 === undefined
|
||||
? undefined
|
||||
: Math.round(careerWN8).toLocaleString(),
|
||||
percentile:
|
||||
currentWN8 === undefined
|
||||
? undefined
|
||||
: getWN8Percentile(currentWN8),
|
||||
},
|
||||
{
|
||||
title: 'Damage',
|
||||
current: Math.round(
|
||||
stats.all.damage_dealt / stats.all.battles,
|
||||
).toLocaleString(),
|
||||
career: Math.round(
|
||||
career.all.damage_dealt / career.all.battles,
|
||||
).toLocaleString(),
|
||||
delta:
|
||||
stats.all.damage_dealt / stats.all.battles -
|
||||
career.all.damage_dealt / career.all.battles,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
))}
|
||||
</Breakdown.Root>
|
||||
return {
|
||||
...rowStat,
|
||||
delta:
|
||||
customColumn.showDelta &&
|
||||
rowStat.percentile === undefined
|
||||
? rowStat.delta
|
||||
: undefined,
|
||||
};
|
||||
})}
|
||||
/>
|
||||
)}
|
||||
|
||||
{diff?.list
|
||||
.sort(
|
||||
(a, b) => b.stats.last_battle_time - a.stats.last_battle_time,
|
||||
)
|
||||
.map(
|
||||
({ stats, tankDefinitions, career, careerWN8, currentWN8 }) => {
|
||||
const rowStats: Record<
|
||||
CustomColumnDisplay,
|
||||
Breakdown.RowStatItem | undefined
|
||||
> = {
|
||||
battles: {
|
||||
title: 'Battles',
|
||||
current: stats.all.battles.toLocaleString(),
|
||||
career: career.all.battles.toLocaleString(),
|
||||
},
|
||||
winrate: {
|
||||
title: 'Winrate',
|
||||
current: `${(
|
||||
100 *
|
||||
(stats.all.wins / stats.all.battles)
|
||||
).toFixed(2)}%`,
|
||||
career: `${(
|
||||
100 *
|
||||
(career.all.wins / career.all.battles)
|
||||
).toFixed(2)}%`,
|
||||
delta:
|
||||
stats.all.wins / stats.all.battles -
|
||||
career.all.wins / career.all.battles,
|
||||
},
|
||||
wn8: {
|
||||
title: 'WN8',
|
||||
current:
|
||||
currentWN8 === undefined
|
||||
? undefined
|
||||
: Math.round(currentWN8).toLocaleString(),
|
||||
career:
|
||||
careerWN8 === undefined
|
||||
? undefined
|
||||
: Math.round(careerWN8).toLocaleString(),
|
||||
percentile:
|
||||
currentWN8 === undefined
|
||||
? undefined
|
||||
: getWN8Percentile(currentWN8),
|
||||
},
|
||||
damage: {
|
||||
title: 'Damage',
|
||||
current: Math.round(
|
||||
stats.all.damage_dealt / stats.all.battles,
|
||||
).toLocaleString(),
|
||||
career: Math.round(
|
||||
career.all.damage_dealt / career.all.battles,
|
||||
).toLocaleString(),
|
||||
delta:
|
||||
stats.all.damage_dealt / stats.all.battles -
|
||||
career.all.damage_dealt / career.all.battles,
|
||||
},
|
||||
none: undefined,
|
||||
};
|
||||
|
||||
return (
|
||||
<Breakdown.Row
|
||||
naked={naked}
|
||||
color={session.color}
|
||||
key={stats.tank_id}
|
||||
minimized={!session.showCareer}
|
||||
title={
|
||||
tankDefinitions?.name ?? `Unknown tank ${stats.tank_id}`
|
||||
}
|
||||
type="tank"
|
||||
tankType={tankDefinitions?.type}
|
||||
treeType={tankDefinitions?.treeType}
|
||||
stats={session.customColumns.map((customColumn) => {
|
||||
const rowStat = rowStats[customColumn.display];
|
||||
|
||||
if (!rowStat) return undefined;
|
||||
|
||||
return {
|
||||
...rowStat,
|
||||
delta:
|
||||
customColumn.showDelta &&
|
||||
rowStat.percentile === undefined
|
||||
? rowStat.delta
|
||||
: undefined,
|
||||
};
|
||||
})}
|
||||
/>
|
||||
);
|
||||
},
|
||||
)}
|
||||
</Breakdown.Root>
|
||||
</div>
|
||||
</ContextMenu.Trigger>
|
||||
|
||||
<Menu reset={resetSession} Builder={ContextMenu} />
|
||||
</ContextMenu.Root>
|
||||
);
|
||||
}
|
||||
@@ -1,15 +1,25 @@
|
||||
'use client';
|
||||
|
||||
import { Flex, Theme } from '@radix-ui/themes';
|
||||
import { CaretRightIcon } from '@radix-ui/react-icons';
|
||||
import { AlertDialog, Button, Flex, Text, Theme } from '@radix-ui/themes';
|
||||
import '@radix-ui/themes/styles.css';
|
||||
import { Analytics } from '@vercel/analytics/react';
|
||||
import { config } from 'dotenv';
|
||||
import { Roboto_Flex } from 'next/font/google';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { ReactNode } from 'react';
|
||||
import { ReactNode, useEffect, useState } from 'react';
|
||||
import { SkyLine } from '../assets/art/SkyLine';
|
||||
import Navbar from '../components/Navbar';
|
||||
import PageWrapper from '../components/PageWrapper';
|
||||
import isDev from '../core/blitzkrieg/isDev';
|
||||
import { isLocalhost } from '../core/blitzkrieg/isLocalhost';
|
||||
import { useApp } from '../stores/app';
|
||||
import { mintTheme } from '../themes/mint';
|
||||
|
||||
config();
|
||||
|
||||
const DEV_BUILD_AGREEMENT_COOLDOWN = 8 * 24 * 60 * 60 * 1000;
|
||||
|
||||
interface RootLayoutProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
@@ -22,26 +32,130 @@ const robotoFlex = Roboto_Flex({
|
||||
export default function RootLayout({ children }: RootLayoutProps) {
|
||||
const pathname = usePathname();
|
||||
const isEmbed = pathname.split('/')[1] === 'embeds';
|
||||
const [showDevBuildAlert, setShowDevBuildAlert] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setShowDevBuildAlert(
|
||||
isDev() &&
|
||||
!isLocalhost() &&
|
||||
Date.now() - useApp.getState().devBuildAgreementTime >=
|
||||
DEV_BUILD_AGREEMENT_COOLDOWN,
|
||||
);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<html lang="en" className={robotoFlex.className}>
|
||||
<head>
|
||||
<title>Blitzkrieg</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="🎉 Tools for everything World of Tanks Blitz"
|
||||
/>
|
||||
</head>
|
||||
|
||||
<body
|
||||
style={{
|
||||
margin: 0,
|
||||
background: isEmbed
|
||||
? 'transparent'
|
||||
: 'url(https://i.imgur.com/PhS06NJ.png)',
|
||||
paddingTop: isEmbed ? 0 : '3.25rem',
|
||||
backgroundColor: isEmbed ? 'transparent' : undefined,
|
||||
}}
|
||||
>
|
||||
<Analytics />
|
||||
|
||||
<Theme
|
||||
appearance="dark"
|
||||
panelBackground="translucent"
|
||||
radius="full"
|
||||
accentColor="blue"
|
||||
suppressHydrationWarning
|
||||
suppressContentEditableWarning
|
||||
>
|
||||
{!isEmbed && <Navbar />}
|
||||
<AlertDialog.Root open={showDevBuildAlert}>
|
||||
<AlertDialog.Content>
|
||||
<AlertDialog.Title>Experimental version!</AlertDialog.Title>
|
||||
<AlertDialog.Description>
|
||||
This version may have a lot of issues. Report issues to{' '}
|
||||
<a href="https://discord.gg/nDt7AjGJQH" target="_blank">
|
||||
the official Discord server
|
||||
</a>
|
||||
. Also consider using{' '}
|
||||
<a href="https://blitz-krieg.vercel.app/">
|
||||
the more stable release version
|
||||
</a>
|
||||
. You will be asked again in 8 days.
|
||||
</AlertDialog.Description>
|
||||
|
||||
<Flex justify="end">
|
||||
<Button
|
||||
variant="solid"
|
||||
onClick={() => {
|
||||
setShowDevBuildAlert(false);
|
||||
useApp.setState({ devBuildAgreementTime: Date.now() });
|
||||
}}
|
||||
>
|
||||
Continue
|
||||
</Button>
|
||||
</Flex>
|
||||
</AlertDialog.Content>
|
||||
</AlertDialog.Root>
|
||||
|
||||
<Flex direction="column">{children}</Flex>
|
||||
|
||||
{!isEmbed && (
|
||||
<PageWrapper>
|
||||
<a
|
||||
target="_blank"
|
||||
href="https://ko-fi.com/tresabhi"
|
||||
style={{ textDecoration: 'none' }}
|
||||
>
|
||||
<Flex
|
||||
align="center"
|
||||
style={{
|
||||
padding: 16,
|
||||
borderRadius: 8,
|
||||
backgroundColor: mintTheme.colors.componentInteractive,
|
||||
position: 'relative',
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
<Flex
|
||||
direction="column"
|
||||
gap="1"
|
||||
style={{
|
||||
flex: 1,
|
||||
zIndex: 1,
|
||||
}}
|
||||
>
|
||||
<Text size="4" color="mint">
|
||||
Blitzkrieg. Free forever. For everyone.
|
||||
</Text>
|
||||
<Text color="mint">
|
||||
<b>Consider supporting today 🍀</b>
|
||||
</Text>
|
||||
</Flex>
|
||||
|
||||
<Text
|
||||
color="mint"
|
||||
style={{
|
||||
zIndex: 1,
|
||||
}}
|
||||
>
|
||||
<Flex>
|
||||
<CaretRightIcon width={32} height={32} />
|
||||
</Flex>
|
||||
</Text>
|
||||
|
||||
<SkyLine
|
||||
style={{
|
||||
position: 'absolute',
|
||||
right: 'min(8vw, 15%)',
|
||||
top: '5%',
|
||||
}}
|
||||
/>
|
||||
</Flex>
|
||||
</a>
|
||||
</PageWrapper>
|
||||
)}
|
||||
</Theme>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { theme } from '../stitches.config';
|
||||
|
||||
export const tool = styleVariants({
|
||||
enabled: {
|
||||
boxShadow: `inset 0 -192px 128px -128px ${theme.colors.appBackground1}`,
|
||||
boxShadow: `inset 0 -256px 512px -128px ${theme.colors.appBackground1}`,
|
||||
|
||||
':hover': {
|
||||
boxShadow: `inset 0 -160px 128px -128px ${theme.colors.appBackground1}`,
|
||||
|
||||
@@ -30,7 +30,8 @@ export default function Page() {
|
||||
({
|
||||
node: (
|
||||
<Link
|
||||
href={`/tools/${tool.id}`}
|
||||
href={tool.href ?? `/tools/${tool.id}`}
|
||||
target={tool.href ? '_blank' : undefined}
|
||||
className={
|
||||
tool.disabled ? styles.tool.disabled : styles.tool.enabled
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import { blackA } from '@radix-ui/colors';
|
||||
import { Flex, Text } from '@radix-ui/themes';
|
||||
import { PuffLoader } from 'react-spinners';
|
||||
import { theme } from '../../../stitches.config';
|
||||
|
||||
const NAV_HEIGHT = 52.65;
|
||||
|
||||
interface LoaderProps {
|
||||
naked?: boolean;
|
||||
color?: string;
|
||||
progress?: number;
|
||||
}
|
||||
|
||||
export function Loader({ naked, color, progress }: LoaderProps) {
|
||||
const animation = (
|
||||
<div style={{ position: 'relative' }}>
|
||||
{progress !== undefined && (
|
||||
<Text
|
||||
style={{
|
||||
position: 'absolute',
|
||||
left: '50%',
|
||||
top: '50%',
|
||||
transform: 'translate(calc(-50% + 5px), calc(-50% + 5px))',
|
||||
}}
|
||||
>
|
||||
{Math.round(progress * 100)}%
|
||||
</Text>
|
||||
)}
|
||||
<PuffLoader color={color ?? theme.colors.solidBackground} />
|
||||
</div>
|
||||
);
|
||||
|
||||
if (naked) return animation;
|
||||
|
||||
return (
|
||||
<Flex
|
||||
style={{
|
||||
backgroundColor: blackA.blackA10,
|
||||
position: 'fixed',
|
||||
top: NAV_HEIGHT,
|
||||
left: 0,
|
||||
width: '100%',
|
||||
height: `calc(100% - ${NAV_HEIGHT}px)`,
|
||||
padding: theme.spaces.paddingMajor,
|
||||
}}
|
||||
align="center"
|
||||
justify="center"
|
||||
>
|
||||
{animation}
|
||||
</Flex>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
'use client';
|
||||
|
||||
import Link from 'next/link';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { ReactNode } from 'react';
|
||||
import { ReactNode, Suspense } from 'react';
|
||||
import { TOOLS } from '../../constants/tools';
|
||||
import { theme } from '../../stitches.config';
|
||||
import { Loader } from './components/Loader';
|
||||
|
||||
interface ToolsLayoutProps {
|
||||
children: ReactNode;
|
||||
@@ -11,44 +13,67 @@ interface ToolsLayoutProps {
|
||||
|
||||
export default function ToolsLayout({ children }: ToolsLayoutProps) {
|
||||
const pathname = usePathname();
|
||||
const toolId = pathname.split('/').at(-1);
|
||||
const pathSplit = pathname.split('/');
|
||||
const toolId = pathSplit.at(2);
|
||||
const tool = TOOLS.find((tool) => tool.id === toolId);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
style={{
|
||||
height: 128,
|
||||
backgroundImage: `url(/assets/banners/${toolId}.png)`,
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'center',
|
||||
boxShadow: `inset 0 -192px 128px -128px ${theme.colors.appBackground1}`,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
gap: 4,
|
||||
flexDirection: 'column',
|
||||
}}
|
||||
>
|
||||
<span
|
||||
style={{
|
||||
color: theme.colors.textHighContrast,
|
||||
fontSize: 32,
|
||||
}}
|
||||
>
|
||||
{tool?.title}
|
||||
</span>
|
||||
<span
|
||||
style={{
|
||||
color: theme.colors.textLowContrast,
|
||||
fontSize: 16,
|
||||
}}
|
||||
>
|
||||
{tool?.description}
|
||||
</span>
|
||||
</div>
|
||||
{tool && <title>{tool.title}</title>}
|
||||
|
||||
{children}
|
||||
{pathSplit.length === 3 && (
|
||||
<div
|
||||
style={{
|
||||
height: 128,
|
||||
boxShadow: `inset 0 -192px 128px -128px ${theme.colors.appBackground1}`,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
flexDirection: 'column',
|
||||
position: 'relative',
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
backgroundImage: `url(/assets/banners/${toolId}.webp)`,
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'center',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
top: 0,
|
||||
left: 0,
|
||||
zIndex: -1,
|
||||
filter: 'blur(4px)',
|
||||
transform: 'scale(calc((128 + 8) / 128))',
|
||||
}}
|
||||
/>
|
||||
|
||||
<Link
|
||||
href={`/tools/${toolId}`}
|
||||
style={{
|
||||
textDecoration: 'none',
|
||||
fontWeight: 900,
|
||||
color: theme.colors.textHighContrast,
|
||||
fontSize: 32,
|
||||
letterSpacing: -1,
|
||||
}}
|
||||
>
|
||||
{tool?.title}
|
||||
</Link>
|
||||
<span
|
||||
style={{
|
||||
color: theme.colors.textLowContrast,
|
||||
fontSize: 16,
|
||||
}}
|
||||
>
|
||||
{tool?.description}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Suspense fallback={<Loader />}>{children}</Suspense>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { keyframes, style } from '@vanilla-extract/css';
|
||||
|
||||
const spinKeyframes = keyframes({
|
||||
from: { transform: 'rotate(0deg)' },
|
||||
to: { transform: 'rotate(360deg)' },
|
||||
});
|
||||
|
||||
export const infiniteSpin = style({
|
||||
animationName: spinKeyframes,
|
||||
animationIterationCount: 'infinite',
|
||||
animationTimingFunction: 'linear',
|
||||
animationDuration: '1s',
|
||||
});
|
||||
@@ -0,0 +1,97 @@
|
||||
import {
|
||||
CaretLeftIcon,
|
||||
CaretRightIcon,
|
||||
SymbolIcon,
|
||||
} from '@radix-ui/react-icons';
|
||||
import { Button, Flex, TextField } from '@radix-ui/themes';
|
||||
import { range } from 'lodash';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { infiniteSpin } from './index.css';
|
||||
|
||||
interface PageTurnerProps {
|
||||
leaderboard: Record<number, number>;
|
||||
page: number;
|
||||
rowsPerPage: number;
|
||||
pages: number;
|
||||
onPageChange: (page: number, isButtonClick: boolean) => void;
|
||||
totalPlayers: number;
|
||||
}
|
||||
|
||||
export function PageTurner({
|
||||
page,
|
||||
rowsPerPage,
|
||||
onPageChange,
|
||||
pages,
|
||||
leaderboard,
|
||||
totalPlayers,
|
||||
}: PageTurnerProps) {
|
||||
const pageInput = useRef<HTMLInputElement>(null);
|
||||
const rightLoading = range(
|
||||
page * rowsPerPage,
|
||||
Math.min(totalPlayers - 1, page * rowsPerPage + rowsPerPage + 1),
|
||||
).some((index) => !(index in leaderboard));
|
||||
const leftLoading = range(
|
||||
Math.max(0, page * rowsPerPage - 1),
|
||||
Math.max(0, page * rowsPerPage - rowsPerPage - 1) + 1,
|
||||
).some((index) => !(index in leaderboard));
|
||||
|
||||
useEffect(() => {
|
||||
if (pageInput.current) pageInput.current.value = `${page + 1}`;
|
||||
}, [page]);
|
||||
|
||||
return (
|
||||
<Flex justify="center" wrap="wrap" gap="2">
|
||||
<Flex gap="2">
|
||||
<Button
|
||||
variant="soft"
|
||||
onClick={() => onPageChange(Math.max(page - 1, 0), true)}
|
||||
disabled={page === 0 || leftLoading}
|
||||
>
|
||||
{leftLoading ? (
|
||||
<SymbolIcon className={infiniteSpin} />
|
||||
) : (
|
||||
<CaretLeftIcon />
|
||||
)}
|
||||
</Button>
|
||||
<TextField.Root>
|
||||
<TextField.Slot>Page</TextField.Slot>
|
||||
<TextField.Input
|
||||
type="number"
|
||||
ref={pageInput}
|
||||
style={{ width: 64, textAlign: 'center' }}
|
||||
min={1}
|
||||
max={pages}
|
||||
onBlur={(event) => {
|
||||
onPageChange(
|
||||
Math.max(
|
||||
0,
|
||||
Math.min(pages - 1, event.target.valueAsNumber - 1),
|
||||
),
|
||||
false,
|
||||
);
|
||||
}}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === 'Enter') {
|
||||
(event.target as HTMLInputElement).blur();
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<TextField.Slot>out of {pages}</TextField.Slot>
|
||||
</TextField.Root>
|
||||
<Button
|
||||
variant="soft"
|
||||
onClick={() => {
|
||||
onPageChange(Math.min(page + 1, pages - 1), true);
|
||||
}}
|
||||
disabled={page === pages - 1 || rightLoading}
|
||||
>
|
||||
{rightLoading ? (
|
||||
<SymbolIcon className={infiniteSpin} />
|
||||
) : (
|
||||
<CaretRightIcon />
|
||||
)}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Flex>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
import { ContextMenu, DropdownMenu } from '@radix-ui/themes';
|
||||
import mutateSession, { useSession } from '../../../../stores/session';
|
||||
|
||||
export type CustomColumnDisplay =
|
||||
| 'battles'
|
||||
| 'winrate'
|
||||
| 'wn8'
|
||||
| 'damage'
|
||||
| 'none';
|
||||
|
||||
const NO_DELTA: CustomColumnDisplay[] = ['battles', 'wn8', 'none'];
|
||||
|
||||
interface CustomColumn {
|
||||
Builder: typeof DropdownMenu | typeof ContextMenu;
|
||||
column: number;
|
||||
}
|
||||
|
||||
export function CustomColumn({ column, Builder }: CustomColumn) {
|
||||
const customColumn = useSession((state) => state.customColumns[column]);
|
||||
|
||||
return (
|
||||
<Builder.Sub>
|
||||
<Builder.SubTrigger>Column {column + 1}</Builder.SubTrigger>
|
||||
|
||||
<Builder.SubContent>
|
||||
<Builder.RadioGroup
|
||||
value={customColumn.display}
|
||||
onValueChange={(event) =>
|
||||
mutateSession((draft) => {
|
||||
draft.customColumns[column].display =
|
||||
event as CustomColumnDisplay;
|
||||
})
|
||||
}
|
||||
>
|
||||
<Builder.RadioItem value="battles">Battles</Builder.RadioItem>
|
||||
<Builder.RadioItem value="winrate">Winrate</Builder.RadioItem>
|
||||
<Builder.RadioItem value="wn8">WN8</Builder.RadioItem>
|
||||
<Builder.RadioItem value="damage">Damage</Builder.RadioItem>
|
||||
<Builder.RadioItem value="none">None</Builder.RadioItem>
|
||||
</Builder.RadioGroup>
|
||||
|
||||
{!NO_DELTA.includes(customColumn.display) && (
|
||||
<>
|
||||
<Builder.Separator />
|
||||
|
||||
<Builder.CheckboxItem
|
||||
checked={customColumn.showDelta}
|
||||
onCheckedChange={(checked) =>
|
||||
mutateSession((draft) => {
|
||||
draft.customColumns[column].showDelta = checked;
|
||||
})
|
||||
}
|
||||
>
|
||||
Show delta
|
||||
</Builder.CheckboxItem>
|
||||
</>
|
||||
)}
|
||||
</Builder.SubContent>
|
||||
</Builder.Sub>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
import {
|
||||
Button,
|
||||
ContextMenu,
|
||||
Dialog,
|
||||
DropdownMenu,
|
||||
Flex,
|
||||
Heading,
|
||||
TextField,
|
||||
} from '@radix-ui/themes';
|
||||
import { createColors } from 'bepaint';
|
||||
import { useRef, useState } from 'react';
|
||||
import {
|
||||
ACCENT_COLORS,
|
||||
AccentColor,
|
||||
GRAY_COLORS,
|
||||
GrayColor,
|
||||
PALETTES,
|
||||
} from '../../../../constants/radixColors';
|
||||
import { useSession } from '../../../../stores/session';
|
||||
import { CustomColumn } from './CustomColumn';
|
||||
|
||||
interface ContextMenuProps {
|
||||
Builder: typeof DropdownMenu | typeof ContextMenu;
|
||||
reset: () => void;
|
||||
}
|
||||
|
||||
export function Menu({ Builder, reset }: ContextMenuProps) {
|
||||
const session = useSession();
|
||||
const [showTitleEditor, setShowTitleEditor] = useState(false);
|
||||
const titleInput = useRef<HTMLInputElement>(null);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Dialog.Root open={showTitleEditor} onOpenChange={setShowTitleEditor}>
|
||||
<Dialog.Content>
|
||||
<Flex direction="column" gap="4">
|
||||
<Heading size="4">Edit title</Heading>
|
||||
|
||||
<Flex gap="2" style={{ width: '100%' }}>
|
||||
<TextField.Root style={{ flex: 1 }}>
|
||||
<TextField.Input
|
||||
ref={titleInput}
|
||||
defaultValue={session.title}
|
||||
placeholder="Enter title..."
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === 'Enter' && titleInput.current) {
|
||||
setShowTitleEditor(false);
|
||||
useSession.setState({ title: titleInput.current!.value });
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</TextField.Root>
|
||||
|
||||
<Dialog.Close>
|
||||
<Button
|
||||
onClick={() =>
|
||||
useSession.setState({ title: titleInput.current!.value })
|
||||
}
|
||||
>
|
||||
Set
|
||||
</Button>
|
||||
</Dialog.Close>
|
||||
</Flex>
|
||||
</Flex>
|
||||
</Dialog.Content>
|
||||
</Dialog.Root>
|
||||
|
||||
<Builder.Content>
|
||||
<Builder.Sub>
|
||||
<Builder.SubTrigger>Accent color</Builder.SubTrigger>
|
||||
|
||||
<Builder.SubContent>
|
||||
<Builder.RadioGroup
|
||||
value={session.color}
|
||||
onValueChange={(value) =>
|
||||
useSession.setState({ color: value as AccentColor | GrayColor })
|
||||
}
|
||||
>
|
||||
{[...ACCENT_COLORS, ...GRAY_COLORS].map((color) => (
|
||||
<Builder.RadioItem value={color} key={color}>
|
||||
<Flex gap="2" align="center">
|
||||
<div
|
||||
style={{
|
||||
backgroundColor: createColors(PALETTES[color])
|
||||
.solidBackground,
|
||||
width: 16,
|
||||
height: 16,
|
||||
borderRadius: '100%',
|
||||
}}
|
||||
/>
|
||||
{`${color.charAt(0).toUpperCase()}${color.slice(1)}`}
|
||||
</Flex>
|
||||
</Builder.RadioItem>
|
||||
))}
|
||||
</Builder.RadioGroup>
|
||||
</Builder.SubContent>
|
||||
</Builder.Sub>
|
||||
|
||||
<Builder.Separator />
|
||||
|
||||
<Builder.Item onClick={() => setShowTitleEditor(true)}>
|
||||
Edit title...
|
||||
</Builder.Item>
|
||||
<CustomColumn Builder={Builder} column={0} />
|
||||
<CustomColumn Builder={Builder} column={1} />
|
||||
<CustomColumn Builder={Builder} column={2} />
|
||||
<CustomColumn Builder={Builder} column={3} />
|
||||
|
||||
<Builder.Separator />
|
||||
|
||||
<Builder.CheckboxItem
|
||||
checked={session.showTotal}
|
||||
onCheckedChange={(checked) =>
|
||||
useSession.setState({ showTotal: checked })
|
||||
}
|
||||
>
|
||||
Show total
|
||||
</Builder.CheckboxItem>
|
||||
<Builder.CheckboxItem
|
||||
checked={session.showCareer}
|
||||
onCheckedChange={(checked) =>
|
||||
useSession.setState({ showCareer: checked })
|
||||
}
|
||||
>
|
||||
Show career
|
||||
</Builder.CheckboxItem>
|
||||
|
||||
<Builder.Separator />
|
||||
|
||||
<Builder.Item color="red" onClick={reset}>
|
||||
Reset
|
||||
</Builder.Item>
|
||||
</Builder.Content>
|
||||
</>
|
||||
);
|
||||
}
|
||||