Compare commits

..
249 Commits
Author SHA1 Message Date
tresabhi d75a51660e feat: default sln file 2025-04-14 17:26:59 -05:00
tresabhi ac1323a463 feat: some things 2025-04-08 16:25:35 -05:00
tresabhi 292f7aeac0 feat: some more discoveries 2025-04-06 22:49:47 -05:00
tresabhi 1ee232d104 feat: start work on dynamic armor 2025-04-06 10:44:26 -05:00
tresabhi 1d301bf2fb Merge branch 'main' into ue 2025-04-05 22:15:05 -05:00
tresabhi 3b02c25973 fix: disable playformCompress 2025-04-05 22:02:26 -05:00
tresabhi 2a8ca6d36f Merge branch 'main' into ue 2025-04-05 17:18:36 -05:00
tresabhi f90768d155 fix: env 2025-04-05 17:08:55 -05:00
tresabhi d77bd6a5f9 feat: logs 2025-04-05 16:15:55 -05:00
tresabhi 6836cb327f feat: more images 2025-04-05 16:07:42 -05:00
tresabhi 4373efd0cd feat: move images to blitzkit 2025-04-05 16:00:52 -05:00
tresabhi f13165e77d feat: better ui 2025-04-05 15:09:15 -05:00
tresabhi 8a5b0c1170 fix: gun-specific shell discrimination 2025-04-05 15:09:12 -05:00
tresabhi f16511a72e Merge branch 'main' into dev 2025-04-05 14:57:41 -05:00
tresabhi df0dc4f118 feat: shell filters 2025-04-03 16:33:48 -05:00
tresabhi 92399de5e2 fix: navbar interact 2025-04-03 13:00:23 -05:00
tresabhi 8d9dff8d73 feat: inline 2025-04-03 12:53:54 -05:00
tresabhi f91744f2f0 feat: compressor again 2025-04-03 12:51:24 -05:00
tresabhi e946dfdb69 feat: compressor 2025-04-03 12:48:17 -05:00
tresabhi 6283ddc57a feat: astro seo 2025-04-03 12:45:33 -05:00
tresabhi 2d66e0ab28 fix: missing padding backgrond 2025-04-03 12:34:02 -05:00
tresabhi c3d8f15a2a feat: better robots.txt 2025-04-03 12:23:53 -05:00
tresabhi 21a37ec6cc feat: new nav bar 2025-04-03 12:15:08 -05:00
tresabhi de471400ad feat: partytown 2025-04-03 11:34:57 -05:00
tresabhi 0b16295853 fix: keys 2025-04-03 11:31:31 -05:00
TrèsAbhi 63eea81856 Update stitches.config.ts 2025-04-02 21:55:08 -05:00
tresabhi ba57d61af5 feat: skeleton 2025-04-02 17:59:23 -05:00
tresabhi 3d940f4b47 feat: discord plug 2025-04-02 17:48:51 -05:00
tresabhi 8ef355c574 feat: we don't talk about it 2025-04-02 16:11:09 -05:00
tresabhi ed5d2e3ff4 feat: more maps 2025-04-02 16:00:18 -05:00
tresabhi b2684e3152 fix: name 2025-04-01 21:59:00 -05:00
tresabhi d078454711 fix: depot 2025-04-01 21:56:23 -05:00
tresabhi 6aae1c8ee0 go go crazy! 2025-04-01 21:49:16 -05:00
tresabhi a560a37a56 feat: deploy 2025-04-01 21:48:36 -05:00
tresabhi 41486f84d4 fix: full export 2025-04-01 21:22:36 -05:00
tresabhi 29b12c7c28 fix: build only 2025-04-01 21:17:57 -05:00
tresabhi 2a3583a474 fix: cancel 2025-04-01 21:12:39 -05:00
tresabhi eb5e2a935c feat: more more more! 2025-04-01 21:12:06 -05:00
tresabhi 75f6f133ca feat: new website builder 2025-04-01 21:09:08 -05:00
tresabhi f26711bad9 feat: protos 2025-04-01 21:04:38 -05:00
tresabhi a8dc3313cf feat: mirrors 2025-04-01 21:03:39 -05:00
tresabhi 71e1ab1362 aaaaaaaaaaaaaaaa 2025-04-01 19:38:58 -05:00
tresabhi 53dc108356 Merge branch 'main' of https://github.com/tresabhi/blitzkit 2025-04-01 19:38:01 -05:00
tresabhi 57b3218c5a undo cue4 2025-04-01 19:38:00 -05:00
tresabhi 7472e39faf fix: gifs 2025-04-01 19:34:03 -05:00
tresabhi 8087752172 feat: mirros 2025-04-01 15:32:37 -05:00
tresabhi 034417d19f fix: remove cue4 2025-03-31 17:49:23 -05:00
tresabhi 0368e9ceda feat: pink bot 2025-03-31 17:44:08 -05:00
tresabhi 28f365f762 fix: no class list 2025-03-31 17:39:42 -05:00
tresabhi 40a81f6b1b fix: class list 2025-03-31 17:39:01 -05:00
tresabhi 9475d22472 feat: uh hahaha you'll see ... again! 2025-03-31 17:36:40 -05:00
tresabhi 9538a03afb feat: uh hahaha you'll see 2025-03-31 16:54:32 -05:00
tresabhi d5d171bea6 4 2025-03-30 14:37:40 -05:00
tresabhi a9c9a90ac1 fix: disable /auction 2025-03-30 12:53:14 -05:00
tresabhi f7c562f8b6 fix: detect invalid 0-length translations 2025-03-30 12:51:34 -05:00
tresabhi cb03a86cce feat: proper assembly 2025-03-29 21:15:55 -05:00
tresabhi 838ce7f35d feat: model api 2025-03-29 20:26:32 -05:00
tresabhi e6f9b07b20 feat: modules list and translations 2025-03-29 19:29:29 -05:00
tresabhi 8afc334aa7 Merge branch 'main' into ue 2025-03-29 18:13:37 -05:00
TrèsAbhi 836cf69f01 New Crowdin updates (#149)
* New translations en.json (Russian)

* New translations en.json (Ukrainian)

* New translations en.json (Spanish)

* New translations en.json (Chinese Simplified)
2025-03-26 14:37:29 -05:00
tresabhi ba17aae706 feat: bump int size 2025-03-25 15:29:41 -05:00
tresabhi c7017a7a15 feat: cards 2025-03-23 19:07:37 -05:00
tresabhi f1462162f4 fix: persistent cam angle 2025-03-23 18:21:11 -05:00
tresabhi da4c2ece32 feat: better starting angle 2025-03-23 17:51:56 -05:00
tresabhi 80325aa3b2 feat: more fluid 2025-03-23 17:50:26 -05:00
tresabhi 3b937a6f35 feat: outlines 2025-03-23 17:41:38 -05:00
tresabhi 7a8f88f224 feat: safer drag 2025-03-23 17:22:42 -05:00
tresabhi 5982fdde8c feat: dragger 2025-03-23 17:18:42 -05:00
tresabhi dcd7ce61f7 feat: some manual disecting 2025-03-22 20:24:00 -05:00
tresabhi 43021c4945 feat: dissect event 2025-03-22 20:10:05 -05:00
tresabhi 4b24cf313b Merge branch 'ue' of https://github.com/tresabhi/blitzkit into ue 2025-03-22 18:44:01 -05:00
tresabhi d785588cf9 feat: some updates 2025-03-22 18:43:59 -05:00
TrèsAbhi dd9b34ea34 Update Unpacker.cs 2025-03-21 20:00:00 -05:00
tresabhi 7605e1d6f2 feat: new tab 2025-03-21 19:30:37 -05:00
tresabhi 7f056500ca fix: enable 2025-03-21 18:57:13 -05:00
tresabhi 0c37550c05 feat: outlines 2025-03-21 18:55:24 -05:00
tresabhi 1d928e8b72 feat: enabled 2025-03-21 18:08:53 -05:00
tresabhi 9e2465a6e3 fix: double blobbing 2025-03-21 16:51:03 -05:00
tresabhi b061bfd267 feat: prettier pretty log 2025-03-21 16:41:53 -05:00
tresabhi a90e5e20ea feat: but binary size after path 2025-03-21 16:33:34 -05:00
tresabhi 5fcade3efa feat: fill 2025-03-21 16:23:27 -05:00
tresabhi f1bb5736c0 feat: 4 chars 2025-03-21 16:22:14 -05:00
tresabhi 9b45f21457 feat: all pretty log 2025-03-21 16:20:39 -05:00
tresabhi 62fb80dddc feat: all collisions 2025-03-21 16:15:56 -05:00
tresabhi ff0cac84e1 feat: chassis mangler 2025-03-21 15:49:58 -05:00
tresabhi cbd2c2a719 feat: more rendering 2025-03-20 22:07:37 -05:00
tresabhi 5b16e22750 feat: some armor rendering 2025-03-20 21:48:17 -05:00
tresabhi 3a32624823 feat: build only 2025-03-20 20:13:14 -05:00
tresabhi 46374a7a26 feat: some hero code 2025-03-20 12:33:36 -05:00
tresabhi b856268ee0 feat: the thing 2025-03-20 12:17:05 -05:00
tresabhi e60bbc03d2 feat: separate armors 2025-03-20 11:59:24 -05:00
tresabhi 30b18f60be fix: optional static paths 2025-03-20 01:00:20 -05:00
tresabhi 754dff72b9 feat: smaller padding 2025-03-20 00:55:36 -05:00
tresabhi ef7655ab5d fix: color types 2025-03-20 00:53:47 -05:00
tresabhi 9491e7651a fix: types 2025-03-20 00:50:24 -05:00
tresabhi cccd96a021 feat: max file count 2025-03-20 00:21:27 -05:00
tresabhi 16a54ea291 feat: max file count 2025-03-20 00:20:05 -05:00
tresabhi f5c00643e4 feat: armors 2025-03-20 00:18:00 -05:00
tresabhi 652f36ba6c feat: hull model 2025-03-19 20:08:28 -05:00
tresabhi e1957daa5c feat: meta 2025-03-19 19:53:03 -05:00
tresabhi 222fda0c91 fix: i just realized the gallery is going bye bye 2025-03-19 19:48:26 -05:00
tresabhi c9467d68ae feat: in house icons 2025-03-19 19:36:05 -05:00
tresabhi d64f04b2c8 feat: icons 2025-03-19 19:27:47 -05:00
tresabhi a98f0e84d5 feat: gradient 2025-03-19 18:53:48 -05:00
tresabhi 6319e438b1 feat: make it compile! 2025-03-19 01:01:19 -05:00
tresabhi 90a64d4ccf fix: typo 2025-03-19 00:56:41 -05:00
tresabhi cb339eab5f more desc 2025-03-19 00:50:08 -05:00
tresabhi e6a92e2114 softer buttons 2025-03-19 00:49:23 -05:00
tresabhi 4bfc89302f feat: test button 2025-03-19 00:48:35 -05:00
tresabhi 6611088ccb feat: slugs 2025-03-19 00:24:25 -05:00
tresabhi 8d4933dd60 feat: some more apis 2025-03-18 23:53:52 -05:00
tresabhi 4b5ee9db09 feat: api docs 2025-03-18 23:04:08 -05:00
tresabhi cc3aa976db feat: comments 2025-03-18 18:32:14 -05:00
tresabhi 9fb4607bba Merge branch 'main' into ue 2025-03-18 17:41:22 -05:00
tresabhi 6f8790d148 gotta play it safe 2025-03-18 17:35:56 -05:00
tresabhi 57d63ea1d7 gotta go fast 2025-03-18 17:26:09 -05:00
TrèsAbhi 30ca5c053a Update tankNames.ts 2025-03-14 12:14:55 -05:00
tresabhi c36419f5b6 fix: don't include cue4 2025-03-11 10:40:02 -05:00
tresabhi 1879895db2 feat: add 124 support 2025-03-11 10:13:02 -05:00
tresabhi 35894f39cf feat: name fetching 2025-03-06 23:05:18 -06:00
tresabhi 18d762c41b fix: format 2025-03-06 21:55:42 -06:00
tresabhi 6ca74e2b83 feat: include change size 2025-03-06 21:55:27 -06:00
tresabhi 56ca3e5ed4 feat: background gray messages 2025-03-06 21:54:20 -06:00
tresabhi 2c059cdc59 feat: blue for no changes 2025-03-06 21:52:00 -06:00
tresabhi b0d7a49b16 feat: missing icon handling 2025-03-06 21:49:17 -06:00
tresabhi 9dfa5a7693 feat: smart uploader 2025-03-06 21:46:05 -06:00
tresabhi e79ed0cf85 feat: texture exporter 2025-03-06 19:41:55 -06:00
tresabhi f52460e98b feat: collision rendering 2025-03-05 12:15:52 -06:00
tresabhi 6a91e86b07 feat: handle duplicates 2025-03-05 11:52:39 -06:00
tresabhi 1fce9c1c88 fix: include all tanks 2025-03-05 10:03:03 -06:00
tresabhi 6e8fdcfeef fix: parrellel safe changes 2025-03-05 09:56:49 -06:00
tresabhi 2fffd512ac feat: include slugs in both 2025-03-05 09:52:09 -06:00
tresabhi 16b3a59f88 feat: slugs back in tanks 2025-03-05 09:51:02 -06:00
tresabhi ba36c600c4 feat: show ms 2025-03-05 00:12:10 -06:00
tresabhi 9fbdaaf87f feat: enable commiting 2025-03-05 00:10:00 -06:00
tresabhi 553c9d552b feat: human ids 2025-03-05 00:07:25 -06:00
tresabhi 1b017aad48 feat: seo ids list 2025-03-04 23:02:26 -06:00
tresabhi 74fefe6291 feat: let the damn thing compile 2025-03-04 22:55:45 -06:00
tresabhi 5d81b7ff5a Merge branch 'main' into ue 2025-03-04 22:45:27 -06:00
tresabhi c964e3c8ec feat: google crawler 2025-03-03 17:49:45 -06:00
tresabhi 2ef6d18f82 lol why cue4??? 2025-03-03 16:19:43 -06:00
tresabhi 10b672572b feat: try appending dvpl? 2025-03-03 16:15:58 -06:00
tresabhi 789578f2b3 incomplete stuff 2025-03-03 16:07:39 -06:00
TrèsAbhi 2a4efa8cd2 fix: check for changes for real 2025-03-03 12:29:25 -06:00
TrèsAbhi 5a8435da29 Update Footer.astro 2025-03-03 12:15:05 -06:00
TrèsAbhi 3461349a96 Update Footer.astro 2025-03-03 12:13:06 -06:00
TrèsAbhi 3791e9df12 New Crowdin updates (#147)
* New translations en.json (French)

* New translations en.json (French)

* New translations en.json (Ukrainian)

* New translations en.json (Ukrainian)

* New translations en.json (Portuguese)

* New translations en.json (Portuguese)

* New translations en.json (Russian)

* New translations en.json (French)

* New translations en.json (French)

* New translations en.json (Ukrainian)

* New translations en.json (French)

* New translations en.json (French)

* New translations en.json (Ukrainian)

* New translations en.json (Ukrainian)

* New translations en.json (Japanese)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Portuguese)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Russian)

* New translations en.json (Ukrainian)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Russian)
2025-03-03 11:10:15 -06:00
tresabhi 0864825513 feat: names 2025-03-01 23:08:22 -06:00
tresabhi 6f11fb4a70 fix: delete after 2025-03-01 21:54:23 -06:00
tresabhi 1567f8270c fix: use escape 2025-03-01 21:51:45 -06:00
tresabhi 0b5d019dc8 feat: delete right after 2025-03-01 21:46:48 -06:00
tresabhi 932a04a398 feat: pre bundled 2025-03-01 21:46:17 -06:00
tresabhi 05c0839936 feat: file list 2025-03-01 21:38:06 -06:00
tresabhi 95ae891212 fix: provider 2025-03-01 21:34:39 -06:00
tresabhi 3aea04b6cb fix: remove filelist 2025-02-25 18:29:42 -06:00
tresabhi 1d28768bb7 feat: ini 2025-02-25 18:28:08 -06:00
tresabhi 14d9794f57 feat: try only pak0 2025-02-25 18:15:40 -06:00
tresabhi 9cd38db684 feat: include protos 2025-02-25 18:09:22 -06:00
tresabhi 6a5af32f6c feat: unpacker full 2025-02-25 18:03:38 -06:00
tresabhi af0b430927 feat: some unpacking 2025-02-25 17:55:05 -06:00
tresabhi 8c7f851692 feat: commit 2025-02-25 17:23:25 -06:00
tresabhi 57a2daa5e4 feat: hull collision mesh 2025-02-25 15:36:34 -06:00
tresabhi 63d27aec64 feat: canon interface 2025-02-25 15:15:03 -06:00
TrèsAbhi b3c36aac93 New Crowdin updates (#146)
* New translations en.json (Polish)

* New translations en.json (Polish)

* New translations en.json (Japanese)

* New translations en.json (Japanese)

* New translations en.json (Japanese)

* New translations en.json (Japanese)

* New translations en.json (Russian)

* New translations en.json (Russian)

* New translations en.json (Ukrainian)

* New translations en.json (Russian)

* New translations en.json (Russian)

* New translations en.json (Spanish)

* New translations en.json (Ukrainian)

* New translations en.json (Ukrainian)

* New translations en.json (Portuguese)

* New translations en.json (Portuguese)

* New translations en.json (Russian)

* New translations en.json (Polish)

* New translations en.json (Polish)

* New translations en.json (Spanish)

* New translations en.json (Japanese)

* New translations en.json (Chinese Simplified)

* New translations en.json (Japanese)

* New translations en.json (Japanese)

* New translations en.json (Ukrainian)

* New translations en.json (Polish)

* New translations en.json (Chinese Simplified)

* New translations en.json (Ukrainian)

* New translations en.json (Ukrainian)

* New translations en.json (Russian)

* New translations en.json (French)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

* New translations en.json (Ukrainian)

* New translations en.json (Russian)

* New translations en.json (Russian)

* New translations en.json (Russian)

* New translations en.json (Ukrainian)

* New translations en.json (Ukrainian)

* New translations en.json (Portuguese)

* New translations en.json (Portuguese)

* New translations en.json (Portuguese)

* New translations en.json (Russian)

* New translations en.json (Russian)

* New translations en.json (Russian)

* New translations en.json (Russian)

* New translations en.json (Russian)

* New translations en.json (Portuguese)

* New translations en.json (Portuguese)

* New translations en.json (Portuguese)

* New translations en.json (Chinese Simplified)
2025-02-03 11:07:41 -06:00
tresabhi 90c5c16b00 feat: some texture mounting 2025-02-02 22:22:10 -06:00
tresabhi 4d94205547 feat: some material things 2025-02-02 21:55:17 -06:00
tresabhi 31ff50ffd8 feat: custom gltf 2025-02-02 13:39:37 -06:00
tresabhi 22e4553720 feat: export 2025-02-02 00:54:07 -06:00
tresabhi 8b268cb647 feat: hull mesh 2025-02-02 00:25:47 -06:00
tresabhi 168a955380 feat: use nuget package 2025-02-01 22:05:27 -06:00
tresabhi 37ec987a32 feat: use nuget package 2025-02-01 22:04:58 -06:00
tresabhi 37b5d1c6e8 feat: implement mappeduobject 2025-02-01 22:01:06 -06:00
tresabhi 09abbbadc9 feat: more mapping 2025-02-01 21:51:43 -06:00
tresabhi 8b0f95c53d feat: more shit 2025-02-01 21:21:12 -06:00
tresabhi 920ef6e5c4 feat: extract tank mangle logic 2025-01-30 12:54:37 -06:00
tresabhi 6829ff921d feat: mangle crew healths 2025-01-30 12:49:15 -06:00
tresabhi c6f4a13abc feat: some healths 2025-01-30 11:31:55 -06:00
tresabhi 67f312075a feat: more proto 2025-01-29 19:14:46 -06:00
tresabhi 5881b5b533 feat: parsing 2025-01-28 19:56:34 -06:00
tresabhi aa4da2ac4e feat: maps 2025-01-28 19:53:15 -06:00
tresabhi d6c1e8069d feat: parsing 2025-01-28 19:52:49 -06:00
tresabhi 74a8df6842 feat: rename cli 2025-01-28 12:59:59 -06:00
tresabhi 157fa0c1dd feat: protos 2025-01-28 12:55:02 -06:00
tresabhi 0139dd45c9 feat: dir api 2025-01-27 22:17:13 -06:00
tresabhi 9546bf5bb7 feat: oh my lord i did it 2025-01-27 17:25:40 -06:00
tresabhi 1714028e83 feat: start of tank proto 2025-01-26 21:51:35 -06:00
tresabhi d178c458df feat: remove stuff 2025-01-26 21:17:25 -06:00
tresabhi 415aebfd74 fix: use debug 2025-01-26 17:05:53 -06:00
tresabhi 68fd8fcfc5 feat: exergize globs 2025-01-26 17:03:49 -06:00
tresabhi 4c16af918d fix: override 2025-01-26 13:12:03 -06:00
tresabhi b16601704f feat: sort hd and non-hd 2025-01-26 13:11:40 -06:00
tresabhi 3a2aa135a1 feat: archive vfs 2025-01-26 12:39:23 -06:00
tresabhi 6a43773b55 fix: use oodle prefix 2025-01-26 12:36:38 -06:00
tresabhi fa5132aba5 fix: log 2025-01-26 12:35:03 -06:00
tresabhi c21a2bf58b fix: await 2025-01-26 12:28:53 -06:00
tresabhi 55ef1ecbd8 feat: oodle 2025-01-26 12:28:14 -06:00
tresabhi 3883eddd5d feat: memory 2025-01-26 12:11:40 -06:00
tresabhi 40dd752cb7 feat: stream 2025-01-25 23:59:10 -06:00
tresabhi 3c6ae546f6 feat: dlc 2025-01-25 23:51:18 -06:00
tresabhi 51fe0fe41f feat: default ini parser 2025-01-25 23:27:39 -06:00
tresabhi 1957d960aa feat: agonostic dll 2025-01-25 22:44:50 -06:00
tresabhi 7098395323 feat: some unpacker stuff 2025-01-25 22:17:41 -06:00
tresabhi 57287cea3a fix: uh lol hide that 2025-01-25 21:50:32 -06:00
tresabhi 9158f0bb79 fix: use custom dir 2025-01-25 21:48:33 -06:00
tresabhi 55e5298ba6 fix: use dotnet 9 2025-01-25 21:46:14 -06:00
tresabhi fcc34f7942 fix: cd 2025-01-25 21:45:08 -06:00
tresabhi b70d65f37b feat: more 2025-01-25 21:42:25 -06:00
tresabhi 693c3f42a6 fix: regex 2025-01-25 21:21:52 -06:00
tresabhi eab868db05 fix: no s in paks 2025-01-25 21:18:30 -06:00
tresabhi 5a9c463457 fix: indent 2025-01-25 21:16:15 -06:00
tresabhi 8119cdbb36 feat: regex 2025-01-25 21:15:03 -06:00
tresabhi 8ce7a205f1 fix: app flag 2025-01-25 21:09:43 -06:00
tresabhi e943a1af82 feat: test of cron 2025-01-25 21:07:56 -06:00
tresabhi e4cb8b3116 feat: read 2025-01-25 14:24:18 -06:00
tresabhi 4afc413d8b feat: vfs 2025-01-25 13:49:28 -06:00
tresabhi df93c986f9 feat: first proof of concept of reading 2025-01-25 13:20:55 -06:00
tresabhi 6f9336d067 featL include as submodule 2025-01-25 12:04:48 -06:00
TrèsAbhi c0895409bc Update index.ts 2025-01-24 11:27:45 -06:00
tresabhi 82af101f9c feat: pathing 2025-01-23 21:43:54 -06:00
tresabhi 8e4f4c39bb feat: start on cli 2025-01-20 22:16:15 -06:00
TrèsAbhi 438b565cbb New Crowdin updates (#145) 2025-01-19 13:00:15 -06:00
tresabhi cf1a82e89b fix: remove default 2025-01-19 12:51:26 -06:00
tresabhi 0506e361b2 feat: more prune 2025-01-19 12:46:57 -06:00
tresabhi d6a1357a82 Merge branch 'main' into dev 2025-01-19 12:41:06 -06:00
tresabhi a5a1dbd51b fix: [Oo] for /debug 2025-01-18 14:16:49 -06:00
tresabhi 5201350e44 fix: [Oo] for /stats 2025-01-18 14:16:26 -06:00
tresabhi 6a84b9d5ae fix: stricter pattern 2025-01-18 14:07:47 -06:00
tresabhi cf04fe21b3 fix: logs 2025-01-18 13:59:14 -06:00
tresabhi 84eb3c2da3 fix: version 2025-01-18 13:49:37 -06:00
tresabhi 22bf2dc1d8 feat: logs 2025-01-18 13:49:18 -06:00
tresabhi b9c339daa7 fix: search keys 2025-01-18 13:47:31 -06:00
tresabhi ef3006cac1 fix: double full stops 2025-01-18 13:42:52 -06:00
TrèsAbhi e482fd40c1 Update applyPatches.ts 2025-01-18 11:41:45 -06:00
TrèsAbhi cc4569966e Update applyPatches.ts 2025-01-18 09:19:38 -06:00
tresabhi 3708a3ced7 fix: handle deleted tanks 2025-01-17 20:29:33 -06:00
tresabhi 0ae59c2fd7 fix: check dir exists 2025-01-17 20:15:09 -06:00
tresabhi 7027f63236 feat: prune 2025-01-17 19:56:46 -06:00
TrèsAbhi 6725e79021 New Crowdin updates (#140) 2025-01-17 19:36:39 -06:00
tresabhi 5ca3cee9da feat: verbose 2025-01-17 19:22:02 -06:00
tresabhi 602a5a1e99 fix: move env 2025-01-17 19:19:45 -06:00
tresabhi bfbf3bdc39 fix: no double dvpl 2025-01-17 19:17:39 -06:00
tresabhi 644686582e fix: icon api 2025-01-17 19:06:07 -06:00
TrèsAbhi 1c00bc81f8 New Crowdin updates (#139)
* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (Japanese)

* New translations en.json (Polish)

* New translations en.json (Portuguese)

* New translations en.json (Russian)

* New translations en.json (Ukrainian)

* New translations en.json (Chinese Simplified)

* New translations en.json (Portuguese)

* New translations en.json (Portuguese)

* New translations en.json (Russian)

* New translations en.json (Russian)

* New translations en.json (Russian)

* New translations en.json (Chinese Simplified)
2025-01-17 12:46:05 -06:00
TrèsAbhi ac3b69bec5 Update assets.yml 2025-01-17 12:45:12 -06:00
TrèsAbhi 3e14c943b6 Update assets.yml 2025-01-16 23:05:13 -06:00
TrèsAbhi d33633be2c Update assets.yml 2025-01-16 22:15:24 -06:00
TrèsAbhi 4bf70d02d0 Update Crowdin configuration file 2025-01-16 20:48:29 -06:00
tresabhi 377bcf0e38 fix: env 2025-01-16 20:44:55 -06:00
tresabhi 884b6d4318 fix: run tests even on dev 2025-01-16 20:36:49 -06:00
296 changed files with 46574 additions and 8096 deletions

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.30.6",
"commands": [
"dotnet-csharpier"
],
"rollForward": false
}
}
}
+1
View File
@@ -0,0 +1 @@
/submodules/
+3
View File
@@ -0,0 +1,3 @@
{
"tabWidth": 2
}
-135
View File
@@ -1,135 +0,0 @@
name: Build Assets
on:
push:
branches: main
workflow_dispatch:
inputs:
cdn_branch:
type: string
required: false
default: main
description: What CDN branch to write to
zip_url:
type: string
required: false
description: ZIP URL to download instead of Steam client
zip_root:
type: string
required: false
description: Root dir of ZIP which houses the executable and Data dir
schedule:
- cron: '0 2 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.cdn_branch }}
cancel-in-progress: true
env:
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
VIDEOS_SHEET: ${{ secrets.VIDEOS_SHEET }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
WOTB_DLC_CDN: ${{ secrets.WOTB_DLC_CDN }}
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
PUBLIC_ASSET_BRANCH: ${{ github.event.inputs.cdn_branch || secrets.PUBLIC_ASSET_BRANCH }}
jobs:
download_client:
name: Download client
runs-on: ubuntu-latest
steps:
- name: (ZIP) Maximize build space
if: github.event.inputs.zip_url != ''
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 512
swap-size-mb: 1024
remove-dotnet: 'true'
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- name: (Steam) Setup bun
uses: oven-sh/setup-bun@v1
if: github.event.inputs.zip_url == ''
- name: (Steam) Install dependencies
if: github.event.inputs.zip_url == ''
run: bun install
- name: (Steam) Setup DepotDownloader
if: github.event.inputs.zip_url == ''
run: bun run setup:depotdownloader
- name: (Steam) Download client
if: github.event.inputs.zip_url == ''
run: |
chmod +x ./temp/depotDownloader/DepotDownloader
./temp/depotDownloader/DepotDownloader -q -os windows -app 444200 -username ${{ secrets.DEPOT_DOWNLOADER_USERNAME }} -password "${{ secrets.DEPOT_DOWNLOADER_PASSWORD }}"
- name: (Steam) Apply patches
if: github.event.inputs.zip_url == ''
run: bun setup:patches --depot
- name: (ZIP) Download client
if: github.event.inputs.zip_url != ''
env:
ZIP_URL: ${{ github.event.inputs.zip_url }}
ZIP_ROOT: ${{ github.event.inputs.zip_root }}
run: |
wget -q -O client.zip $ZIP_URL
unzip -q client.zip -d client
rm client.zip
mkdir -p depots/444202/0
mv client/$ZIP_ROOT/* depots/444202/0
- name: Archive depots
uses: actions/upload-artifact@v4
with:
name: depots
path: depots
build_assets:
name: Build assets
runs-on: ubuntu-latest
needs: download_client
steps:
- uses: actions/checkout@v4
- name: Setup bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install
- name: Lint
run: bun run lint:website
- name: Download depots
uses: actions/download-artifact@v4
with:
name: depots
path: depots
- name: AppArmor hack
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- name: Start server and build assets
run: |
bun dev:website &
SERVER_PID=$!
bun run build:assets --all-targets --depot --production
kill $SERVER_PID || true
+110 -9
View File
@@ -2,7 +2,6 @@ name: Website
on:
push:
branches: main
workflow_dispatch:
schedule:
@@ -15,44 +14,114 @@ permissions:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref == 'refs/heads/main' }}
cancel-in-progress: true
env:
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
# PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
ALLOW_ROBOTS: true
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
DEPOT_DOWNLOADER_USERNAME: ${{ secrets.DEPOT_DOWNLOADER_USERNAME }}
DEPOT_DOWNLOADER_PASSWORD: ${{ secrets.DEPOT_DOWNLOADER_PASSWORD }}
STEAM_OS: windows
STEAM_APP: 3341250
STEAM_DEPOT: 3341251
PUBLIC_ASSET_BRANCH: ue
GH_TOKEN: ${{ secrets.GH_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_TOKEN }}
- uses: oven-sh/setup-bun@v1
- uses: actions/configure-pages@v5
- name: Setup bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
- name: Configure pages
uses: actions/configure-pages@v5
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0
- name: Download Steam Depot
run: |
mkdir -p temp
echo "Downloading..."
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/SteamRE/DepotDownloader/releases/latest | \
grep -i "linux-x64" | \
grep "browser_download_url" | \
cut -d '"' -f 4)
curl -L "$DOWNLOAD_URL" -o temp/depotDownloader.zip
echo "Unzipping..."
unzip temp/depotDownloader.zip -d temp/depotDownloader
echo "Download complete; files:"
ls temp/depotDownloader
- name: Download dependencies
run: bun install
- name: Build website
run: bun run build:website
- name: Restore dependencies
run: |
cd src/BlitzKit.CLI
dotnet restore
- name: Download client
run: |
chmod +x temp/depotDownloader/DepotDownloader
temp/depotDownloader/DepotDownloader \
-username "${{ env.DEPOT_DOWNLOADER_USERNAME }}" \
-password "${{ env.DEPOT_DOWNLOADER_PASSWORD }}" \
-os ${{ env.STEAM_OS }} \
-app ${{ env.STEAM_APP }} \
-depot ${{ env.STEAM_DEPOT }} \
-dir temp/depot \
-filelist filelist.txt
- name: Download containers
run: |
cd src/BlitzKit.CLI
dotnet run unpack ../../temp/depot
- name: Run API and build website
run: |
cd src/BlitzKit.CLI
dotnet run api --depot --verbosepa &
SERVER_PID=$!
cd ../..
bun run buildonly:website
kill $SERVER_PID || true
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
name: build
path: dist/website
deploy-github-pages:
if: ${{ github.ref == 'refs/heads/main' }}
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: build
@@ -64,3 +133,35 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
deploy-vercel:
if: ${{ github.ref != 'refs/heads/main' }}
name: Deploy to Vercel
runs-on: ubuntu-latest
needs: build
environment:
name: Preview
url: ${{ steps.url.outputs.url }}
steps:
- uses: actions/checkout@v4
- name: Setup bun
uses: oven-sh/setup-bun@v1
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build
path: .vercel/output/
- name: Install Vercel CLI
run: bun install --global vercel
- name: Deploy Project Artifacts to Vercel
shell: bash
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | tee deploy.log
- name: Set preview url
id: url
run: echo "url=$(tail -1 deploy.log)">> $GITHUB_OUTPUT
+490
View File
@@ -1,3 +1,5 @@
# src/BlitzKit.CLI/Protos
node_modules
_node_modules
package-lock.json
@@ -27,3 +29,491 @@ target
/.vercel
/.astro
.vercel
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from `dotnet new gitignore`
# dotenv files
.env
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET
project.lock.json
project.fragment.lock.json
artifacts/
# Tye
.tye/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
# REMOVING THIS BECAUSE IT IGNORES PACKAGES LOL
# **/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
.idea/
##
## Visual studio for Mac
##
# globs
Makefile.in
*.userprefs
*.usertasks
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.tar.gz
tarballs/
test-results/
# Mac bundle stuff
*.dmg
*.app
# content below from: https://github.com/github/gitignore/blob/main/Global/macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# content below from: https://github.com/github/gitignore/blob/main/Global/Windows.gitignore
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# Vim temporary swap files
*.swp
+6
View File
@@ -1,3 +1,9 @@
[submodule "submodules/blitzkit-closed"]
path = submodules/blitzkit-closed
url = https://github.com/tresabhi/blitzkit-closed
[submodule "submodules/CUE4Parse"]
path = submodules/CUE4Parse
url = https://github.com/FabianFG/CUE4Parse
[submodule "submodules/UAssetAPI"]
path = submodules/UAssetAPI
url = https://github.com/atenfyr/UAssetAPI
+1
View File
@@ -0,0 +1 @@
/submodules/
+20 -1
View File
@@ -12,8 +12,10 @@
"APAC",
"apcr",
"applypatches",
"arrayfy",
"artefacts",
"astrojs",
"astrolib",
"atgm",
"Autoloader",
"Autoreloader",
@@ -71,6 +73,10 @@
"dxgi",
"echarts",
"Everytime",
"Exergizable",
"Exergize",
"Exergizing",
"Exergy",
"FASTNAME",
"flexdirection",
"FOURCC",
@@ -117,12 +123,14 @@
"NEGATIVEX",
"NEGATIVEY",
"NEGATIVEZ",
"Newtonsoft",
"NITROPAY",
"nivo",
"nmatname",
"noout",
"normalmap",
"oneof",
"Oodle",
"oopsies",
"Oopsy",
"opentest",
@@ -130,14 +138,19 @@
"outdir",
"outfile",
"ownedtanks",
"paks",
"partytown",
"PIXELFORMAT",
"playerachievements",
"playerinfo",
"playform",
"Playtest",
"pngjs",
"POSITIVEX",
"POSITIVEY",
"POSITIVEZ",
"precompute",
"preforged",
"Promisable",
"proto",
"protobuf",
@@ -145,6 +158,7 @@
"Pyogenics",
"ratingleaderboard",
"raycaster",
"regen",
"researchable",
"Resvg",
"rizz",
@@ -182,7 +196,9 @@
"tresabhi",
"tungstentip",
"TYPELESS",
"uasset",
"ubjson",
"uexp",
"Unicum",
"UNLOCALIZED",
"UNORM",
@@ -190,7 +206,9 @@
"Unregistering",
"unrotate",
"unwrapper",
"Usmap",
"vercel",
"Verts",
"vickers",
"vitepress",
"Vovko",
@@ -218,5 +236,6 @@
"deno.unstable": false,
"cSpell.enableFiletypes": ["glsl", "proto3"],
"typescript.tsdk": "node_modules\\typescript\\lib",
"liveServer.settings.multiRootWorkspaceName": "blitzkit"
"liveServer.settings.multiRootWorkspaceName": "blitzkit",
"dotnet.defaultSolution": "blitzkit.sln"
}
+41
View File
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/blitzkit.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/blitzkit.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/blitzkit.sln"
],
"problemMatcher": "$msCompile"
}
]
}
+29
View File
@@ -0,0 +1,29 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.2.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlitzKit.CLI", "src\BlitzKit.CLI\BlitzKit.CLI.csproj", "{65351C93-2DB4-8401-3BE1-C253571187A1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{65351C93-2DB4-8401-3BE1-C253571187A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{65351C93-2DB4-8401-3BE1-C253571187A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{65351C93-2DB4-8401-3BE1-C253571187A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{65351C93-2DB4-8401-3BE1-C253571187A1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{65351C93-2DB4-8401-3BE1-C253571187A1} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {70DA613E-E0B8-4525-93DB-3BF91568E845}
EndGlobalSection
EndGlobal
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -1,3 +1,3 @@
files:
- source: /packages/core/lang/en.json
- source: /packages/i18n/strings/en.json
translation: /%original_path%/%locale%.json
+7
View File
@@ -0,0 +1,7 @@
# BlitzKit 1.27.1
## Fixes
- Fixed a crash that occurs if tanks are deleted in Blitz and were once available in BlitzKit
- All tank icons are now back
- The tank search once again returns results
+7
View File
@@ -0,0 +1,7 @@
# BlitzKit 1.27.2
This update only affects the website.
## Fixes
- The new Improved Vertical Stabilizer equipment which only affects the gun depression found on the Type 63 now works
+9
View File
@@ -0,0 +1,9 @@
# BlitzKit 1.27.3
This update only affects the bot.
## Fixes
- Added support for 64-bit IDs allowing users with new accounts to link with BlitzKit
- This comes at the added cost of resetting the links of all other accounts
- Just re-link and you're good to go
+3
View File
@@ -0,0 +1,3 @@
# FreakKit 1.27.4
It has come to our attention that tanks are very harsh objects. To even it out, we made the website a pretty pretty princess <3
+11
View File
@@ -0,0 +1,11 @@
# BlitzKit 1.27.5
This update only affects the bot.
## Changes
- Removed `/auction`
## Fixes
- Fixed a bug that caused `/rating` to disappear
+23
View File
@@ -0,0 +1,23 @@
# BlitzKit 1.27.6
This update only affects the website.
## Features
- Added a promotional card for [the official Discord server](https://discord.gg/nDt7AjGJQH) to the homepage
- Added a better navbar
- The added spaces and padding helps add more room for error when clicking, especially on mobile
- The dropdown menu is now a lost smaller, disposing of the need to scroll at all
- Added shell filters to the tank search
- Reworked the filter buttons and their positions to allow for more space
## Fixes
- Moved most images from imgur to BlitzKit allowing for users in certain countries to load BlitzKit without getting blocked
## Technical Features
- Added Partytown to offload some workload off the main thread, allowing for a more responsive experience
- Reworked `robots.txt` to disallow indexing of BlitzKit variants
- Improved the SEO further for most pages
- Added a few compressor library to speed up load times
+15
View File
@@ -0,0 +1,15 @@
`Blitz/Config/DefaultGameplayTags.ini` seems to have an exhaustive list of all maps, tanks, sets, game modes, legendary camouflages, consumables, skills, quick commands, UI components, etc.
`Blitz/Config/DefaultGame.ini` seems to have all locales under the name of "Cultures"
`Blitz/Config/DefaultDlc.ini` contains DLC info; essentially extra `pak` containers
`Blitz/Content/TanksStuff/Common/DT_TankClasses.uasset` seems to have all tank classes
`C:\Users\coola\AppData\Local\Blitz\Saved\PersistentDownloadDir\http\dl-wotblitz-gc.wargaming.net\dlc\p14y73c7_p5e_b10gg3RS_big_play\ue_localizations\development\general` has all localization files
`Blitz/Config/DefaultBzBattleSettings.ini` contains all modules that can take damage when a tank takes fall damage
`Blitz/Config/DefaultLocalizationFetcher.ini` has a list of all locales
`Blitz/Content/TanksStuff/Dev/DT_DAVATanks.uasset` has all DAVA-UE tank mappings
+1
View File
@@ -0,0 +1 @@
Blitz/Content/Paks/pakchunk0-Windows.pak
+10 -4
View File
@@ -1,7 +1,7 @@
{
"name": "blitzkit",
"private": true,
"version": "1.27.0",
"version": "1.27.6",
"description": "🎉 Tools for everything World of Tanks Blitz",
"type": "module",
"types": "./types.d.ts",
@@ -13,6 +13,7 @@
"build:averages": "bun --filter=@blitzkit/scripts run build:averages",
"build:bot": "cd packages/scripts && bun run build:bot",
"build:website": "bun build:prisma --no-hints && cd packages/website && bun run build",
"buildonly:website": "bun build:prisma --no-hints && cd packages/website && bun run buildonly",
"build:prisma": "prisma generate",
"build:sitemap": "bun scripts/sitemap.ts",
"build:docs": "vitepress build docs",
@@ -21,7 +22,6 @@
"start:bot": "bun dist/bot/main.js",
"dev:docs": "vitepress dev docs",
"dev:website": "cd packages/website && bun run dev",
"dev:api": "bun --filter=@blitzkit/api run dev",
"setup:depotdownloader": "bun --filter=@blitzkit/scripts run setup:depotdownloader",
"setup:patches": "bun --filter=@blitzkit/scripts run setup:patches",
"start:website": "bun --filter=@blitzkit/website run start",
@@ -32,10 +32,16 @@
"update": "yarn upgrade --latest",
"tunnel": "cloudflared tunnel --url http://localhost:3000",
"discoverids": "scripts/discoverIds.ts",
"build:protos": "bun packages/scripts/src/protos.ts",
"protos": "rm -rf src/BlitzKit.CLI/Protos && mkdir -p src/BlitzKit.CLI/Protos && protoc packages/core/src/protos/*.proto --csharp_out=src/BlitzKit.CLI/Protos && bun packages/scripts/src/protos.ts",
"preview:website": "cd packages/website && bun run preview",
"build:reviews": "cd packages/scripts && bun build:reviews",
"build:ids": "cd packages/scripts && bun build:ids"
"build:ids": "cd packages/scripts && bun build:ids",
"prunestrings": "cd packages/scripts && bun prunestrings",
"dev:cli:unpack": "cd src/BlitzKit.CLI && dotnet run unpack \"C:/Program Files (x86)/Steam/steamapps/common/World of Tanks Blitz Playtest\" --no-overwrite",
"mangle": "cd src/BlitzKit.CLI && dotnet run mangle",
"mangle2": "cd src/BlitzKit.CLI && dotnet run mangle2",
"api": "cd src/BlitzKit.CLI && dotnet run api",
"dev:api": "cd src/BlitzKit.CLI && dotnet watch run api"
},
"license": "MIT",
"dependencies": {
+1 -1
View File
@@ -17,7 +17,7 @@ export const debugCommand = new Promise<CommandRegistry>((resolve) => {
const list = [
[strings.bot.commands.debug.body.version, packageJSON.version],
[
strings.bot.commands.debug.body.shard,
strings.bot.commands.debug.body.shard.label,
client.shard?.ids[0] ?? strings.bot.commands.debug.body.shard.default,
],
[
@@ -16,8 +16,8 @@ export function CommandWrapper({ children, fat }: CommandWrapperProps) {
gap: 16,
width: '100%',
color: theme.colors.textHighContrast,
backgroundColor: theme.colors.appBackground1,
position: 'relative',
background: theme.colors.appBackground1,
}}
>
{children}
+2 -4
View File
@@ -1,3 +1,4 @@
import { SEARCH_KEYS } from '@blitzkit/core';
import { literals } from '@blitzkit/i18n';
import { Locale } from 'discord.js';
import { go } from 'fuzzysort';
@@ -19,10 +20,7 @@ export async function resolveTankId(
const searchResult = go(
`${tank}`,
await (techTreeOnly ? tankNamesTechTreeOnly : tankNames),
{
keys: ['searchableName', 'searchableNameDeburr', 'camouflages'],
limit: 1,
},
{ keys: SEARCH_KEYS, limit: 1 },
);
if (searchResult.length === 0) {
@@ -8,12 +8,12 @@ export async function filtersToDescription(
{ nation, tier, type, class: tankClass, tank }: StatFilters,
locale: Locale,
) {
const { strings } = translator(locale);
const { strings, bkLocale } = translator(locale);
const awaitedTankDefinitions = await fetchTankDefinitions();
const info: string[] = [];
// TODO: somehow localize tank names?
if (tank) return awaitedTankDefinitions.tanks[tank].name;
if (tank) return awaitedTankDefinitions.tanks[tank].name.locales[bkLocale];
if (nation)
info.push((strings.common.nations as Record<string, string>)[nation]);
if (tier) {
@@ -8,6 +8,8 @@ export async function getBlitzFromDiscord(discordId: bigint) {
if (unique === null) return null;
await flagUserActivity(unique.blitz_id);
return { id: unique.blitz_id, region: idToRegion(unique.blitz_id) };
const id = Number(unique.blitz_id);
await flagUserActivity(id);
return { id, region: idToRegion(id) };
}
@@ -1,5 +1,4 @@
import { fetchTankNames, TankType } from '@blitzkit/core';
import { SUPPORTED_LOCALES } from '@blitzkit/i18n';
import { fetchTankNames, SEARCH_KEYS, TankType } from '@blitzkit/core';
import {
ApplicationCommandOptionChoiceData,
AutocompleteInteraction,
@@ -32,16 +31,7 @@ export async function autocompleteTanks(
go(
focusedOption.value,
await (techTreeOnly ? tankNamesTechTreeOnly : tankNames),
{
keys: [
...SUPPORTED_LOCALES.map((locale) => [
`searchableName.{locale}`,
`searchableNameDeburr.{locale}`,
]).flat(),
'camouflages',
],
limit: 10,
},
{ keys: SEARCH_KEYS, limit: 10 },
).map(async (item) => {
let name = unwrap(item.obj.searchableName);
@@ -3,7 +3,8 @@ import { Locale } from 'discord.js';
import { SUPPORTED_LOCALES_DISCORD } from '../localization/strings/constants';
import { translator } from '../localization/translator';
const validNameRegex = /^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$/u;
const validNameRegex =
/^[\p{Ll}\p{Lm}\p{Lo}\p{N}\p{sc=Devanagari}\p{sc=Thai}_-]+$/u;
export function localizationObject(
path: (strings: BlitzKitStrings) => string,
@@ -14,7 +15,8 @@ export function localizationObject(
(localizations, locale) => {
const { strings } = translator(locale);
const translation = literalsFunc(path(strings), literals);
const isValid = !strict || validNameRegex.test(translation);
const isValid =
(!strict || validNameRegex.test(translation)) && translation.length > 0;
if (!isValid) {
console.warn(
@@ -12,8 +12,9 @@ export function translator(localeRaw: Locale) {
SUPPORTED_LOCALES_DISCORD.includes(localeRaw)
? localeRaw
: DEFAULT_LOCALE_DISCORD;
const strings = STRINGS[SUPPORTED_LOCALES_DISCORD_MAP_INVERSE[locale]];
const unwrap = unwrapper(SUPPORTED_LOCALES_DISCORD_MAP_INVERSE[locale]);
const bkLocale = SUPPORTED_LOCALES_DISCORD_MAP_INVERSE[locale];
const strings = STRINGS[bkLocale];
const unwrap = unwrapper(bkLocale);
return { locale, strings, unwrap };
return { locale, strings, unwrap, bkLocale };
}
@@ -19,11 +19,11 @@ import { Writeable } from '../../../types/writable';
export async function handleChatInputCommand(
interaction: ChatInputCommandInteraction<CacheType>,
) {
await interaction.deferReply();
const awaitedCommands = await commands;
const registry = awaitedCommands[interaction.commandName];
await interaction.deferReply();
try {
const returnable = await registry.handler(interaction);
@@ -15,7 +15,6 @@ import {
SlashCommandSubcommandsOnlyBuilder,
} from 'discord.js';
import { aboutCommand } from '../../commands/about';
import { auctionCommand } from '../../commands/auction';
import { breakdownCommand } from '../../commands/breakdown';
import { debugCommand } from '../../commands/debug';
import { evolutionCommand } from '../../commands/evolution';
@@ -80,7 +79,7 @@ interface CommandRegistryExplicit extends CommandRegistryBase {
export type CommandRegistry = CommandRegistryImplicit | CommandRegistryExplicit;
export const COMMANDS_RAW: Promise<CommandRegistry>[] = [
auctionCommand,
// auctionCommand,
permissionsCommand,
debugCommand,
aboutCommand,
+8 -1
View File
@@ -45,7 +45,7 @@ const interval = setInterval(async () => {
const usernames = awaitedDiscoveredIdsDefinitions.count;
manager.broadcastEval(
(client, { servers, users, channels, tanks, usernames }) => {
async (client, { servers, users, channels, tanks, usernames }) => {
const bios = [
`Living in ${servers.toLocaleString()} servers`,
`Serving ${users.toLocaleString()} users`,
@@ -62,6 +62,13 @@ const interval = setInterval(async () => {
},
],
});
for (const guild of client.guilds.cache.values()) {
try {
const botMember = await guild.members.fetch(client.user.id);
await botMember.setNickname('BlitzKit');
} catch {}
}
},
{ context: { servers, channels, users, tanks, usernames } },
);
+1 -1
View File
@@ -23,7 +23,7 @@ export const theme = {
spaces: createSpaces(),
colors: {
...createColors(slateDark),
...createColors(mauveDark),
...createColors(slateDarkA, 'alpha'),
...createColors(slate, 'light'),
+5
View File
@@ -46,4 +46,9 @@ export * from './votes';
export * from './createDefaultProvisions';
export * from './metaSortTank';
export * from './romanize';
export * from './tank';
export * from './tankArmor';
export * from './tankModel';
export * from './tanks';
export * from './tanksFull';
export * from './youtubers';
+7
View File
@@ -0,0 +1,7 @@
import { fetchPB } from '../protobuf';
import { Tank } from '../protos';
import { asset } from './asset';
export function fetchTank(id: string) {
return fetchPB(asset(`tanks/${id}/meta.pb`), Tank);
}
+7
View File
@@ -0,0 +1,7 @@
import { fetchPB } from '../protobuf';
import { TankArmor } from '../protos';
import { asset } from './asset';
export function fetchTankArmor(id: string) {
return fetchPB(asset(`tanks/${id}/armor.pb`), TankArmor);
}
+7
View File
@@ -0,0 +1,7 @@
import { fetchPB } from '../protobuf';
import { TankModel } from '../protos';
import { asset } from './asset';
export function fetchTankModel(id: string) {
return fetchPB(asset(`tanks/${id}/model.pb`), TankModel);
}
+12 -1
View File
@@ -1,4 +1,5 @@
import { deburr } from 'lodash-es';
import { SUPPORTED_LOCALES } from '../../../i18n/src/strings';
import { I18nString } from '../protos';
import { fetchCamouflageDefinitions } from './camouflageDefinitions';
import { fetchTankDefinitions } from './tankDefinitions';
@@ -25,11 +26,21 @@ export async function fetchTankNames() {
searchableName: tank.name_full ?? tank.name,
searchableNameDeburr,
camouflages: tank.camouflages
?.map((id) => camouflageDefinitions.camouflages[id]?.name)
?.map((id) => SUPPORTED_LOCALES.map((locale) => camouflageDefinitions.camouflages[id]?.name.locales[locale]))
.flat()
.filter(Boolean)
.map(deburr)
.join(' '),
treeType: tank.type,
};
}),
);
}
export const SEARCH_KEYS = [
...SUPPORTED_LOCALES.map((locale) => [
`searchableName.locales.${locale}`,
`searchableNameDeburr.locales.${locale}`,
]).flat(),
'camouflages',
];
+7
View File
@@ -0,0 +1,7 @@
import { fetchPB } from '../protobuf';
import { Tanks } from '../protos';
import { asset } from './asset';
export function fetchTanks() {
return fetchPB(asset('definitions/tanks.pb'), Tanks);
}
+7
View File
@@ -0,0 +1,7 @@
import { fetchPB } from '../protobuf';
import { TanksFull } from '../protos';
import { asset } from './asset';
export function fetchTanksFull() {
return fetchPB(asset('definitions/tanks-full.pb'), TanksFull);
}
@@ -1,343 +0,0 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/camouflage_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { I18nString, createBaseI18nString } from "./i18n";
export const protobufPackage = "blitzkit";
export interface CamouflageDefinitions {
camouflages: { [key: number]: Camouflage };
}
export interface CamouflageDefinitions_CamouflagesEntry {
key: number;
value: Camouflage | undefined;
}
export interface Camouflage {
id: number;
name: I18nString;
tank_name?: I18nString | undefined;
tank_name_full?: I18nString | undefined;
}
function createBaseCamouflageDefinitions(): CamouflageDefinitions {
return { camouflages: {} };
}
export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
encode(message: CamouflageDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
Object.entries(message.camouflages).forEach(([key, value]) => {
CamouflageDefinitions_CamouflagesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): CamouflageDefinitions {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCamouflageDefinitions();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = CamouflageDefinitions_CamouflagesEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.camouflages[entry1.key] = entry1.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): CamouflageDefinitions {
return {
camouflages: isObject(object.camouflages)
? Object.entries(object.camouflages).reduce<{ [key: number]: Camouflage }>((acc, [key, value]) => {
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: CamouflageDefinitions): unknown {
const obj: any = {};
if (message.camouflages) {
const entries = Object.entries(message.camouflages);
if (entries.length > 0) {
obj.camouflages = {};
entries.forEach(([k, v]) => {
obj.camouflages[k] = Camouflage.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(base?: I): CamouflageDefinitions {
return CamouflageDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(object: I): CamouflageDefinitions {
const message = createBaseCamouflageDefinitions();
message.camouflages = Object.entries(object.camouflages ?? {}).reduce<{ [key: number]: Camouflage }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
}
return acc;
},
{},
);
return message;
},
};
function createBaseCamouflageDefinitions_CamouflagesEntry(): CamouflageDefinitions_CamouflagesEntry {
return { key: 0, value: createBaseCamouflage() };
}
export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefinitions_CamouflagesEntry> = {
encode(message: CamouflageDefinitions_CamouflagesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
Camouflage.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): CamouflageDefinitions_CamouflagesEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Camouflage.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
return {
key: globalThis.Number(assertSet("CamouflageDefinitions_CamouflagesEntry.key", object.key)),
value: Camouflage.fromJSON(assertSet("CamouflageDefinitions_CamouflagesEntry.value", object.value)),
};
},
toJSON(message: CamouflageDefinitions_CamouflagesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = Camouflage.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
base?: I,
): CamouflageDefinitions_CamouflagesEntry {
return CamouflageDefinitions_CamouflagesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
object: I,
): CamouflageDefinitions_CamouflagesEntry {
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
message.key = object.key ?? 0;
message.value = (object.value !== undefined && object.value !== null)
? Camouflage.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseCamouflage(): Camouflage {
return { id: 0, name: createBaseI18nString(), tank_name: undefined, tank_name_full: undefined };
}
export const Camouflage: MessageFns<Camouflage> = {
encode(message: Camouflage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).uint32(message.id);
}
if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(18).fork()).join();
}
if (message.tank_name !== undefined) {
I18nString.encode(message.tank_name, writer.uint32(26).fork()).join();
}
if (message.tank_name_full !== undefined) {
I18nString.encode(message.tank_name_full, writer.uint32(34).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Camouflage {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCamouflage();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.id = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.name = I18nString.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.tank_name = I18nString.decode(reader, reader.uint32());
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.tank_name_full = I18nString.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Camouflage {
return {
id: globalThis.Number(assertSet("Camouflage.id", object.id)),
name: I18nString.fromJSON(assertSet("Camouflage.name", object.name)),
tank_name: isSet(object.tank_name) ? I18nString.fromJSON(object.tank_name) : undefined,
tank_name_full: isSet(object.tank_name_full) ? I18nString.fromJSON(object.tank_name_full) : undefined,
};
},
toJSON(message: Camouflage): unknown {
const obj: any = {};
if (message.id !== 0) {
obj.id = Math.round(message.id);
}
if (message.name !== undefined) {
obj.name = I18nString.toJSON(message.name);
}
if (message.tank_name !== undefined) {
obj.tank_name = I18nString.toJSON(message.tank_name);
}
if (message.tank_name_full !== undefined) {
obj.tank_name_full = I18nString.toJSON(message.tank_name_full);
}
return obj;
},
create<I extends Exact<DeepPartial<Camouflage>, I>>(base?: I): Camouflage {
return Camouflage.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Camouflage>, I>>(object: I): Camouflage {
const message = createBaseCamouflage();
message.id = object.id ?? 0;
message.name = (object.name !== undefined && object.name !== null)
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.tank_name = (object.tank_name !== undefined && object.tank_name !== null)
? I18nString.fromPartial(object.tank_name)
: undefined;
message.tank_name_full = (object.tank_name_full !== undefined && object.tank_name_full !== null)
? I18nString.fromPartial(object.tank_name_full)
: undefined;
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
@@ -1,883 +0,0 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/consumable_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { I18nString, createBaseI18nString } from "./i18n";
export const protobufPackage = "blitzkit";
export enum ConsumableTankCategoryFilterCategory {
CLIP = 0,
}
export function consumableTankCategoryFilterCategoryFromJSON(object: any): ConsumableTankCategoryFilterCategory {
switch (object) {
case 0:
case "CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP":
return ConsumableTankCategoryFilterCategory.CLIP;
default:
throw new globalThis.Error(
"Unrecognized enum value " + object + " for enum ConsumableTankCategoryFilterCategory",
);
}
}
export function consumableTankCategoryFilterCategoryToJSON(object: ConsumableTankCategoryFilterCategory): string {
switch (object) {
case ConsumableTankCategoryFilterCategory.CLIP:
return "CONSUMABLE_TANK_CATEGORY_FILTER_CATEGORY_CLIP";
default:
throw new globalThis.Error(
"Unrecognized enum value " + object + " for enum ConsumableTankCategoryFilterCategory",
);
}
}
export interface ConsumableDefinitions {
consumables: { [key: number]: Consumable };
}
export interface ConsumableDefinitions_ConsumablesEntry {
key: number;
value: Consumable | undefined;
}
export interface Consumable {
id: number;
name: I18nString;
cooldown: number;
duration?: number | undefined;
game_mode_exclusive: boolean;
include: ConsumableTankFilter[];
exclude: ConsumableTankFilter[];
}
export interface ConsumableTankFilter {
filter_type?:
| { $case: "tiers"; value: ConsumableTankTierFilter }
| { $case: "ids"; value: ConsumableTankIdsFilter }
| { $case: "categories"; value: ConsumableTankCategoryFilter }
| { $case: "nations"; value: ConsumableTankNationFilter }
| undefined;
}
export interface ConsumableTankTierFilter {
min: number;
max: number;
}
export interface ConsumableTankIdsFilter {
ids: number[];
}
export interface ConsumableTankCategoryFilter {
categories: ConsumableTankCategoryFilterCategory[];
}
export interface ConsumableTankNationFilter {
nations: string[];
}
function createBaseConsumableDefinitions(): ConsumableDefinitions {
return { consumables: {} };
}
export const ConsumableDefinitions: MessageFns<ConsumableDefinitions> = {
encode(message: ConsumableDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
Object.entries(message.consumables).forEach(([key, value]) => {
ConsumableDefinitions_ConsumablesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableDefinitions {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumableDefinitions();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = ConsumableDefinitions_ConsumablesEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.consumables[entry1.key] = entry1.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ConsumableDefinitions {
return {
consumables: isObject(object.consumables)
? Object.entries(object.consumables).reduce<{ [key: number]: Consumable }>((acc, [key, value]) => {
acc[globalThis.Number(key)] = Consumable.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: ConsumableDefinitions): unknown {
const obj: any = {};
if (message.consumables) {
const entries = Object.entries(message.consumables);
if (entries.length > 0) {
obj.consumables = {};
entries.forEach(([k, v]) => {
obj.consumables[k] = Consumable.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<ConsumableDefinitions>, I>>(base?: I): ConsumableDefinitions {
return ConsumableDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ConsumableDefinitions>, I>>(object: I): ConsumableDefinitions {
const message = createBaseConsumableDefinitions();
message.consumables = Object.entries(object.consumables ?? {}).reduce<{ [key: number]: Consumable }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = Consumable.fromPartial(value);
}
return acc;
},
{},
);
return message;
},
};
function createBaseConsumableDefinitions_ConsumablesEntry(): ConsumableDefinitions_ConsumablesEntry {
return { key: 0, value: createBaseConsumable() };
}
export const ConsumableDefinitions_ConsumablesEntry: MessageFns<ConsumableDefinitions_ConsumablesEntry> = {
encode(message: ConsumableDefinitions_ConsumablesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
Consumable.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableDefinitions_ConsumablesEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumableDefinitions_ConsumablesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Consumable.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ConsumableDefinitions_ConsumablesEntry {
return {
key: globalThis.Number(assertSet("ConsumableDefinitions_ConsumablesEntry.key", object.key)),
value: Consumable.fromJSON(assertSet("ConsumableDefinitions_ConsumablesEntry.value", object.value)),
};
},
toJSON(message: ConsumableDefinitions_ConsumablesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = Consumable.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<ConsumableDefinitions_ConsumablesEntry>, I>>(
base?: I,
): ConsumableDefinitions_ConsumablesEntry {
return ConsumableDefinitions_ConsumablesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ConsumableDefinitions_ConsumablesEntry>, I>>(
object: I,
): ConsumableDefinitions_ConsumablesEntry {
const message = createBaseConsumableDefinitions_ConsumablesEntry();
message.key = object.key ?? 0;
message.value = (object.value !== undefined && object.value !== null)
? Consumable.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseConsumable(): Consumable {
return {
id: 0,
name: createBaseI18nString(),
cooldown: 0,
duration: undefined,
game_mode_exclusive: false,
include: [],
exclude: [],
};
}
export const Consumable: MessageFns<Consumable> = {
encode(message: Consumable, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).uint32(message.id);
}
if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(18).fork()).join();
}
if (message.cooldown !== 0) {
writer.uint32(24).uint32(message.cooldown);
}
if (message.duration !== undefined && message.duration !== undefined) {
writer.uint32(37).float(message.duration);
}
if (message.game_mode_exclusive !== false) {
writer.uint32(40).bool(message.game_mode_exclusive);
}
for (const v of message.include) {
ConsumableTankFilter.encode(v!, writer.uint32(50).fork()).join();
}
for (const v of message.exclude) {
ConsumableTankFilter.encode(v!, writer.uint32(58).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Consumable {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumable();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.id = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.name = I18nString.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.cooldown = reader.uint32();
continue;
}
case 4: {
if (tag !== 37) {
break;
}
message.duration = reader.float();
continue;
}
case 5: {
if (tag !== 40) {
break;
}
message.game_mode_exclusive = reader.bool();
continue;
}
case 6: {
if (tag !== 50) {
break;
}
message.include.push(ConsumableTankFilter.decode(reader, reader.uint32()));
continue;
}
case 7: {
if (tag !== 58) {
break;
}
message.exclude.push(ConsumableTankFilter.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Consumable {
return {
id: globalThis.Number(assertSet("Consumable.id", object.id)),
name: I18nString.fromJSON(assertSet("Consumable.name", object.name)),
cooldown: globalThis.Number(assertSet("Consumable.cooldown", object.cooldown)),
duration: isSet(object.duration) ? globalThis.Number(object.duration) : undefined,
game_mode_exclusive: globalThis.Boolean(assertSet("Consumable.game_mode_exclusive", object.game_mode_exclusive)),
include: globalThis.Array.isArray(object?.include)
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
: [],
exclude: globalThis.Array.isArray(object?.exclude)
? object.exclude.map((e: any) => ConsumableTankFilter.fromJSON(e))
: [],
};
},
toJSON(message: Consumable): unknown {
const obj: any = {};
if (message.id !== 0) {
obj.id = Math.round(message.id);
}
if (message.name !== undefined) {
obj.name = I18nString.toJSON(message.name);
}
if (message.cooldown !== 0) {
obj.cooldown = Math.round(message.cooldown);
}
if (message.duration !== undefined && message.duration !== undefined) {
obj.duration = message.duration;
}
if (message.game_mode_exclusive !== false) {
obj.game_mode_exclusive = message.game_mode_exclusive;
}
if (message.include?.length) {
obj.include = message.include.map((e) => ConsumableTankFilter.toJSON(e));
}
if (message.exclude?.length) {
obj.exclude = message.exclude.map((e) => ConsumableTankFilter.toJSON(e));
}
return obj;
},
create<I extends Exact<DeepPartial<Consumable>, I>>(base?: I): Consumable {
return Consumable.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Consumable>, I>>(object: I): Consumable {
const message = createBaseConsumable();
message.id = object.id ?? 0;
message.name = (object.name !== undefined && object.name !== null)
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.cooldown = object.cooldown ?? 0;
message.duration = object.duration ?? undefined;
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
message.include = object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
message.exclude = object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
return message;
},
};
function createBaseConsumableTankFilter(): ConsumableTankFilter {
return { filter_type: undefined };
}
export const ConsumableTankFilter: MessageFns<ConsumableTankFilter> = {
encode(message: ConsumableTankFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
switch (message.filter_type?.$case) {
case "tiers":
ConsumableTankTierFilter.encode(message.filter_type.value, writer.uint32(10).fork()).join();
break;
case "ids":
ConsumableTankIdsFilter.encode(message.filter_type.value, writer.uint32(18).fork()).join();
break;
case "categories":
ConsumableTankCategoryFilter.encode(message.filter_type.value, writer.uint32(26).fork()).join();
break;
case "nations":
ConsumableTankNationFilter.encode(message.filter_type.value, writer.uint32(34).fork()).join();
break;
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankFilter {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumableTankFilter();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.filter_type = { $case: "tiers", value: ConsumableTankTierFilter.decode(reader, reader.uint32()) };
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.filter_type = { $case: "ids", value: ConsumableTankIdsFilter.decode(reader, reader.uint32()) };
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.filter_type = {
$case: "categories",
value: ConsumableTankCategoryFilter.decode(reader, reader.uint32()),
};
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.filter_type = { $case: "nations", value: ConsumableTankNationFilter.decode(reader, reader.uint32()) };
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ConsumableTankFilter {
return {
filter_type: isSet(object.tiers)
? { $case: "tiers", value: ConsumableTankTierFilter.fromJSON(object.tiers) }
: isSet(object.ids)
? { $case: "ids", value: ConsumableTankIdsFilter.fromJSON(object.ids) }
: isSet(object.categories)
? { $case: "categories", value: ConsumableTankCategoryFilter.fromJSON(object.categories) }
: isSet(object.nations)
? { $case: "nations", value: ConsumableTankNationFilter.fromJSON(object.nations) }
: undefined,
};
},
toJSON(message: ConsumableTankFilter): unknown {
const obj: any = {};
if (message.filter_type?.$case === "tiers") {
obj.tiers = ConsumableTankTierFilter.toJSON(message.filter_type.value);
}
if (message.filter_type?.$case === "ids") {
obj.ids = ConsumableTankIdsFilter.toJSON(message.filter_type.value);
}
if (message.filter_type?.$case === "categories") {
obj.categories = ConsumableTankCategoryFilter.toJSON(message.filter_type.value);
}
if (message.filter_type?.$case === "nations") {
obj.nations = ConsumableTankNationFilter.toJSON(message.filter_type.value);
}
return obj;
},
create<I extends Exact<DeepPartial<ConsumableTankFilter>, I>>(base?: I): ConsumableTankFilter {
return ConsumableTankFilter.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ConsumableTankFilter>, I>>(object: I): ConsumableTankFilter {
const message = createBaseConsumableTankFilter();
if (
object.filter_type?.$case === "tiers" &&
object.filter_type?.value !== undefined &&
object.filter_type?.value !== null
) {
message.filter_type = { $case: "tiers", value: ConsumableTankTierFilter.fromPartial(object.filter_type.value) };
}
if (
object.filter_type?.$case === "ids" &&
object.filter_type?.value !== undefined &&
object.filter_type?.value !== null
) {
message.filter_type = { $case: "ids", value: ConsumableTankIdsFilter.fromPartial(object.filter_type.value) };
}
if (
object.filter_type?.$case === "categories" &&
object.filter_type?.value !== undefined &&
object.filter_type?.value !== null
) {
message.filter_type = {
$case: "categories",
value: ConsumableTankCategoryFilter.fromPartial(object.filter_type.value),
};
}
if (
object.filter_type?.$case === "nations" &&
object.filter_type?.value !== undefined &&
object.filter_type?.value !== null
) {
message.filter_type = {
$case: "nations",
value: ConsumableTankNationFilter.fromPartial(object.filter_type.value),
};
}
return message;
},
};
function createBaseConsumableTankTierFilter(): ConsumableTankTierFilter {
return { min: 0, max: 0 };
}
export const ConsumableTankTierFilter: MessageFns<ConsumableTankTierFilter> = {
encode(message: ConsumableTankTierFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.min !== 0) {
writer.uint32(8).uint32(message.min);
}
if (message.max !== 0) {
writer.uint32(16).uint32(message.max);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankTierFilter {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumableTankTierFilter();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.min = reader.uint32();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.max = reader.uint32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ConsumableTankTierFilter {
return {
min: globalThis.Number(assertSet("ConsumableTankTierFilter.min", object.min)),
max: globalThis.Number(assertSet("ConsumableTankTierFilter.max", object.max)),
};
},
toJSON(message: ConsumableTankTierFilter): unknown {
const obj: any = {};
if (message.min !== 0) {
obj.min = Math.round(message.min);
}
if (message.max !== 0) {
obj.max = Math.round(message.max);
}
return obj;
},
create<I extends Exact<DeepPartial<ConsumableTankTierFilter>, I>>(base?: I): ConsumableTankTierFilter {
return ConsumableTankTierFilter.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ConsumableTankTierFilter>, I>>(object: I): ConsumableTankTierFilter {
const message = createBaseConsumableTankTierFilter();
message.min = object.min ?? 0;
message.max = object.max ?? 0;
return message;
},
};
function createBaseConsumableTankIdsFilter(): ConsumableTankIdsFilter {
return { ids: [] };
}
export const ConsumableTankIdsFilter: MessageFns<ConsumableTankIdsFilter> = {
encode(message: ConsumableTankIdsFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
writer.uint32(10).fork();
for (const v of message.ids) {
writer.uint32(v);
}
writer.join();
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankIdsFilter {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumableTankIdsFilter();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag === 8) {
message.ids.push(reader.uint32());
continue;
}
if (tag === 10) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.ids.push(reader.uint32());
}
continue;
}
break;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ConsumableTankIdsFilter {
return { ids: globalThis.Array.isArray(object?.ids) ? object.ids.map((e: any) => globalThis.Number(e)) : [] };
},
toJSON(message: ConsumableTankIdsFilter): unknown {
const obj: any = {};
if (message.ids?.length) {
obj.ids = message.ids.map((e) => Math.round(e));
}
return obj;
},
create<I extends Exact<DeepPartial<ConsumableTankIdsFilter>, I>>(base?: I): ConsumableTankIdsFilter {
return ConsumableTankIdsFilter.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ConsumableTankIdsFilter>, I>>(object: I): ConsumableTankIdsFilter {
const message = createBaseConsumableTankIdsFilter();
message.ids = object.ids?.map((e) => e) || [];
return message;
},
};
function createBaseConsumableTankCategoryFilter(): ConsumableTankCategoryFilter {
return { categories: [] };
}
export const ConsumableTankCategoryFilter: MessageFns<ConsumableTankCategoryFilter> = {
encode(message: ConsumableTankCategoryFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
writer.uint32(10).fork();
for (const v of message.categories) {
writer.int32(v);
}
writer.join();
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankCategoryFilter {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumableTankCategoryFilter();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag === 8) {
message.categories.push(reader.int32() as any);
continue;
}
if (tag === 10) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.categories.push(reader.int32() as any);
}
continue;
}
break;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ConsumableTankCategoryFilter {
return {
categories: globalThis.Array.isArray(object?.categories)
? object.categories.map((e: any) => consumableTankCategoryFilterCategoryFromJSON(e))
: [],
};
},
toJSON(message: ConsumableTankCategoryFilter): unknown {
const obj: any = {};
if (message.categories?.length) {
obj.categories = message.categories.map((e) => consumableTankCategoryFilterCategoryToJSON(e));
}
return obj;
},
create<I extends Exact<DeepPartial<ConsumableTankCategoryFilter>, I>>(base?: I): ConsumableTankCategoryFilter {
return ConsumableTankCategoryFilter.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ConsumableTankCategoryFilter>, I>>(object: I): ConsumableTankCategoryFilter {
const message = createBaseConsumableTankCategoryFilter();
message.categories = object.categories?.map((e) => e) || [];
return message;
},
};
function createBaseConsumableTankNationFilter(): ConsumableTankNationFilter {
return { nations: [] };
}
export const ConsumableTankNationFilter: MessageFns<ConsumableTankNationFilter> = {
encode(message: ConsumableTankNationFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.nations) {
writer.uint32(10).string(v!);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsumableTankNationFilter {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsumableTankNationFilter();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.nations.push(reader.string());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ConsumableTankNationFilter {
return {
nations: globalThis.Array.isArray(object?.nations) ? object.nations.map((e: any) => globalThis.String(e)) : [],
};
},
toJSON(message: ConsumableTankNationFilter): unknown {
const obj: any = {};
if (message.nations?.length) {
obj.nations = message.nations;
}
return obj;
},
create<I extends Exact<DeepPartial<ConsumableTankNationFilter>, I>>(base?: I): ConsumableTankNationFilter {
return ConsumableTankNationFilter.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ConsumableTankNationFilter>, I>>(object: I): ConsumableTankNationFilter {
const message = createBaseConsumableTankNationFilter();
message.nations = object.nations?.map((e) => e) || [];
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
@@ -1,578 +0,0 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/equipment_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { I18nString, createBaseI18nString } from "./i18n";
export const protobufPackage = "blitzkit";
export interface EquipmentDefinitions {
presets: { [key: string]: EquipmentPreset };
equipments: { [key: number]: Equipment };
}
export interface EquipmentDefinitions_PresetsEntry {
key: string;
value: EquipmentPreset | undefined;
}
export interface EquipmentDefinitions_EquipmentsEntry {
key: number;
value: Equipment | undefined;
}
export interface Equipment {
name: I18nString;
description: I18nString;
}
export interface EquipmentPreset {
slots: EquipmentSlot[];
}
export interface EquipmentSlot {
left: number;
right: number;
}
function createBaseEquipmentDefinitions(): EquipmentDefinitions {
return { presets: {}, equipments: {} };
}
export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
encode(message: EquipmentDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
Object.entries(message.presets).forEach(([key, value]) => {
EquipmentDefinitions_PresetsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
Object.entries(message.equipments).forEach(([key, value]) => {
EquipmentDefinitions_EquipmentsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentDefinitions();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = EquipmentDefinitions_PresetsEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.presets[entry1.key] = entry1.value;
}
continue;
}
case 2: {
if (tag !== 18) {
break;
}
const entry2 = EquipmentDefinitions_EquipmentsEntry.decode(reader, reader.uint32());
if (entry2.value !== undefined) {
message.equipments[entry2.key] = entry2.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentDefinitions {
return {
presets: isObject(object.presets)
? Object.entries(object.presets).reduce<{ [key: string]: EquipmentPreset }>((acc, [key, value]) => {
acc[key] = EquipmentPreset.fromJSON(value);
return acc;
}, {})
: {},
equipments: isObject(object.equipments)
? Object.entries(object.equipments).reduce<{ [key: number]: Equipment }>((acc, [key, value]) => {
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: EquipmentDefinitions): unknown {
const obj: any = {};
if (message.presets) {
const entries = Object.entries(message.presets);
if (entries.length > 0) {
obj.presets = {};
entries.forEach(([k, v]) => {
obj.presets[k] = EquipmentPreset.toJSON(v);
});
}
}
if (message.equipments) {
const entries = Object.entries(message.equipments);
if (entries.length > 0) {
obj.equipments = {};
entries.forEach(([k, v]) => {
obj.equipments[k] = Equipment.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(base?: I): EquipmentDefinitions {
return EquipmentDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(object: I): EquipmentDefinitions {
const message = createBaseEquipmentDefinitions();
message.presets = Object.entries(object.presets ?? {}).reduce<{ [key: string]: EquipmentPreset }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[key] = EquipmentPreset.fromPartial(value);
}
return acc;
},
{},
);
message.equipments = Object.entries(object.equipments ?? {}).reduce<{ [key: number]: Equipment }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = Equipment.fromPartial(value);
}
return acc;
},
{},
);
return message;
},
};
function createBaseEquipmentDefinitions_PresetsEntry(): EquipmentDefinitions_PresetsEntry {
return { key: "", value: createBaseEquipmentPreset() };
}
export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_PresetsEntry> = {
encode(message: EquipmentDefinitions_PresetsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
EquipmentPreset.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions_PresetsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentDefinitions_PresetsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = EquipmentPreset.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentDefinitions_PresetsEntry {
return {
key: globalThis.String(assertSet("EquipmentDefinitions_PresetsEntry.key", object.key)),
value: EquipmentPreset.fromJSON(assertSet("EquipmentDefinitions_PresetsEntry.value", object.value)),
};
},
toJSON(message: EquipmentDefinitions_PresetsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = EquipmentPreset.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>>(
base?: I,
): EquipmentDefinitions_PresetsEntry {
return EquipmentDefinitions_PresetsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>>(
object: I,
): EquipmentDefinitions_PresetsEntry {
const message = createBaseEquipmentDefinitions_PresetsEntry();
message.key = object.key ?? "";
message.value = (object.value !== undefined && object.value !== null)
? EquipmentPreset.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseEquipmentDefinitions_EquipmentsEntry(): EquipmentDefinitions_EquipmentsEntry {
return { key: 0, value: createBaseEquipment() };
}
export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitions_EquipmentsEntry> = {
encode(message: EquipmentDefinitions_EquipmentsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
Equipment.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentDefinitions_EquipmentsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Equipment.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentDefinitions_EquipmentsEntry {
return {
key: globalThis.Number(assertSet("EquipmentDefinitions_EquipmentsEntry.key", object.key)),
value: Equipment.fromJSON(assertSet("EquipmentDefinitions_EquipmentsEntry.value", object.value)),
};
},
toJSON(message: EquipmentDefinitions_EquipmentsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = Equipment.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>>(
base?: I,
): EquipmentDefinitions_EquipmentsEntry {
return EquipmentDefinitions_EquipmentsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>>(
object: I,
): EquipmentDefinitions_EquipmentsEntry {
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
message.key = object.key ?? 0;
message.value = (object.value !== undefined && object.value !== null)
? Equipment.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseEquipment(): Equipment {
return { name: createBaseI18nString(), description: createBaseI18nString() };
}
export const Equipment: MessageFns<Equipment> = {
encode(message: Equipment, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(10).fork()).join();
}
if (message.description !== undefined) {
I18nString.encode(message.description, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Equipment {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipment();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.name = I18nString.decode(reader, reader.uint32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.description = I18nString.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Equipment {
return {
name: I18nString.fromJSON(assertSet("Equipment.name", object.name)),
description: I18nString.fromJSON(assertSet("Equipment.description", object.description)),
};
},
toJSON(message: Equipment): unknown {
const obj: any = {};
if (message.name !== undefined) {
obj.name = I18nString.toJSON(message.name);
}
if (message.description !== undefined) {
obj.description = I18nString.toJSON(message.description);
}
return obj;
},
create<I extends Exact<DeepPartial<Equipment>, I>>(base?: I): Equipment {
return Equipment.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Equipment>, I>>(object: I): Equipment {
const message = createBaseEquipment();
message.name = (object.name !== undefined && object.name !== null)
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.description = (object.description !== undefined && object.description !== null)
? I18nString.fromPartial(object.description)
: createBaseI18nString();
return message;
},
};
function createBaseEquipmentPreset(): EquipmentPreset {
return { slots: [] };
}
export const EquipmentPreset: MessageFns<EquipmentPreset> = {
encode(message: EquipmentPreset, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.slots) {
EquipmentSlot.encode(v!, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentPreset {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentPreset();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.slots.push(EquipmentSlot.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentPreset {
return {
slots: globalThis.Array.isArray(object?.slots) ? object.slots.map((e: any) => EquipmentSlot.fromJSON(e)) : [],
};
},
toJSON(message: EquipmentPreset): unknown {
const obj: any = {};
if (message.slots?.length) {
obj.slots = message.slots.map((e) => EquipmentSlot.toJSON(e));
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentPreset>, I>>(base?: I): EquipmentPreset {
return EquipmentPreset.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentPreset>, I>>(object: I): EquipmentPreset {
const message = createBaseEquipmentPreset();
message.slots = object.slots?.map((e) => EquipmentSlot.fromPartial(e)) || [];
return message;
},
};
function createBaseEquipmentSlot(): EquipmentSlot {
return { left: 0, right: 0 };
}
export const EquipmentSlot: MessageFns<EquipmentSlot> = {
encode(message: EquipmentSlot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.left !== 0) {
writer.uint32(8).uint32(message.left);
}
if (message.right !== 0) {
writer.uint32(16).uint32(message.right);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentSlot {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentSlot();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.left = reader.uint32();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.right = reader.uint32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentSlot {
return {
left: globalThis.Number(assertSet("EquipmentSlot.left", object.left)),
right: globalThis.Number(assertSet("EquipmentSlot.right", object.right)),
};
},
toJSON(message: EquipmentSlot): unknown {
const obj: any = {};
if (message.left !== 0) {
obj.left = Math.round(message.left);
}
if (message.right !== 0) {
obj.right = Math.round(message.right);
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentSlot>, I>>(base?: I): EquipmentSlot {
return EquipmentSlot.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentSlot>, I>>(object: I): EquipmentSlot {
const message = createBaseEquipmentSlot();
message.left = object.left ?? 0;
message.right = object.right ?? 0;
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
+18 -12
View File
@@ -1,14 +1,20 @@
// @ts-nocheck
export * from './average_definitions.ts';
export * from './camouflage_definitions.ts';
export * from './consumable_definitions.ts';
export * from './equipment_definitions.ts';
export * from './game_definitions.ts';
export * from './i18n.ts';
export * from './map_definitions.ts';
export * from './model_definitions.ts';
export * from './provision_definitions.ts';
export * from './rating_leaderboard.ts';
export * from './legacy_average_definitions.ts';
export * from './legacy_camouflage_definitions.ts';
export * from './legacy_consumable_definitions.ts';
export * from './legacy_equipment_definitions.ts';
export * from './legacy_game_definitions.ts';
export * from './legacy_i18n.ts';
export * from './legacy_map_definitions.ts';
export * from './legacy_model_definitions.ts';
export * from './legacy_provision_definitions.ts';
export * from './legacy_rating_leaderboard.ts';
export * from './legacy_skill_definitions.ts';
export * from './legacy_tank_definitions.ts';
export * from './reviews.ts';
export * from './skill_definitions.ts';
export * from './tank_definitions.ts';
export * from './tank.ts';
export * from './tank_armor.ts';
export * from './tank_model.ts';
export * from './tanks.ts';
export * from './tanks_full.ts';
export * from './utils.ts';
@@ -2,7 +2,7 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/average_definitions.proto
// source: packages/core/src/protos/legacy_average_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
@@ -2,7 +2,7 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/i18n.proto";
import "packages/core/src/protos/legacy_i18n.proto";
message CamouflageDefinitions {
map<uint32, Camouflage> camouflages = 1;
@@ -0,0 +1,415 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/legacy_camouflage_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
import { I18nString, createBaseI18nString } from './legacy_i18n';
export const protobufPackage = 'blitzkit';
export interface CamouflageDefinitions {
camouflages: { [key: number]: Camouflage };
}
export interface CamouflageDefinitions_CamouflagesEntry {
key: number;
value: Camouflage | undefined;
}
export interface Camouflage {
id: number;
name: I18nString;
tank_name?: I18nString | undefined;
tank_name_full?: I18nString | undefined;
}
function createBaseCamouflageDefinitions(): CamouflageDefinitions {
return { camouflages: {} };
}
export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
encode(
message: CamouflageDefinitions,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
Object.entries(message.camouflages).forEach(([key, value]) => {
CamouflageDefinitions_CamouflagesEntry.encode(
{ key: key as any, value },
writer.uint32(10).fork(),
).join();
});
return writer;
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): CamouflageDefinitions {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCamouflageDefinitions();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = CamouflageDefinitions_CamouflagesEntry.decode(
reader,
reader.uint32(),
);
if (entry1.value !== undefined) {
message.camouflages[entry1.key] = entry1.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): CamouflageDefinitions {
return {
camouflages: isObject(object.camouflages)
? Object.entries(object.camouflages).reduce<{
[key: number]: Camouflage;
}>((acc, [key, value]) => {
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: CamouflageDefinitions): unknown {
const obj: any = {};
if (message.camouflages) {
const entries = Object.entries(message.camouflages);
if (entries.length > 0) {
obj.camouflages = {};
entries.forEach(([k, v]) => {
obj.camouflages[k] = Camouflage.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(
base?: I,
): CamouflageDefinitions {
return CamouflageDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(
object: I,
): CamouflageDefinitions {
const message = createBaseCamouflageDefinitions();
message.camouflages = Object.entries(object.camouflages ?? {}).reduce<{
[key: number]: Camouflage;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
}
return acc;
}, {});
return message;
},
};
function createBaseCamouflageDefinitions_CamouflagesEntry(): CamouflageDefinitions_CamouflagesEntry {
return { key: 0, value: createBaseCamouflage() };
}
export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefinitions_CamouflagesEntry> =
{
encode(
message: CamouflageDefinitions_CamouflagesEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
Camouflage.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): CamouflageDefinitions_CamouflagesEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Camouflage.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
return {
key: globalThis.Number(
assertSet('CamouflageDefinitions_CamouflagesEntry.key', object.key),
),
value: Camouflage.fromJSON(
assertSet(
'CamouflageDefinitions_CamouflagesEntry.value',
object.value,
),
),
};
},
toJSON(message: CamouflageDefinitions_CamouflagesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = Camouflage.toJSON(message.value);
}
return obj;
},
create<
I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>,
>(base?: I): CamouflageDefinitions_CamouflagesEntry {
return CamouflageDefinitions_CamouflagesEntry.fromPartial(
base ?? ({} as any),
);
},
fromPartial<
I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>,
>(object: I): CamouflageDefinitions_CamouflagesEntry {
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
message.key = object.key ?? 0;
message.value =
object.value !== undefined && object.value !== null
? Camouflage.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseCamouflage(): Camouflage {
return {
id: 0,
name: createBaseI18nString(),
tank_name: undefined,
tank_name_full: undefined,
};
}
export const Camouflage: MessageFns<Camouflage> = {
encode(
message: Camouflage,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).uint32(message.id);
}
if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(18).fork()).join();
}
if (message.tank_name !== undefined) {
I18nString.encode(message.tank_name, writer.uint32(26).fork()).join();
}
if (message.tank_name_full !== undefined) {
I18nString.encode(
message.tank_name_full,
writer.uint32(34).fork(),
).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Camouflage {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCamouflage();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.id = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.name = I18nString.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.tank_name = I18nString.decode(reader, reader.uint32());
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.tank_name_full = I18nString.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Camouflage {
return {
id: globalThis.Number(assertSet('Camouflage.id', object.id)),
name: I18nString.fromJSON(assertSet('Camouflage.name', object.name)),
tank_name: isSet(object.tank_name)
? I18nString.fromJSON(object.tank_name)
: undefined,
tank_name_full: isSet(object.tank_name_full)
? I18nString.fromJSON(object.tank_name_full)
: undefined,
};
},
toJSON(message: Camouflage): unknown {
const obj: any = {};
if (message.id !== 0) {
obj.id = Math.round(message.id);
}
if (message.name !== undefined) {
obj.name = I18nString.toJSON(message.name);
}
if (message.tank_name !== undefined) {
obj.tank_name = I18nString.toJSON(message.tank_name);
}
if (message.tank_name_full !== undefined) {
obj.tank_name_full = I18nString.toJSON(message.tank_name_full);
}
return obj;
},
create<I extends Exact<DeepPartial<Camouflage>, I>>(base?: I): Camouflage {
return Camouflage.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Camouflage>, I>>(
object: I,
): Camouflage {
const message = createBaseCamouflage();
message.id = object.id ?? 0;
message.name =
object.name !== undefined && object.name !== null
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.tank_name =
object.tank_name !== undefined && object.tank_name !== null
? I18nString.fromPartial(object.tank_name)
: undefined;
message.tank_name_full =
object.tank_name_full !== undefined && object.tank_name_full !== null
? I18nString.fromPartial(object.tank_name_full)
: undefined;
return message;
},
};
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin
? T
: T extends globalThis.Array<infer U>
? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U>
? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown }
? { $case: T['$case']; value?: DeepPartial<T['value']> }
: T extends {}
? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin
? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isObject(value: any): boolean {
return typeof value === 'object' && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
@@ -2,7 +2,7 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/i18n.proto";
import "packages/core/src/protos/legacy_i18n.proto";
message ConsumableDefinitions {
map<uint32, Consumable> consumables = 1;
File diff suppressed because it is too large. Load diff
@@ -2,7 +2,7 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/i18n.proto";
import "packages/core/src/protos/legacy_i18n.proto";
message EquipmentDefinitions {
map<string, EquipmentPreset> presets = 1;
@@ -0,0 +1,675 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/legacy_equipment_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
import { I18nString, createBaseI18nString } from './legacy_i18n';
export const protobufPackage = 'blitzkit';
export interface EquipmentDefinitions {
presets: { [key: string]: EquipmentPreset };
equipments: { [key: number]: Equipment };
}
export interface EquipmentDefinitions_PresetsEntry {
key: string;
value: EquipmentPreset | undefined;
}
export interface EquipmentDefinitions_EquipmentsEntry {
key: number;
value: Equipment | undefined;
}
export interface Equipment {
name: I18nString;
description: I18nString;
}
export interface EquipmentPreset {
slots: EquipmentSlot[];
}
export interface EquipmentSlot {
left: number;
right: number;
}
function createBaseEquipmentDefinitions(): EquipmentDefinitions {
return { presets: {}, equipments: {} };
}
export const EquipmentDefinitions: MessageFns<EquipmentDefinitions> = {
encode(
message: EquipmentDefinitions,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
Object.entries(message.presets).forEach(([key, value]) => {
EquipmentDefinitions_PresetsEntry.encode(
{ key: key as any, value },
writer.uint32(10).fork(),
).join();
});
Object.entries(message.equipments).forEach(([key, value]) => {
EquipmentDefinitions_EquipmentsEntry.encode(
{ key: key as any, value },
writer.uint32(18).fork(),
).join();
});
return writer;
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): EquipmentDefinitions {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentDefinitions();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = EquipmentDefinitions_PresetsEntry.decode(
reader,
reader.uint32(),
);
if (entry1.value !== undefined) {
message.presets[entry1.key] = entry1.value;
}
continue;
}
case 2: {
if (tag !== 18) {
break;
}
const entry2 = EquipmentDefinitions_EquipmentsEntry.decode(
reader,
reader.uint32(),
);
if (entry2.value !== undefined) {
message.equipments[entry2.key] = entry2.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentDefinitions {
return {
presets: isObject(object.presets)
? Object.entries(object.presets).reduce<{
[key: string]: EquipmentPreset;
}>((acc, [key, value]) => {
acc[key] = EquipmentPreset.fromJSON(value);
return acc;
}, {})
: {},
equipments: isObject(object.equipments)
? Object.entries(object.equipments).reduce<{
[key: number]: Equipment;
}>((acc, [key, value]) => {
acc[globalThis.Number(key)] = Equipment.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: EquipmentDefinitions): unknown {
const obj: any = {};
if (message.presets) {
const entries = Object.entries(message.presets);
if (entries.length > 0) {
obj.presets = {};
entries.forEach(([k, v]) => {
obj.presets[k] = EquipmentPreset.toJSON(v);
});
}
}
if (message.equipments) {
const entries = Object.entries(message.equipments);
if (entries.length > 0) {
obj.equipments = {};
entries.forEach(([k, v]) => {
obj.equipments[k] = Equipment.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(
base?: I,
): EquipmentDefinitions {
return EquipmentDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentDefinitions>, I>>(
object: I,
): EquipmentDefinitions {
const message = createBaseEquipmentDefinitions();
message.presets = Object.entries(object.presets ?? {}).reduce<{
[key: string]: EquipmentPreset;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[key] = EquipmentPreset.fromPartial(value);
}
return acc;
}, {});
message.equipments = Object.entries(object.equipments ?? {}).reduce<{
[key: number]: Equipment;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = Equipment.fromPartial(value);
}
return acc;
}, {});
return message;
},
};
function createBaseEquipmentDefinitions_PresetsEntry(): EquipmentDefinitions_PresetsEntry {
return { key: '', value: createBaseEquipmentPreset() };
}
export const EquipmentDefinitions_PresetsEntry: MessageFns<EquipmentDefinitions_PresetsEntry> =
{
encode(
message: EquipmentDefinitions_PresetsEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
EquipmentPreset.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): EquipmentDefinitions_PresetsEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentDefinitions_PresetsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = EquipmentPreset.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentDefinitions_PresetsEntry {
return {
key: globalThis.String(
assertSet('EquipmentDefinitions_PresetsEntry.key', object.key),
),
value: EquipmentPreset.fromJSON(
assertSet('EquipmentDefinitions_PresetsEntry.value', object.value),
),
};
},
toJSON(message: EquipmentDefinitions_PresetsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = EquipmentPreset.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>>(
base?: I,
): EquipmentDefinitions_PresetsEntry {
return EquipmentDefinitions_PresetsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<
I extends Exact<DeepPartial<EquipmentDefinitions_PresetsEntry>, I>,
>(object: I): EquipmentDefinitions_PresetsEntry {
const message = createBaseEquipmentDefinitions_PresetsEntry();
message.key = object.key ?? '';
message.value =
object.value !== undefined && object.value !== null
? EquipmentPreset.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseEquipmentDefinitions_EquipmentsEntry(): EquipmentDefinitions_EquipmentsEntry {
return { key: 0, value: createBaseEquipment() };
}
export const EquipmentDefinitions_EquipmentsEntry: MessageFns<EquipmentDefinitions_EquipmentsEntry> =
{
encode(
message: EquipmentDefinitions_EquipmentsEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
Equipment.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): EquipmentDefinitions_EquipmentsEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Equipment.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentDefinitions_EquipmentsEntry {
return {
key: globalThis.Number(
assertSet('EquipmentDefinitions_EquipmentsEntry.key', object.key),
),
value: Equipment.fromJSON(
assertSet('EquipmentDefinitions_EquipmentsEntry.value', object.value),
),
};
},
toJSON(message: EquipmentDefinitions_EquipmentsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = Equipment.toJSON(message.value);
}
return obj;
},
create<
I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>,
>(base?: I): EquipmentDefinitions_EquipmentsEntry {
return EquipmentDefinitions_EquipmentsEntry.fromPartial(
base ?? ({} as any),
);
},
fromPartial<
I extends Exact<DeepPartial<EquipmentDefinitions_EquipmentsEntry>, I>,
>(object: I): EquipmentDefinitions_EquipmentsEntry {
const message = createBaseEquipmentDefinitions_EquipmentsEntry();
message.key = object.key ?? 0;
message.value =
object.value !== undefined && object.value !== null
? Equipment.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseEquipment(): Equipment {
return { name: createBaseI18nString(), description: createBaseI18nString() };
}
export const Equipment: MessageFns<Equipment> = {
encode(
message: Equipment,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(10).fork()).join();
}
if (message.description !== undefined) {
I18nString.encode(message.description, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Equipment {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipment();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.name = I18nString.decode(reader, reader.uint32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.description = I18nString.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Equipment {
return {
name: I18nString.fromJSON(assertSet('Equipment.name', object.name)),
description: I18nString.fromJSON(
assertSet('Equipment.description', object.description),
),
};
},
toJSON(message: Equipment): unknown {
const obj: any = {};
if (message.name !== undefined) {
obj.name = I18nString.toJSON(message.name);
}
if (message.description !== undefined) {
obj.description = I18nString.toJSON(message.description);
}
return obj;
},
create<I extends Exact<DeepPartial<Equipment>, I>>(base?: I): Equipment {
return Equipment.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Equipment>, I>>(
object: I,
): Equipment {
const message = createBaseEquipment();
message.name =
object.name !== undefined && object.name !== null
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.description =
object.description !== undefined && object.description !== null
? I18nString.fromPartial(object.description)
: createBaseI18nString();
return message;
},
};
function createBaseEquipmentPreset(): EquipmentPreset {
return { slots: [] };
}
export const EquipmentPreset: MessageFns<EquipmentPreset> = {
encode(
message: EquipmentPreset,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
for (const v of message.slots) {
EquipmentSlot.encode(v!, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentPreset {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentPreset();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.slots.push(EquipmentSlot.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentPreset {
return {
slots: globalThis.Array.isArray(object?.slots)
? object.slots.map((e: any) => EquipmentSlot.fromJSON(e))
: [],
};
},
toJSON(message: EquipmentPreset): unknown {
const obj: any = {};
if (message.slots?.length) {
obj.slots = message.slots.map((e) => EquipmentSlot.toJSON(e));
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentPreset>, I>>(
base?: I,
): EquipmentPreset {
return EquipmentPreset.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentPreset>, I>>(
object: I,
): EquipmentPreset {
const message = createBaseEquipmentPreset();
message.slots =
object.slots?.map((e) => EquipmentSlot.fromPartial(e)) || [];
return message;
},
};
function createBaseEquipmentSlot(): EquipmentSlot {
return { left: 0, right: 0 };
}
export const EquipmentSlot: MessageFns<EquipmentSlot> = {
encode(
message: EquipmentSlot,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.left !== 0) {
writer.uint32(8).uint32(message.left);
}
if (message.right !== 0) {
writer.uint32(16).uint32(message.right);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): EquipmentSlot {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEquipmentSlot();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.left = reader.uint32();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.right = reader.uint32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): EquipmentSlot {
return {
left: globalThis.Number(assertSet('EquipmentSlot.left', object.left)),
right: globalThis.Number(assertSet('EquipmentSlot.right', object.right)),
};
},
toJSON(message: EquipmentSlot): unknown {
const obj: any = {};
if (message.left !== 0) {
obj.left = Math.round(message.left);
}
if (message.right !== 0) {
obj.right = Math.round(message.right);
}
return obj;
},
create<I extends Exact<DeepPartial<EquipmentSlot>, I>>(
base?: I,
): EquipmentSlot {
return EquipmentSlot.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EquipmentSlot>, I>>(
object: I,
): EquipmentSlot {
const message = createBaseEquipmentSlot();
message.left = object.left ?? 0;
message.right = object.right ?? 0;
return message;
},
};
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin
? T
: T extends globalThis.Array<infer U>
? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U>
? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown }
? { $case: T['$case']; value?: DeepPartial<T['value']> }
: T extends {}
? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin
? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isObject(value: any): boolean {
return typeof value === 'object' && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
@@ -2,7 +2,7 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/i18n.proto";
import "packages/core/src/protos/legacy_i18n.proto";
message GameDefinitions {
required string version = 1;
@@ -2,13 +2,13 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/game_definitions.proto
// source: packages/core/src/protos/legacy_game_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { I18nString, createBaseI18nString } from "./i18n";
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
import { I18nString, createBaseI18nString } from './legacy_i18n';
export const protobufPackage = "blitzkit";
export const protobufPackage = 'blitzkit';
export interface GameDefinitions {
version: string;
@@ -37,28 +37,38 @@ export interface GameModeRole {
}
function createBaseGameDefinitions(): GameDefinitions {
return { version: "", nations: [], gameModes: {}, roles: {} };
return { version: '', nations: [], gameModes: {}, roles: {} };
}
export const GameDefinitions: MessageFns<GameDefinitions> = {
encode(message: GameDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.version !== "") {
encode(
message: GameDefinitions,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.version !== '') {
writer.uint32(10).string(message.version);
}
for (const v of message.nations) {
writer.uint32(18).string(v!);
}
Object.entries(message.gameModes).forEach(([key, value]) => {
GameDefinitions_GameModesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join();
GameDefinitions_GameModesEntry.encode(
{ key: key as any, value },
writer.uint32(26).fork(),
).join();
});
Object.entries(message.roles).forEach(([key, value]) => {
GameDefinitions_RolesEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
GameDefinitions_RolesEntry.encode(
{ key: key as any, value },
writer.uint32(34).fork(),
).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameDefinitions();
while (reader.pos < end) {
@@ -85,7 +95,10 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
break;
}
const entry3 = GameDefinitions_GameModesEntry.decode(reader, reader.uint32());
const entry3 = GameDefinitions_GameModesEntry.decode(
reader,
reader.uint32(),
);
if (entry3.value !== undefined) {
message.gameModes[entry3.key] = entry3.value;
}
@@ -96,7 +109,10 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
break;
}
const entry4 = GameDefinitions_RolesEntry.decode(reader, reader.uint32());
const entry4 = GameDefinitions_RolesEntry.decode(
reader,
reader.uint32(),
);
if (entry4.value !== undefined) {
message.roles[entry4.key] = entry4.value;
}
@@ -113,26 +129,36 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
fromJSON(object: any): GameDefinitions {
return {
version: globalThis.String(assertSet("GameDefinitions.version", object.version)),
nations: globalThis.Array.isArray(object?.nations) ? object.nations.map((e: any) => globalThis.String(e)) : [],
version: globalThis.String(
assertSet('GameDefinitions.version', object.version),
),
nations: globalThis.Array.isArray(object?.nations)
? object.nations.map((e: any) => globalThis.String(e))
: [],
gameModes: isObject(object.gameModes)
? Object.entries(object.gameModes).reduce<{ [key: number]: GameMode }>((acc, [key, value]) => {
acc[globalThis.Number(key)] = GameMode.fromJSON(value);
return acc;
}, {})
? Object.entries(object.gameModes).reduce<{ [key: number]: GameMode }>(
(acc, [key, value]) => {
acc[globalThis.Number(key)] = GameMode.fromJSON(value);
return acc;
},
{},
)
: {},
roles: isObject(object.roles)
? Object.entries(object.roles).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => {
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
return acc;
}, {})
? Object.entries(object.roles).reduce<{ [key: number]: GameModeRole }>(
(acc, [key, value]) => {
acc[globalThis.Number(key)] = GameModeRole.fromJSON(value);
return acc;
},
{},
)
: {},
};
},
toJSON(message: GameDefinitions): unknown {
const obj: any = {};
if (message.version !== "") {
if (message.version !== '') {
obj.version = message.version;
}
if (message.nations?.length) {
@@ -159,23 +185,28 @@ export const GameDefinitions: MessageFns<GameDefinitions> = {
return obj;
},
create<I extends Exact<DeepPartial<GameDefinitions>, I>>(base?: I): GameDefinitions {
create<I extends Exact<DeepPartial<GameDefinitions>, I>>(
base?: I,
): GameDefinitions {
return GameDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<GameDefinitions>, I>>(object: I): GameDefinitions {
fromPartial<I extends Exact<DeepPartial<GameDefinitions>, I>>(
object: I,
): GameDefinitions {
const message = createBaseGameDefinitions();
message.version = object.version ?? "";
message.version = object.version ?? '';
message.nations = object.nations?.map((e) => e) || [];
message.gameModes = Object.entries(object.gameModes ?? {}).reduce<{ [key: number]: GameMode }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = GameMode.fromPartial(value);
}
return acc;
},
{},
);
message.roles = Object.entries(object.roles ?? {}).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => {
message.gameModes = Object.entries(object.gameModes ?? {}).reduce<{
[key: number]: GameMode;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = GameMode.fromPartial(value);
}
return acc;
}, {});
message.roles = Object.entries(object.roles ?? {}).reduce<{
[key: number]: GameModeRole;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = GameModeRole.fromPartial(value);
}
@@ -189,166 +220,201 @@ function createBaseGameDefinitions_GameModesEntry(): GameDefinitions_GameModesEn
return { key: 0, value: createBaseGameMode() };
}
export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> = {
encode(message: GameDefinitions_GameModesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
GameMode.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_GameModesEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameDefinitions_GameModesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = GameMode.decode(reader, reader.uint32());
continue;
}
export const GameDefinitions_GameModesEntry: MessageFns<GameDefinitions_GameModesEntry> =
{
encode(
message: GameDefinitions_GameModesEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if ((tag & 7) === 4 || tag === 0) {
break;
if (message.value !== undefined) {
GameMode.encode(message.value, writer.uint32(18).fork()).join();
}
reader.skip(tag & 7);
}
return message;
},
return writer;
},
fromJSON(object: any): GameDefinitions_GameModesEntry {
return {
key: globalThis.Number(assertSet("GameDefinitions_GameModesEntry.key", object.key)),
value: GameMode.fromJSON(assertSet("GameDefinitions_GameModesEntry.value", object.value)),
};
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): GameDefinitions_GameModesEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameDefinitions_GameModesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
toJSON(message: GameDefinitions_GameModesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = GameMode.toJSON(message.value);
}
return obj;
},
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
create<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>(base?: I): GameDefinitions_GameModesEntry {
return GameDefinitions_GameModesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>(
object: I,
): GameDefinitions_GameModesEntry {
const message = createBaseGameDefinitions_GameModesEntry();
message.key = object.key ?? 0;
message.value = (object.value !== undefined && object.value !== null)
? GameMode.fromPartial(object.value)
: undefined;
return message;
},
};
message.value = GameMode.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): GameDefinitions_GameModesEntry {
return {
key: globalThis.Number(
assertSet('GameDefinitions_GameModesEntry.key', object.key),
),
value: GameMode.fromJSON(
assertSet('GameDefinitions_GameModesEntry.value', object.value),
),
};
},
toJSON(message: GameDefinitions_GameModesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = GameMode.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>>(
base?: I,
): GameDefinitions_GameModesEntry {
return GameDefinitions_GameModesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<
I extends Exact<DeepPartial<GameDefinitions_GameModesEntry>, I>,
>(object: I): GameDefinitions_GameModesEntry {
const message = createBaseGameDefinitions_GameModesEntry();
message.key = object.key ?? 0;
message.value =
object.value !== undefined && object.value !== null
? GameMode.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseGameDefinitions_RolesEntry(): GameDefinitions_RolesEntry {
return { key: 0, value: createBaseGameModeRole() };
}
export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry> = {
encode(message: GameDefinitions_RolesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
GameModeRole.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_RolesEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameDefinitions_RolesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = GameModeRole.decode(reader, reader.uint32());
continue;
}
export const GameDefinitions_RolesEntry: MessageFns<GameDefinitions_RolesEntry> =
{
encode(
message: GameDefinitions_RolesEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if ((tag & 7) === 4 || tag === 0) {
break;
if (message.value !== undefined) {
GameModeRole.encode(message.value, writer.uint32(18).fork()).join();
}
reader.skip(tag & 7);
}
return message;
},
return writer;
},
fromJSON(object: any): GameDefinitions_RolesEntry {
return {
key: globalThis.Number(assertSet("GameDefinitions_RolesEntry.key", object.key)),
value: GameModeRole.fromJSON(assertSet("GameDefinitions_RolesEntry.value", object.value)),
};
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): GameDefinitions_RolesEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameDefinitions_RolesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
toJSON(message: GameDefinitions_RolesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = GameModeRole.toJSON(message.value);
}
return obj;
},
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
create<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(base?: I): GameDefinitions_RolesEntry {
return GameDefinitions_RolesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(object: I): GameDefinitions_RolesEntry {
const message = createBaseGameDefinitions_RolesEntry();
message.key = object.key ?? 0;
message.value = (object.value !== undefined && object.value !== null)
? GameModeRole.fromPartial(object.value)
: undefined;
return message;
},
};
message.value = GameModeRole.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): GameDefinitions_RolesEntry {
return {
key: globalThis.Number(
assertSet('GameDefinitions_RolesEntry.key', object.key),
),
value: GameModeRole.fromJSON(
assertSet('GameDefinitions_RolesEntry.value', object.value),
),
};
},
toJSON(message: GameDefinitions_RolesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = GameModeRole.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(
base?: I,
): GameDefinitions_RolesEntry {
return GameDefinitions_RolesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<GameDefinitions_RolesEntry>, I>>(
object: I,
): GameDefinitions_RolesEntry {
const message = createBaseGameDefinitions_RolesEntry();
message.key = object.key ?? 0;
message.value =
object.value !== undefined && object.value !== null
? GameModeRole.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseGameMode(): GameMode {
return { name: createBaseI18nString() };
}
export const GameMode: MessageFns<GameMode> = {
encode(message: GameMode, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode(
message: GameMode,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.name !== undefined) {
I18nString.encode(message.name, writer.uint32(10).fork()).join();
}
@@ -356,7 +422,8 @@ export const GameMode: MessageFns<GameMode> = {
},
decode(input: BinaryReader | Uint8Array, length?: number): GameMode {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameMode();
while (reader.pos < end) {
@@ -380,7 +447,9 @@ export const GameMode: MessageFns<GameMode> = {
},
fromJSON(object: any): GameMode {
return { name: I18nString.fromJSON(assertSet("GameMode.name", object.name)) };
return {
name: I18nString.fromJSON(assertSet('GameMode.name', object.name)),
};
},
toJSON(message: GameMode): unknown {
@@ -396,9 +465,10 @@ export const GameMode: MessageFns<GameMode> = {
},
fromPartial<I extends Exact<DeepPartial<GameMode>, I>>(object: I): GameMode {
const message = createBaseGameMode();
message.name = (object.name !== undefined && object.name !== null)
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.name =
object.name !== undefined && object.name !== null
? I18nString.fromPartial(object.name)
: createBaseI18nString();
return message;
},
};
@@ -408,7 +478,10 @@ function createBaseGameModeRole(): GameModeRole {
}
export const GameModeRole: MessageFns<GameModeRole> = {
encode(message: GameModeRole, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode(
message: GameModeRole,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
writer.uint32(10).fork();
for (const v of message.provisions) {
writer.uint32(v);
@@ -423,7 +496,8 @@ export const GameModeRole: MessageFns<GameModeRole> = {
},
decode(input: BinaryReader | Uint8Array, length?: number): GameModeRole {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGameModeRole();
while (reader.pos < end) {
@@ -496,10 +570,14 @@ export const GameModeRole: MessageFns<GameModeRole> = {
return obj;
},
create<I extends Exact<DeepPartial<GameModeRole>, I>>(base?: I): GameModeRole {
create<I extends Exact<DeepPartial<GameModeRole>, I>>(
base?: I,
): GameModeRole {
return GameModeRole.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<GameModeRole>, I>>(object: I): GameModeRole {
fromPartial<I extends Exact<DeepPartial<GameModeRole>, I>>(
object: I,
): GameModeRole {
const message = createBaseGameModeRole();
message.provisions = object.provisions?.map((e) => e) || [];
message.consumables = object.consumables?.map((e) => e) || [];
@@ -507,21 +585,36 @@ export const GameModeRole: MessageFns<GameModeRole> = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export type DeepPartial<T> = T extends Builtin
? T
: T extends globalThis.Array<infer U>
? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U>
? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown }
? { $case: T['$case']; value?: DeepPartial<T['value']> }
: T extends {}
? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
export type Exact<P, I extends P> = P extends Builtin
? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
return typeof value === 'object' && value !== null;
}
function isSet(value: any): boolean {
@@ -2,7 +2,7 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/i18n.proto
// source: packages/core/src/protos/legacy_i18n.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
@@ -2,7 +2,7 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/i18n.proto";
import "packages/core/src/protos/legacy_i18n.proto";
message MapDefinitions {
map<int32, MapDefinition> maps = 1;
@@ -2,13 +2,13 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/map_definitions.proto
// source: packages/core/src/protos/legacy_map_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { I18nString, createBaseI18nString } from "./i18n";
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
import { I18nString, createBaseI18nString } from './legacy_i18n';
export const protobufPackage = "blitzkit";
export const protobufPackage = 'blitzkit';
export interface MapDefinitions {
maps: { [key: number]: MapDefinition };
@@ -29,15 +29,22 @@ function createBaseMapDefinitions(): MapDefinitions {
}
export const MapDefinitions: MessageFns<MapDefinitions> = {
encode(message: MapDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode(
message: MapDefinitions,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
Object.entries(message.maps).forEach(([key, value]) => {
MapDefinitions_MapsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
MapDefinitions_MapsEntry.encode(
{ key: key as any, value },
writer.uint32(10).fork(),
).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinitions {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMapDefinitions();
while (reader.pos < end) {
@@ -48,7 +55,10 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
break;
}
const entry1 = MapDefinitions_MapsEntry.decode(reader, reader.uint32());
const entry1 = MapDefinitions_MapsEntry.decode(
reader,
reader.uint32(),
);
if (entry1.value !== undefined) {
message.maps[entry1.key] = entry1.value;
}
@@ -66,10 +76,13 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
fromJSON(object: any): MapDefinitions {
return {
maps: isObject(object.maps)
? Object.entries(object.maps).reduce<{ [key: number]: MapDefinition }>((acc, [key, value]) => {
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
return acc;
}, {})
? Object.entries(object.maps).reduce<{ [key: number]: MapDefinition }>(
(acc, [key, value]) => {
acc[globalThis.Number(key)] = MapDefinition.fromJSON(value);
return acc;
},
{},
)
: {},
};
},
@@ -88,12 +101,18 @@ export const MapDefinitions: MessageFns<MapDefinitions> = {
return obj;
},
create<I extends Exact<DeepPartial<MapDefinitions>, I>>(base?: I): MapDefinitions {
create<I extends Exact<DeepPartial<MapDefinitions>, I>>(
base?: I,
): MapDefinitions {
return MapDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<MapDefinitions>, I>>(object: I): MapDefinitions {
fromPartial<I extends Exact<DeepPartial<MapDefinitions>, I>>(
object: I,
): MapDefinitions {
const message = createBaseMapDefinitions();
message.maps = Object.entries(object.maps ?? {}).reduce<{ [key: number]: MapDefinition }>((acc, [key, value]) => {
message.maps = Object.entries(object.maps ?? {}).reduce<{
[key: number]: MapDefinition;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = MapDefinition.fromPartial(value);
}
@@ -108,7 +127,10 @@ function createBaseMapDefinitions_MapsEntry(): MapDefinitions_MapsEntry {
}
export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
encode(message: MapDefinitions_MapsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode(
message: MapDefinitions_MapsEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).int32(message.key);
}
@@ -118,8 +140,12 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinitions_MapsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
decode(
input: BinaryReader | Uint8Array,
length?: number,
): MapDefinitions_MapsEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMapDefinitions_MapsEntry();
while (reader.pos < end) {
@@ -152,8 +178,12 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
fromJSON(object: any): MapDefinitions_MapsEntry {
return {
key: globalThis.Number(assertSet("MapDefinitions_MapsEntry.key", object.key)),
value: MapDefinition.fromJSON(assertSet("MapDefinitions_MapsEntry.value", object.value)),
key: globalThis.Number(
assertSet('MapDefinitions_MapsEntry.key', object.key),
),
value: MapDefinition.fromJSON(
assertSet('MapDefinitions_MapsEntry.value', object.value),
),
};
},
@@ -168,15 +198,20 @@ export const MapDefinitions_MapsEntry: MessageFns<MapDefinitions_MapsEntry> = {
return obj;
},
create<I extends Exact<DeepPartial<MapDefinitions_MapsEntry>, I>>(base?: I): MapDefinitions_MapsEntry {
create<I extends Exact<DeepPartial<MapDefinitions_MapsEntry>, I>>(
base?: I,
): MapDefinitions_MapsEntry {
return MapDefinitions_MapsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<MapDefinitions_MapsEntry>, I>>(object: I): MapDefinitions_MapsEntry {
fromPartial<I extends Exact<DeepPartial<MapDefinitions_MapsEntry>, I>>(
object: I,
): MapDefinitions_MapsEntry {
const message = createBaseMapDefinitions_MapsEntry();
message.key = object.key ?? 0;
message.value = (object.value !== undefined && object.value !== null)
? MapDefinition.fromPartial(object.value)
: undefined;
message.value =
object.value !== undefined && object.value !== null
? MapDefinition.fromPartial(object.value)
: undefined;
return message;
},
};
@@ -186,7 +221,10 @@ function createBaseMapDefinition(): MapDefinition {
}
export const MapDefinition: MessageFns<MapDefinition> = {
encode(message: MapDefinition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode(
message: MapDefinition,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).uint32(message.id);
}
@@ -197,7 +235,8 @@ export const MapDefinition: MessageFns<MapDefinition> = {
},
decode(input: BinaryReader | Uint8Array, length?: number): MapDefinition {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMapDefinition();
while (reader.pos < end) {
@@ -230,8 +269,8 @@ export const MapDefinition: MessageFns<MapDefinition> = {
fromJSON(object: any): MapDefinition {
return {
id: globalThis.Number(assertSet("MapDefinition.id", object.id)),
name: I18nString.fromJSON(assertSet("MapDefinition.name", object.name)),
id: globalThis.Number(assertSet('MapDefinition.id', object.id)),
name: I18nString.fromJSON(assertSet('MapDefinition.name', object.name)),
};
},
@@ -246,34 +285,54 @@ export const MapDefinition: MessageFns<MapDefinition> = {
return obj;
},
create<I extends Exact<DeepPartial<MapDefinition>, I>>(base?: I): MapDefinition {
create<I extends Exact<DeepPartial<MapDefinition>, I>>(
base?: I,
): MapDefinition {
return MapDefinition.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<MapDefinition>, I>>(object: I): MapDefinition {
fromPartial<I extends Exact<DeepPartial<MapDefinition>, I>>(
object: I,
): MapDefinition {
const message = createBaseMapDefinition();
message.id = object.id ?? 0;
message.name = (object.name !== undefined && object.name !== null)
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.name =
object.name !== undefined && object.name !== null
? I18nString.fromPartial(object.name)
: createBaseI18nString();
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export type DeepPartial<T> = T extends Builtin
? T
: T extends globalThis.Array<infer U>
? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U>
? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown }
? { $case: T['$case']; value?: DeepPartial<T['value']> }
: T extends {}
? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
export type Exact<P, I extends P> = P extends Builtin
? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
return typeof value === 'object' && value !== null;
}
function isSet(value: any): boolean {
@@ -2,6 +2,8 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/utils.proto";
message ModelDefinitions {
map<uint32, ModelDefinition> models = 1;
}
@@ -20,12 +22,6 @@ message Armor {
repeated uint32 spaced = 2;
}
message Vector3 {
required float x = 1;
required float y = 2;
required float z = 3;
}
message InitialTurretRotation {
required float yaw = 1;
required float pitch = 2;
@@ -2,10 +2,11 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/model_definitions.proto
// source: packages/core/src/protos/legacy_model_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Vector3, createBaseVector3 } from "./utils";
export const protobufPackage = "blitzkit";
@@ -47,12 +48,6 @@ export interface Armor_ThicknessEntry {
value: number;
}
export interface Vector3 {
x: number;
y: number;
z: number;
}
export interface InitialTurretRotation {
yaw: number;
pitch: number;
@@ -814,98 +809,6 @@ export const Armor_ThicknessEntry: MessageFns<Armor_ThicknessEntry> = {
},
};
function createBaseVector3(): Vector3 {
return { x: 0, y: 0, z: 0 };
}
export const Vector3: MessageFns<Vector3> = {
encode(message: Vector3, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.x !== 0) {
writer.uint32(13).float(message.x);
}
if (message.y !== 0) {
writer.uint32(21).float(message.y);
}
if (message.z !== 0) {
writer.uint32(29).float(message.z);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Vector3 {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseVector3();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 13) {
break;
}
message.x = reader.float();
continue;
}
case 2: {
if (tag !== 21) {
break;
}
message.y = reader.float();
continue;
}
case 3: {
if (tag !== 29) {
break;
}
message.z = reader.float();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Vector3 {
return {
x: globalThis.Number(assertSet("Vector3.x", object.x)),
y: globalThis.Number(assertSet("Vector3.y", object.y)),
z: globalThis.Number(assertSet("Vector3.z", object.z)),
};
},
toJSON(message: Vector3): unknown {
const obj: any = {};
if (message.x !== 0) {
obj.x = message.x;
}
if (message.y !== 0) {
obj.y = message.y;
}
if (message.z !== 0) {
obj.z = message.z;
}
return obj;
},
create<I extends Exact<DeepPartial<Vector3>, I>>(base?: I): Vector3 {
return Vector3.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Vector3>, I>>(object: I): Vector3 {
const message = createBaseVector3();
message.x = object.x ?? 0;
message.y = object.y ?? 0;
message.z = object.z ?? 0;
return message;
},
};
function createBaseInitialTurretRotation(): InitialTurretRotation {
return { yaw: 0, pitch: 0, roll: 0 };
}
@@ -2,8 +2,8 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/consumable_definitions.proto";
import "packages/core/src/protos/i18n.proto";
import "packages/core/src/protos/legacy_consumable_definitions.proto";
import "packages/core/src/protos/legacy_i18n.proto";
message ProvisionDefinitions {
map<uint32, Provision> provisions = 1;
@@ -2,14 +2,14 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/provision_definitions.proto
// source: packages/core/src/protos/legacy_provision_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { ConsumableTankFilter } from "./consumable_definitions";
import { I18nString, createBaseI18nString } from "./i18n";
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
import { ConsumableTankFilter } from './legacy_consumable_definitions';
import { I18nString, createBaseI18nString } from './legacy_i18n';
export const protobufPackage = "blitzkit";
export const protobufPackage = 'blitzkit';
export interface ProvisionDefinitions {
provisions: { [key: number]: Provision };
@@ -34,15 +34,25 @@ function createBaseProvisionDefinitions(): ProvisionDefinitions {
}
export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
encode(message: ProvisionDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode(
message: ProvisionDefinitions,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
Object.entries(message.provisions).forEach(([key, value]) => {
ProvisionDefinitions_ProvisionsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
ProvisionDefinitions_ProvisionsEntry.encode(
{ key: key as any, value },
writer.uint32(10).fork(),
).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ProvisionDefinitions {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
decode(
input: BinaryReader | Uint8Array,
length?: number,
): ProvisionDefinitions {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseProvisionDefinitions();
while (reader.pos < end) {
@@ -53,7 +63,10 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
break;
}
const entry1 = ProvisionDefinitions_ProvisionsEntry.decode(reader, reader.uint32());
const entry1 = ProvisionDefinitions_ProvisionsEntry.decode(
reader,
reader.uint32(),
);
if (entry1.value !== undefined) {
message.provisions[entry1.key] = entry1.value;
}
@@ -71,10 +84,12 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
fromJSON(object: any): ProvisionDefinitions {
return {
provisions: isObject(object.provisions)
? Object.entries(object.provisions).reduce<{ [key: number]: Provision }>((acc, [key, value]) => {
acc[globalThis.Number(key)] = Provision.fromJSON(value);
return acc;
}, {})
? Object.entries(object.provisions).reduce<{
[key: number]: Provision;
}>((acc, [key, value]) => {
acc[globalThis.Number(key)] = Provision.fromJSON(value);
return acc;
}, {})
: {},
};
},
@@ -93,20 +108,23 @@ export const ProvisionDefinitions: MessageFns<ProvisionDefinitions> = {
return obj;
},
create<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(base?: I): ProvisionDefinitions {
create<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(
base?: I,
): ProvisionDefinitions {
return ProvisionDefinitions.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(object: I): ProvisionDefinitions {
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions>, I>>(
object: I,
): ProvisionDefinitions {
const message = createBaseProvisionDefinitions();
message.provisions = Object.entries(object.provisions ?? {}).reduce<{ [key: number]: Provision }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = Provision.fromPartial(value);
}
return acc;
},
{},
);
message.provisions = Object.entries(object.provisions ?? {}).reduce<{
[key: number]: Provision;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[globalThis.Number(key)] = Provision.fromPartial(value);
}
return acc;
}, {});
return message;
},
};
@@ -115,90 +133,115 @@ function createBaseProvisionDefinitions_ProvisionsEntry(): ProvisionDefinitions_
return { key: 0, value: createBaseProvision() };
}
export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitions_ProvisionsEntry> = {
encode(message: ProvisionDefinitions_ProvisionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if (message.value !== undefined) {
Provision.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ProvisionDefinitions_ProvisionsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseProvisionDefinitions_ProvisionsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Provision.decode(reader, reader.uint32());
continue;
}
export const ProvisionDefinitions_ProvisionsEntry: MessageFns<ProvisionDefinitions_ProvisionsEntry> =
{
encode(
message: ProvisionDefinitions_ProvisionsEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(8).uint32(message.key);
}
if ((tag & 7) === 4 || tag === 0) {
break;
if (message.value !== undefined) {
Provision.encode(message.value, writer.uint32(18).fork()).join();
}
reader.skip(tag & 7);
}
return message;
},
return writer;
},
fromJSON(object: any): ProvisionDefinitions_ProvisionsEntry {
return {
key: globalThis.Number(assertSet("ProvisionDefinitions_ProvisionsEntry.key", object.key)),
value: Provision.fromJSON(assertSet("ProvisionDefinitions_ProvisionsEntry.value", object.value)),
};
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): ProvisionDefinitions_ProvisionsEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseProvisionDefinitions_ProvisionsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
toJSON(message: ProvisionDefinitions_ProvisionsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = Provision.toJSON(message.value);
}
return obj;
},
message.key = reader.uint32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
create<I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>>(
base?: I,
): ProvisionDefinitions_ProvisionsEntry {
return ProvisionDefinitions_ProvisionsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>>(
object: I,
): ProvisionDefinitions_ProvisionsEntry {
const message = createBaseProvisionDefinitions_ProvisionsEntry();
message.key = object.key ?? 0;
message.value = (object.value !== undefined && object.value !== null)
? Provision.fromPartial(object.value)
: undefined;
return message;
},
};
message.value = Provision.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ProvisionDefinitions_ProvisionsEntry {
return {
key: globalThis.Number(
assertSet('ProvisionDefinitions_ProvisionsEntry.key', object.key),
),
value: Provision.fromJSON(
assertSet('ProvisionDefinitions_ProvisionsEntry.value', object.value),
),
};
},
toJSON(message: ProvisionDefinitions_ProvisionsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = Math.round(message.key);
}
if (message.value !== undefined) {
obj.value = Provision.toJSON(message.value);
}
return obj;
},
create<
I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>,
>(base?: I): ProvisionDefinitions_ProvisionsEntry {
return ProvisionDefinitions_ProvisionsEntry.fromPartial(
base ?? ({} as any),
);
},
fromPartial<
I extends Exact<DeepPartial<ProvisionDefinitions_ProvisionsEntry>, I>,
>(object: I): ProvisionDefinitions_ProvisionsEntry {
const message = createBaseProvisionDefinitions_ProvisionsEntry();
message.key = object.key ?? 0;
message.value =
object.value !== undefined && object.value !== null
? Provision.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseProvision(): Provision {
return { id: 0, name: createBaseI18nString(), crew: undefined, game_mode_exclusive: false, include: [], exclude: [] };
return {
id: 0,
name: createBaseI18nString(),
crew: undefined,
game_mode_exclusive: false,
include: [],
exclude: [],
};
}
export const Provision: MessageFns<Provision> = {
encode(message: Provision, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
encode(
message: Provision,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.id !== 0) {
writer.uint32(8).uint32(message.id);
}
@@ -221,7 +264,8 @@ export const Provision: MessageFns<Provision> = {
},
decode(input: BinaryReader | Uint8Array, length?: number): Provision {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseProvision();
while (reader.pos < end) {
@@ -264,7 +308,9 @@ export const Provision: MessageFns<Provision> = {
break;
}
message.include.push(ConsumableTankFilter.decode(reader, reader.uint32()));
message.include.push(
ConsumableTankFilter.decode(reader, reader.uint32()),
);
continue;
}
case 7: {
@@ -272,7 +318,9 @@ export const Provision: MessageFns<Provision> = {
break;
}
message.exclude.push(ConsumableTankFilter.decode(reader, reader.uint32()));
message.exclude.push(
ConsumableTankFilter.decode(reader, reader.uint32()),
);
continue;
}
}
@@ -286,10 +334,12 @@ export const Provision: MessageFns<Provision> = {
fromJSON(object: any): Provision {
return {
id: globalThis.Number(assertSet("Provision.id", object.id)),
name: I18nString.fromJSON(assertSet("Provision.name", object.name)),
id: globalThis.Number(assertSet('Provision.id', object.id)),
name: I18nString.fromJSON(assertSet('Provision.name', object.name)),
crew: isSet(object.crew) ? globalThis.Number(object.crew) : undefined,
game_mode_exclusive: globalThis.Boolean(assertSet("Provision.game_mode_exclusive", object.game_mode_exclusive)),
game_mode_exclusive: globalThis.Boolean(
assertSet('Provision.game_mode_exclusive', object.game_mode_exclusive),
),
include: globalThis.Array.isArray(object?.include)
? object.include.map((e: any) => ConsumableTankFilter.fromJSON(e))
: [],
@@ -325,35 +375,55 @@ export const Provision: MessageFns<Provision> = {
create<I extends Exact<DeepPartial<Provision>, I>>(base?: I): Provision {
return Provision.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Provision>, I>>(object: I): Provision {
fromPartial<I extends Exact<DeepPartial<Provision>, I>>(
object: I,
): Provision {
const message = createBaseProvision();
message.id = object.id ?? 0;
message.name = (object.name !== undefined && object.name !== null)
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.name =
object.name !== undefined && object.name !== null
? I18nString.fromPartial(object.name)
: createBaseI18nString();
message.crew = object.crew ?? undefined;
message.game_mode_exclusive = object.game_mode_exclusive ?? false;
message.include = object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
message.exclude = object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
message.include =
object.include?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
message.exclude =
object.exclude?.map((e) => ConsumableTankFilter.fromPartial(e)) || [];
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
export type DeepPartial<T> = T extends Builtin
? T
: T extends globalThis.Array<infer U>
? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U>
? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown }
? { $case: T['$case']; value?: DeepPartial<T['value']> }
: T extends {}
? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
export type Exact<P, I extends P> = P extends Builtin
? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
return typeof value === 'object' && value !== null;
}
function isSet(value: any): boolean {
@@ -2,7 +2,7 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/rating_leaderboard.proto
// source: packages/core/src/protos/legacy_rating_leaderboard.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
@@ -2,7 +2,7 @@
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/skill_definitions.proto
// source: packages/core/src/protos/legacy_skill_definitions.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
@@ -2,7 +2,7 @@ syntax = "proto2";
package blitzkit;
import "packages/core/src/protos/i18n.proto";
import "packages/core/src/protos/legacy_i18n.proto";
message TankDefinitions {
map<uint32, TankDefinition> tanks = 1;
+21
View File
@@ -0,0 +1,21 @@
syntax = "proto2";
import "packages/core/src/protos/utils.proto";
package blitzkit;
message Tank {
required string id = 1;
required string slug = 2;
required I18n name = 3;
map<string, Turret> turrets = 4;
map<string, Gun> guns = 5;
}
message Turret {
required string id = 1;
}
message Gun {
required string id = 1;
}
+509
View File
@@ -0,0 +1,509 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/tank.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { I18n, createBaseI18n } from "./utils";
export const protobufPackage = "blitzkit";
export interface Tank {
id: string;
slug: string;
name: I18n;
turrets: { [key: string]: Turret };
guns: { [key: string]: Gun };
}
export interface Tank_TurretsEntry {
key: string;
value: Turret | undefined;
}
export interface Tank_GunsEntry {
key: string;
value: Gun | undefined;
}
export interface Turret {
id: string;
}
export interface Gun {
id: string;
}
function createBaseTank(): Tank {
return { id: "", slug: "", name: createBaseI18n(), turrets: {}, guns: {} };
}
export const Tank: MessageFns<Tank> = {
encode(message: Tank, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
if (message.slug !== "") {
writer.uint32(18).string(message.slug);
}
if (message.name !== undefined) {
I18n.encode(message.name, writer.uint32(26).fork()).join();
}
Object.entries(message.turrets).forEach(([key, value]) => {
Tank_TurretsEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join();
});
Object.entries(message.guns).forEach(([key, value]) => {
Tank_GunsEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Tank {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTank();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.slug = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.name = I18n.decode(reader, reader.uint32());
continue;
}
case 4: {
if (tag !== 34) {
break;
}
const entry4 = Tank_TurretsEntry.decode(reader, reader.uint32());
if (entry4.value !== undefined) {
message.turrets[entry4.key] = entry4.value;
}
continue;
}
case 5: {
if (tag !== 42) {
break;
}
const entry5 = Tank_GunsEntry.decode(reader, reader.uint32());
if (entry5.value !== undefined) {
message.guns[entry5.key] = entry5.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Tank {
return {
id: globalThis.String(assertSet("Tank.id", object.id)),
slug: globalThis.String(assertSet("Tank.slug", object.slug)),
name: I18n.fromJSON(assertSet("Tank.name", object.name)),
turrets: isObject(object.turrets)
? Object.entries(object.turrets).reduce<{ [key: string]: Turret }>((acc, [key, value]) => {
acc[key] = Turret.fromJSON(value);
return acc;
}, {})
: {},
guns: isObject(object.guns)
? Object.entries(object.guns).reduce<{ [key: string]: Gun }>((acc, [key, value]) => {
acc[key] = Gun.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: Tank): unknown {
const obj: any = {};
if (message.id !== "") {
obj.id = message.id;
}
if (message.slug !== "") {
obj.slug = message.slug;
}
if (message.name !== undefined) {
obj.name = I18n.toJSON(message.name);
}
if (message.turrets) {
const entries = Object.entries(message.turrets);
if (entries.length > 0) {
obj.turrets = {};
entries.forEach(([k, v]) => {
obj.turrets[k] = Turret.toJSON(v);
});
}
}
if (message.guns) {
const entries = Object.entries(message.guns);
if (entries.length > 0) {
obj.guns = {};
entries.forEach(([k, v]) => {
obj.guns[k] = Gun.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<Tank>, I>>(base?: I): Tank {
return Tank.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Tank>, I>>(object: I): Tank {
const message = createBaseTank();
message.id = object.id ?? "";
message.slug = object.slug ?? "";
message.name = (object.name !== undefined && object.name !== null)
? I18n.fromPartial(object.name)
: createBaseI18n();
message.turrets = Object.entries(object.turrets ?? {}).reduce<{ [key: string]: Turret }>((acc, [key, value]) => {
if (value !== undefined) {
acc[key] = Turret.fromPartial(value);
}
return acc;
}, {});
message.guns = Object.entries(object.guns ?? {}).reduce<{ [key: string]: Gun }>((acc, [key, value]) => {
if (value !== undefined) {
acc[key] = Gun.fromPartial(value);
}
return acc;
}, {});
return message;
},
};
function createBaseTank_TurretsEntry(): Tank_TurretsEntry {
return { key: "", value: createBaseTurret() };
}
export const Tank_TurretsEntry: MessageFns<Tank_TurretsEntry> = {
encode(message: Tank_TurretsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
Turret.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Tank_TurretsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTank_TurretsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Turret.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Tank_TurretsEntry {
return {
key: globalThis.String(assertSet("Tank_TurretsEntry.key", object.key)),
value: Turret.fromJSON(assertSet("Tank_TurretsEntry.value", object.value)),
};
},
toJSON(message: Tank_TurretsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = Turret.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<Tank_TurretsEntry>, I>>(base?: I): Tank_TurretsEntry {
return Tank_TurretsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Tank_TurretsEntry>, I>>(object: I): Tank_TurretsEntry {
const message = createBaseTank_TurretsEntry();
message.key = object.key ?? "";
message.value = (object.value !== undefined && object.value !== null)
? Turret.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseTank_GunsEntry(): Tank_GunsEntry {
return { key: "", value: createBaseGun() };
}
export const Tank_GunsEntry: MessageFns<Tank_GunsEntry> = {
encode(message: Tank_GunsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
Gun.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Tank_GunsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTank_GunsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Gun.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Tank_GunsEntry {
return {
key: globalThis.String(assertSet("Tank_GunsEntry.key", object.key)),
value: Gun.fromJSON(assertSet("Tank_GunsEntry.value", object.value)),
};
},
toJSON(message: Tank_GunsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = Gun.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<Tank_GunsEntry>, I>>(base?: I): Tank_GunsEntry {
return Tank_GunsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Tank_GunsEntry>, I>>(object: I): Tank_GunsEntry {
const message = createBaseTank_GunsEntry();
message.key = object.key ?? "";
message.value = (object.value !== undefined && object.value !== null) ? Gun.fromPartial(object.value) : undefined;
return message;
},
};
function createBaseTurret(): Turret {
return { id: "" };
}
export const Turret: MessageFns<Turret> = {
encode(message: Turret, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Turret {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTurret();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Turret {
return { id: globalThis.String(assertSet("Turret.id", object.id)) };
},
toJSON(message: Turret): unknown {
const obj: any = {};
if (message.id !== "") {
obj.id = message.id;
}
return obj;
},
create<I extends Exact<DeepPartial<Turret>, I>>(base?: I): Turret {
return Turret.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Turret>, I>>(object: I): Turret {
const message = createBaseTurret();
message.id = object.id ?? "";
return message;
},
};
function createBaseGun(): Gun {
return { id: "" };
}
export const Gun: MessageFns<Gun> = {
encode(message: Gun, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Gun {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGun();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Gun {
return { id: globalThis.String(assertSet("Gun.id", object.id)) };
},
toJSON(message: Gun): unknown {
const obj: any = {};
if (message.id !== "") {
obj.id = message.id;
}
return obj;
},
create<I extends Exact<DeepPartial<Gun>, I>>(base?: I): Gun {
return Gun.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Gun>, I>>(object: I): Gun {
const message = createBaseGun();
message.id = object.id ?? "";
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
+21
View File
@@ -0,0 +1,21 @@
syntax = "proto2";
package blitzkit;
message TankArmor {
// key can only ever be "chassis", "hull", "turret", or "gun"
map<string, PenetrationGroup> groups = 1;
}
message PenetrationGroup {
// keys are mostly "armor_xyz" where xyz is an integer but sometimes can be
// things like "commander", "rightTrack", etc.
map<string, ArmorPlate> armors = 1;
}
message ArmorPlate {
// this is the thickness of the armor in millimeters
required float thickness = 1;
// this can be stuff like ArmorScreen which is spaced armor, FuelTank, etc.
required string type = 2;
}
+471
View File
@@ -0,0 +1,471 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/tank_armor.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "blitzkit";
export interface TankArmor {
/** key can only ever be "chassis", "hull", "turret", or "gun" */
groups: { [key: string]: PenetrationGroup };
}
export interface TankArmor_GroupsEntry {
key: string;
value: PenetrationGroup | undefined;
}
export interface PenetrationGroup {
/**
* keys are mostly "armor_xyz" where xyz is an integer but sometimes can be
* things like "commander", "rightTrack", etc.
*/
armors: { [key: string]: ArmorPlate };
}
export interface PenetrationGroup_ArmorsEntry {
key: string;
value: ArmorPlate | undefined;
}
export interface ArmorPlate {
/** this is the thickness of the armor in millimeters */
thickness: number;
/** this can be stuff like ArmorScreen which is spaced armor, FuelTank, etc. */
type: string;
}
function createBaseTankArmor(): TankArmor {
return { groups: {} };
}
export const TankArmor: MessageFns<TankArmor> = {
encode(message: TankArmor, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
Object.entries(message.groups).forEach(([key, value]) => {
TankArmor_GroupsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): TankArmor {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTankArmor();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = TankArmor_GroupsEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.groups[entry1.key] = entry1.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): TankArmor {
return {
groups: isObject(object.groups)
? Object.entries(object.groups).reduce<{ [key: string]: PenetrationGroup }>((acc, [key, value]) => {
acc[key] = PenetrationGroup.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: TankArmor): unknown {
const obj: any = {};
if (message.groups) {
const entries = Object.entries(message.groups);
if (entries.length > 0) {
obj.groups = {};
entries.forEach(([k, v]) => {
obj.groups[k] = PenetrationGroup.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<TankArmor>, I>>(base?: I): TankArmor {
return TankArmor.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<TankArmor>, I>>(object: I): TankArmor {
const message = createBaseTankArmor();
message.groups = Object.entries(object.groups ?? {}).reduce<{ [key: string]: PenetrationGroup }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[key] = PenetrationGroup.fromPartial(value);
}
return acc;
},
{},
);
return message;
},
};
function createBaseTankArmor_GroupsEntry(): TankArmor_GroupsEntry {
return { key: "", value: createBasePenetrationGroup() };
}
export const TankArmor_GroupsEntry: MessageFns<TankArmor_GroupsEntry> = {
encode(message: TankArmor_GroupsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
PenetrationGroup.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): TankArmor_GroupsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTankArmor_GroupsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = PenetrationGroup.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): TankArmor_GroupsEntry {
return {
key: globalThis.String(assertSet("TankArmor_GroupsEntry.key", object.key)),
value: PenetrationGroup.fromJSON(assertSet("TankArmor_GroupsEntry.value", object.value)),
};
},
toJSON(message: TankArmor_GroupsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = PenetrationGroup.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<TankArmor_GroupsEntry>, I>>(base?: I): TankArmor_GroupsEntry {
return TankArmor_GroupsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<TankArmor_GroupsEntry>, I>>(object: I): TankArmor_GroupsEntry {
const message = createBaseTankArmor_GroupsEntry();
message.key = object.key ?? "";
message.value = (object.value !== undefined && object.value !== null)
? PenetrationGroup.fromPartial(object.value)
: undefined;
return message;
},
};
function createBasePenetrationGroup(): PenetrationGroup {
return { armors: {} };
}
export const PenetrationGroup: MessageFns<PenetrationGroup> = {
encode(message: PenetrationGroup, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
Object.entries(message.armors).forEach(([key, value]) => {
PenetrationGroup_ArmorsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): PenetrationGroup {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBasePenetrationGroup();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = PenetrationGroup_ArmorsEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.armors[entry1.key] = entry1.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): PenetrationGroup {
return {
armors: isObject(object.armors)
? Object.entries(object.armors).reduce<{ [key: string]: ArmorPlate }>((acc, [key, value]) => {
acc[key] = ArmorPlate.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: PenetrationGroup): unknown {
const obj: any = {};
if (message.armors) {
const entries = Object.entries(message.armors);
if (entries.length > 0) {
obj.armors = {};
entries.forEach(([k, v]) => {
obj.armors[k] = ArmorPlate.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<PenetrationGroup>, I>>(base?: I): PenetrationGroup {
return PenetrationGroup.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<PenetrationGroup>, I>>(object: I): PenetrationGroup {
const message = createBasePenetrationGroup();
message.armors = Object.entries(object.armors ?? {}).reduce<{ [key: string]: ArmorPlate }>((acc, [key, value]) => {
if (value !== undefined) {
acc[key] = ArmorPlate.fromPartial(value);
}
return acc;
}, {});
return message;
},
};
function createBasePenetrationGroup_ArmorsEntry(): PenetrationGroup_ArmorsEntry {
return { key: "", value: createBaseArmorPlate() };
}
export const PenetrationGroup_ArmorsEntry: MessageFns<PenetrationGroup_ArmorsEntry> = {
encode(message: PenetrationGroup_ArmorsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
ArmorPlate.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): PenetrationGroup_ArmorsEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBasePenetrationGroup_ArmorsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = ArmorPlate.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): PenetrationGroup_ArmorsEntry {
return {
key: globalThis.String(assertSet("PenetrationGroup_ArmorsEntry.key", object.key)),
value: ArmorPlate.fromJSON(assertSet("PenetrationGroup_ArmorsEntry.value", object.value)),
};
},
toJSON(message: PenetrationGroup_ArmorsEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = ArmorPlate.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<PenetrationGroup_ArmorsEntry>, I>>(base?: I): PenetrationGroup_ArmorsEntry {
return PenetrationGroup_ArmorsEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<PenetrationGroup_ArmorsEntry>, I>>(object: I): PenetrationGroup_ArmorsEntry {
const message = createBasePenetrationGroup_ArmorsEntry();
message.key = object.key ?? "";
message.value = (object.value !== undefined && object.value !== null)
? ArmorPlate.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseArmorPlate(): ArmorPlate {
return { thickness: 0, type: "" };
}
export const ArmorPlate: MessageFns<ArmorPlate> = {
encode(message: ArmorPlate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.thickness !== 0) {
writer.uint32(13).float(message.thickness);
}
if (message.type !== "") {
writer.uint32(18).string(message.type);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ArmorPlate {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseArmorPlate();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 13) {
break;
}
message.thickness = reader.float();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.type = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ArmorPlate {
return {
thickness: globalThis.Number(assertSet("ArmorPlate.thickness", object.thickness)),
type: globalThis.String(assertSet("ArmorPlate.type", object.type)),
};
},
toJSON(message: ArmorPlate): unknown {
const obj: any = {};
if (message.thickness !== 0) {
obj.thickness = message.thickness;
}
if (message.type !== "") {
obj.type = message.type;
}
return obj;
},
create<I extends Exact<DeepPartial<ArmorPlate>, I>>(base?: I): ArmorPlate {
return ArmorPlate.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ArmorPlate>, I>>(object: I): ArmorPlate {
const message = createBaseArmorPlate();
message.thickness = object.thickness ?? 0;
message.type = object.type ?? "";
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
+13
View File
@@ -0,0 +1,13 @@
syntax = "proto2";
import "packages/core/src/protos/utils.proto";
package blitzkit;
message TankModel {
map<string, ModuleModel> modules = 1;
}
message ModuleModel {
required Vector3 translation = 2;
}
+282
View File
@@ -0,0 +1,282 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/tank_model.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Vector3, createBaseVector3 } from "./utils";
export const protobufPackage = "blitzkit";
export interface TankModel {
modules: { [key: string]: ModuleModel };
}
export interface TankModel_ModulesEntry {
key: string;
value: ModuleModel | undefined;
}
export interface ModuleModel {
translation: Vector3;
}
function createBaseTankModel(): TankModel {
return { modules: {} };
}
export const TankModel: MessageFns<TankModel> = {
encode(message: TankModel, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
Object.entries(message.modules).forEach(([key, value]) => {
TankModel_ModulesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): TankModel {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTankModel();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = TankModel_ModulesEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.modules[entry1.key] = entry1.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): TankModel {
return {
modules: isObject(object.modules)
? Object.entries(object.modules).reduce<{ [key: string]: ModuleModel }>((acc, [key, value]) => {
acc[key] = ModuleModel.fromJSON(value);
return acc;
}, {})
: {},
};
},
toJSON(message: TankModel): unknown {
const obj: any = {};
if (message.modules) {
const entries = Object.entries(message.modules);
if (entries.length > 0) {
obj.modules = {};
entries.forEach(([k, v]) => {
obj.modules[k] = ModuleModel.toJSON(v);
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<TankModel>, I>>(base?: I): TankModel {
return TankModel.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<TankModel>, I>>(object: I): TankModel {
const message = createBaseTankModel();
message.modules = Object.entries(object.modules ?? {}).reduce<{ [key: string]: ModuleModel }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[key] = ModuleModel.fromPartial(value);
}
return acc;
},
{},
);
return message;
},
};
function createBaseTankModel_ModulesEntry(): TankModel_ModulesEntry {
return { key: "", value: createBaseModuleModel() };
}
export const TankModel_ModulesEntry: MessageFns<TankModel_ModulesEntry> = {
encode(message: TankModel_ModulesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
ModuleModel.encode(message.value, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): TankModel_ModulesEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTankModel_ModulesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = ModuleModel.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): TankModel_ModulesEntry {
return {
key: globalThis.String(assertSet("TankModel_ModulesEntry.key", object.key)),
value: ModuleModel.fromJSON(assertSet("TankModel_ModulesEntry.value", object.value)),
};
},
toJSON(message: TankModel_ModulesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = ModuleModel.toJSON(message.value);
}
return obj;
},
create<I extends Exact<DeepPartial<TankModel_ModulesEntry>, I>>(base?: I): TankModel_ModulesEntry {
return TankModel_ModulesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<TankModel_ModulesEntry>, I>>(object: I): TankModel_ModulesEntry {
const message = createBaseTankModel_ModulesEntry();
message.key = object.key ?? "";
message.value = (object.value !== undefined && object.value !== null)
? ModuleModel.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseModuleModel(): ModuleModel {
return { translation: createBaseVector3() };
}
export const ModuleModel: MessageFns<ModuleModel> = {
encode(message: ModuleModel, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.translation !== undefined) {
Vector3.encode(message.translation, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ModuleModel {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseModuleModel();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 2: {
if (tag !== 18) {
break;
}
message.translation = Vector3.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): ModuleModel {
return { translation: Vector3.fromJSON(assertSet("ModuleModel.translation", object.translation)) };
},
toJSON(message: ModuleModel): unknown {
const obj: any = {};
if (message.translation !== undefined) {
obj.translation = Vector3.toJSON(message.translation);
}
return obj;
},
create<I extends Exact<DeepPartial<ModuleModel>, I>>(base?: I): ModuleModel {
return ModuleModel.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<ModuleModel>, I>>(object: I): ModuleModel {
const message = createBaseModuleModel();
message.translation = (object.translation !== undefined && object.translation !== null)
? Vector3.fromPartial(object.translation)
: createBaseVector3();
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
+7
View File
@@ -0,0 +1,7 @@
syntax = "proto2";
package blitzkit;
message Tanks {
repeated string tanks = 1;
}
+94
View File
@@ -0,0 +1,94 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/tanks.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "blitzkit";
export interface Tanks {
tanks: string[];
}
function createBaseTanks(): Tanks {
return { tanks: [] };
}
export const Tanks: MessageFns<Tanks> = {
encode(message: Tanks, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.tanks) {
writer.uint32(10).string(v!);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Tanks {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTanks();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.tanks.push(reader.string());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Tanks {
return { tanks: globalThis.Array.isArray(object?.tanks) ? object.tanks.map((e: any) => globalThis.String(e)) : [] };
},
toJSON(message: Tanks): unknown {
const obj: any = {};
if (message.tanks?.length) {
obj.tanks = message.tanks;
}
return obj;
},
create<I extends Exact<DeepPartial<Tanks>, I>>(base?: I): Tanks {
return Tanks.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Tanks>, I>>(object: I): Tanks {
const message = createBaseTanks();
message.tanks = object.tanks?.map((e) => e) || [];
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
@@ -0,0 +1,9 @@
syntax = "proto2";
import "packages/core/src/protos/tank.proto";
package blitzkit;
message TanksFull {
repeated Tank tanks = 1;
}
+95
View File
@@ -0,0 +1,95 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/tanks_full.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Tank } from "./tank";
export const protobufPackage = "blitzkit";
export interface TanksFull {
tanks: Tank[];
}
function createBaseTanksFull(): TanksFull {
return { tanks: [] };
}
export const TanksFull: MessageFns<TanksFull> = {
encode(message: TanksFull, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
for (const v of message.tanks) {
Tank.encode(v!, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): TanksFull {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTanksFull();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.tanks.push(Tank.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): TanksFull {
return { tanks: globalThis.Array.isArray(object?.tanks) ? object.tanks.map((e: any) => Tank.fromJSON(e)) : [] };
},
toJSON(message: TanksFull): unknown {
const obj: any = {};
if (message.tanks?.length) {
obj.tanks = message.tanks.map((e) => Tank.toJSON(e));
}
return obj;
},
create<I extends Exact<DeepPartial<TanksFull>, I>>(base?: I): TanksFull {
return TanksFull.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<TanksFull>, I>>(object: I): TanksFull {
const message = createBaseTanksFull();
message.tanks = object.tanks?.map((e) => Tank.fromPartial(e)) || [];
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
+13
View File
@@ -0,0 +1,13 @@
syntax = "proto2";
package blitzkit;
message Vector3 {
required float x = 1;
required float y = 2;
required float z = 3;
}
message I18n {
map<string, string> locales = 1;
}
+310
View File
@@ -0,0 +1,310 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.2
// protoc v5.28.2
// source: packages/core/src/protos/utils.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "blitzkit";
export interface Vector3 {
x: number;
y: number;
z: number;
}
export interface I18n {
locales: { [key: string]: string };
}
export interface I18n_LocalesEntry {
key: string;
value: string;
}
export function createBaseVector3(): Vector3 {
return { x: 0, y: 0, z: 0 };
}
export const Vector3: MessageFns<Vector3> = {
encode(message: Vector3, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.x !== 0) {
writer.uint32(13).float(message.x);
}
if (message.y !== 0) {
writer.uint32(21).float(message.y);
}
if (message.z !== 0) {
writer.uint32(29).float(message.z);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Vector3 {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseVector3();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 13) {
break;
}
message.x = reader.float();
continue;
}
case 2: {
if (tag !== 21) {
break;
}
message.y = reader.float();
continue;
}
case 3: {
if (tag !== 29) {
break;
}
message.z = reader.float();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): Vector3 {
return {
x: globalThis.Number(assertSet("Vector3.x", object.x)),
y: globalThis.Number(assertSet("Vector3.y", object.y)),
z: globalThis.Number(assertSet("Vector3.z", object.z)),
};
},
toJSON(message: Vector3): unknown {
const obj: any = {};
if (message.x !== 0) {
obj.x = message.x;
}
if (message.y !== 0) {
obj.y = message.y;
}
if (message.z !== 0) {
obj.z = message.z;
}
return obj;
},
create<I extends Exact<DeepPartial<Vector3>, I>>(base?: I): Vector3 {
return Vector3.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Vector3>, I>>(object: I): Vector3 {
const message = createBaseVector3();
message.x = object.x ?? 0;
message.y = object.y ?? 0;
message.z = object.z ?? 0;
return message;
},
};
export function createBaseI18n(): I18n {
return { locales: {} };
}
export const I18n: MessageFns<I18n> = {
encode(message: I18n, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
Object.entries(message.locales).forEach(([key, value]) => {
I18n_LocalesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): I18n {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseI18n();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
const entry1 = I18n_LocalesEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.locales[entry1.key] = entry1.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): I18n {
return {
locales: isObject(object.locales)
? Object.entries(object.locales).reduce<{ [key: string]: string }>((acc, [key, value]) => {
acc[key] = String(value);
return acc;
}, {})
: {},
};
},
toJSON(message: I18n): unknown {
const obj: any = {};
if (message.locales) {
const entries = Object.entries(message.locales);
if (entries.length > 0) {
obj.locales = {};
entries.forEach(([k, v]) => {
obj.locales[k] = v;
});
}
}
return obj;
},
create<I extends Exact<DeepPartial<I18n>, I>>(base?: I): I18n {
return I18n.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<I18n>, I>>(object: I): I18n {
const message = createBaseI18n();
message.locales = Object.entries(object.locales ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {
if (value !== undefined) {
acc[key] = globalThis.String(value);
}
return acc;
}, {});
return message;
},
};
function createBaseI18n_LocalesEntry(): I18n_LocalesEntry {
return { key: "", value: "" };
}
export const I18n_LocalesEntry: MessageFns<I18n_LocalesEntry> = {
encode(message: I18n_LocalesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.key !== undefined) {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
writer.uint32(18).string(message.value);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): I18n_LocalesEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseI18n_LocalesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): I18n_LocalesEntry {
return {
key: globalThis.String(assertSet("I18n_LocalesEntry.key", object.key)),
value: globalThis.String(assertSet("I18n_LocalesEntry.value", object.value)),
};
},
toJSON(message: I18n_LocalesEntry): unknown {
const obj: any = {};
if (message.key !== undefined) {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = message.value;
}
return obj;
},
create<I extends Exact<DeepPartial<I18n_LocalesEntry>, I>>(base?: I): I18n_LocalesEntry {
return I18n_LocalesEntry.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<I18n_LocalesEntry>, I>>(object: I): I18n_LocalesEntry {
const message = createBaseI18n_LocalesEntry();
message.key = object.key ?? "";
message.value = object.value ?? "";
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isObject(value: any): boolean {
return typeof value === "object" && value !== null;
}
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
function assertSet<T>(field: string, value: T | undefined): T {
if (!isSet(value)) {
throw new TypeError(`Required field ${field} is not set`);
}
return value as T;
}
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
}
+14
View File
@@ -0,0 +1,14 @@
{
"default": "en",
"supported": [
{ "locale": "en" },
{ "locale": "es" },
{ "locale": "fr" },
{ "locale": "ja" },
{ "locale": "pl" },
{ "locale": "pt" },
{ "locale": "ru" },
{ "locale": "uk" },
{ "locale": "zh", "blitz": "zh_Hans_SG" }
]
}
+28 -3
View File
@@ -756,6 +756,7 @@
},
"tank_search": {
"clear_filters": "Clear",
"search_bar_hint": "Search tanks...",
"recent": "Recently viewed",
"select_all": "Select all",
@@ -824,6 +825,12 @@
},
"home": {
"discord": {
"join_short": "Join cool people!",
"join_long": "Join super duper cool people!",
"action": "Discord"
},
"hero": {
"credit": "By %s1 ❤️"
},
@@ -838,8 +845,22 @@
"seo_description": "Tools for everything World of Tanks Blitz"
},
"docs": {
"patches": {
"name": "BlitzKit Changelogs",
"seo_description": "Changelogs for BlitzKit Discord bot and website"
}
},
"tools": {
"tankopedia": {
"api": {
"name": "API",
"button": "Nerd out",
"description": "BlitzKit API docs",
"seo_description": "Comprehensive documentation and detailed insights into BlitzKit's API, enabling developers to integrate and utilize advanced features for World of Tanks Blitz efficiently."
},
"tanks": {
"name": "Tankopedia",
"button": "Find tanks",
"description": "Blitz tank encyclopedia",
@@ -848,6 +869,10 @@
"tank_seo_description": "%s1 armor, statistics, equipment, provisions, and more. %s2 DPM, %s3hp alpha, %s4mm penetration, %s5kph top speed, %s6hp health.",
"sandbox": {
"dissector": {
"name": "Dissector"
},
"poses": {
"hull_down": "Hull down",
"face_hug": "Face hug",
@@ -893,7 +918,7 @@
"element": {
"primary": "Primary",
"spaced": "Spaced",
"external": "External",
"modules": "Modules",
"gap": "Gap",
"gun": "Gun",
"track": "Tracks"
@@ -915,7 +940,7 @@
"name": "Static armor",
"primary": "Primary",
"spaced": "Spaced",
"external": "External",
"modules": "Modules",
"edit": {
"label": "Edit",
"reset": "Reset"
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -1,4 +1,3 @@
import { imgur } from '@blitzkit/core';
import {
CodeIcon,
HeightIcon,
@@ -63,7 +62,7 @@ function Content({ embed }: PageProps) {
const embedStateStore = EmbedState.useStore();
const config = embedConfigurations[embed] as EmbedConfig;
const [backgroundImage, setBackgroundImage] = useState(
imgur('SO13zur', { format: 'jpeg' }),
'/assets/images/backgrounds/embed-default.webp',
);
const fileInput = useRef<HTMLInputElement>();
const { strings } = useLocale();
@@ -1,5 +1,4 @@
---
import { capitalize } from 'lodash-es';
import EmbedLayout from '../../../../../../layouts/EmbedLayout.astro';
import type { getStaticPaths } from '../index.astro';
import { Page } from './_index';
@@ -7,8 +6,6 @@ import { Page } from './_index';
export { getStaticPaths } from '../index.astro';
---
<title>BlitzKit - {capitalize(Astro.params.embed)} embed</title>
<EmbedLayout>
<Page client:only="react" embed={Astro.params.embed} />
</EmbedLayout>
@@ -1,4 +1,5 @@
---
import { AstroSeo } from '@astrolib/seo';
import type { GetStaticPaths } from 'astro';
import { capitalize } from 'lodash-es';
import { embedConfigurations } from '../../../../../constants/embeds';
@@ -21,10 +22,24 @@ export const getStaticPaths = (() => {
.flat();
}) satisfies GetStaticPaths;
const name = capitalize(Astro.params.embed);
const title = `BlitzKit - ${name} embed`;
const description = `BlitzKit ${name} embeds for streaming World of Tanks Blitz with extreme customization`;
const { locale } = Astro.params;
---
<title>BlitzKit - {capitalize(Astro.params.embed)} embed</title>
<AstroSeo
title={title}
description={description}
canonical={Astro.url.href}
openGraph={{
url: Astro.url.href,
title,
description,
site_name: 'BlitzKit',
}}
twitter={{ cardType: 'summary_large_image' }}
/>
<style is:global>
@keyframes fade-out-border {
@@ -1,4 +1,3 @@
import { imgur, ImgurSize } from '@blitzkit/core';
import { Box, Flex, Link, Text } from '@radix-ui/themes';
import { PreviewWrapper } from '../../../../components/Embeds/PreviewWrapper';
import { LinkI18n } from '../../../../components/LinkI18n';
@@ -85,7 +84,8 @@ function Content() {
overflow="hidden"
position="relative"
style={{
backgroundImage: `url(${imgur('SO13zur', { format: 'jpeg', size: ImgurSize.SmallThumbnail })})`,
backgroundImage:
'url(/assets/images/backgrounds/embed-default.webp)',
backgroundSize: 'cover',
backgroundPosition: 'center',
}}
Loaded 100 of 296 files, more files were not shown because too many files have changed in this diff. Show more