mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
fix: identity encoding
This commit is contained in:
1 parent
084d55b853
commit
5e9555aa57
16 files changed
+90
-93
No files matched your search
@@ -7,7 +7,6 @@ import {
|
||||
ConsumableTankCategoryFilterCategory,
|
||||
Crew,
|
||||
CrewType,
|
||||
encodePBBuffer,
|
||||
EquipmentDefinitions,
|
||||
EquipmentSlot,
|
||||
GameDefinitions,
|
||||
@@ -1772,39 +1771,39 @@ export async function definitions() {
|
||||
|
||||
await commitAssets('definitions', [
|
||||
{
|
||||
content: encodePBBuffer(GameDefinitions, gameDefinitions),
|
||||
content: GameDefinitions.encode(gameDefinitions).finish(),
|
||||
path: 'definitions/game.pb',
|
||||
},
|
||||
{
|
||||
content: encodePBBuffer(TankDefinitions, tankDefinitions),
|
||||
content: TankDefinitions.encode(tankDefinitions).finish(),
|
||||
path: 'definitions/tanks.pb',
|
||||
},
|
||||
{
|
||||
content: encodePBBuffer(ModelDefinitions, modelDefinitions),
|
||||
content: ModelDefinitions.encode(modelDefinitions).finish(),
|
||||
path: 'definitions/models.pb',
|
||||
},
|
||||
{
|
||||
content: encodePBBuffer(EquipmentDefinitions, equipmentDefinitions),
|
||||
content: EquipmentDefinitions.encode(equipmentDefinitions).finish(),
|
||||
path: 'definitions/equipment.pb',
|
||||
},
|
||||
{
|
||||
content: encodePBBuffer(ConsumableDefinitions, consumableDefinitions),
|
||||
content: ConsumableDefinitions.encode(consumableDefinitions).finish(),
|
||||
path: 'definitions/consumables.pb',
|
||||
},
|
||||
{
|
||||
content: encodePBBuffer(ProvisionDefinitions, provisionDefinitions),
|
||||
content: ProvisionDefinitions.encode(provisionDefinitions).finish(),
|
||||
path: 'definitions/provisions.pb',
|
||||
},
|
||||
{
|
||||
content: encodePBBuffer(SkillDefinitions, skillDefinitions),
|
||||
content: SkillDefinitions.encode(skillDefinitions).finish(),
|
||||
path: 'definitions/skills.pb',
|
||||
},
|
||||
{
|
||||
content: encodePBBuffer(MapDefinitions, mapDefinitions),
|
||||
content: MapDefinitions.encode(mapDefinitions).finish(),
|
||||
path: 'definitions/maps.pb',
|
||||
},
|
||||
{
|
||||
content: encodePBBuffer(CamouflageDefinitions, camouflageDefinitions),
|
||||
content: CamouflageDefinitions.encode(camouflageDefinitions).finish(),
|
||||
path: 'definitions/camouflages.pb',
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Avatar, encodePBBuffer, fetchGlossary, Gallery } from '@blitzkit/core';
|
||||
import { Avatar, fetchGlossary, Gallery } from '@blitzkit/core';
|
||||
import locales from '@blitzkit/i18n/locales.json';
|
||||
import { extname } from 'path';
|
||||
import ProgressBar from 'progress';
|
||||
@@ -68,13 +68,13 @@ export async function glossary() {
|
||||
|
||||
gallery.avatars.push(avatar);
|
||||
|
||||
const content = await fetch(url).then((response) =>
|
||||
response.arrayBuffer(),
|
||||
);
|
||||
const content = await fetch(url)
|
||||
.then((response) => response.arrayBuffer())
|
||||
.then((buffer) => new Uint8Array(buffer));
|
||||
|
||||
changes.push({
|
||||
path: `gallery/avatars/${key}${avatar.extension}`,
|
||||
content: Buffer.from(content),
|
||||
content,
|
||||
});
|
||||
|
||||
bar.tick();
|
||||
@@ -83,7 +83,7 @@ export async function glossary() {
|
||||
|
||||
changes.push({
|
||||
path: 'definitions/gallery.pb',
|
||||
content: encodePBBuffer(Gallery, gallery),
|
||||
content: Gallery.encode(gallery).finish(),
|
||||
});
|
||||
|
||||
await commitAssets('glossary', changes);
|
||||
|
||||
@@ -32,7 +32,7 @@ export async function migration() {
|
||||
await commitAssets('migration', [
|
||||
{
|
||||
path: 'definitions/migration.json',
|
||||
content: Buffer.from(JSON.stringify(map)),
|
||||
content: new TextEncoder().encode(JSON.stringify(map)),
|
||||
},
|
||||
]);
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import {
|
||||
assertSecret,
|
||||
encodePBBuffer,
|
||||
fetchTankDefinitions,
|
||||
PopularTanks,
|
||||
} from '@blitzkit/core';
|
||||
@@ -70,7 +69,7 @@ export async function popularTanks() {
|
||||
await commitAssets('popular tanks', [
|
||||
{
|
||||
path: 'definitions/popular-tanks.pb',
|
||||
content: encodePBBuffer(PopularTanks, popularTanks),
|
||||
content: PopularTanks.encode(popularTanks).finish(),
|
||||
},
|
||||
]);
|
||||
}
|
||||
@@ -29,10 +29,11 @@ export async function tankArmors() {
|
||||
|
||||
const id = toUniqueId(nation, tank.id);
|
||||
const model = await extractArmor(DATA, `${nation}-${tankKey}`);
|
||||
const content = await nodeIO.writeBinary(model);
|
||||
|
||||
changes.push({
|
||||
path: `3d/tanks/armor/${id}.glb`,
|
||||
content: Buffer.from(await nodeIO.writeBinary(model)),
|
||||
content,
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { toUniqueId } from '@blitzkit/core';
|
||||
import { NodeIO } from '@gltf-transform/core';
|
||||
import { ALL_EXTENSIONS } from '@gltf-transform/extensions';
|
||||
import { readdir } from 'fs/promises';
|
||||
import { readdir, writeFile } from 'fs/promises';
|
||||
import { extractModel } from '../core/blitz/extractModel';
|
||||
import { readXMLDVPL } from '../core/blitz/readXMLDVPL';
|
||||
import { readYAMLDVPL } from '../core/blitz/readYAMLDVPL';
|
||||
@@ -33,6 +33,8 @@ export async function tankModels() {
|
||||
|
||||
const id = toUniqueId(nation, tank.id);
|
||||
|
||||
if (id !== 21777) continue;
|
||||
|
||||
const parameters = await readYAMLDVPL<TankParameters>(
|
||||
`${DATA}/3d/Tanks/Parameters/${nation}/${tankKey}.yaml`,
|
||||
);
|
||||
@@ -41,6 +43,8 @@ export async function tankModels() {
|
||||
parameters.resourcesPath.blitzModelPath.replace(/\.sc2$/, ''),
|
||||
);
|
||||
|
||||
await writeFile('../../temp/model.glb', await nodeIO.writeBinary(model));
|
||||
|
||||
changes.push({
|
||||
path: `3d/tanks/models/${id}.glb`,
|
||||
content: Buffer.from(await nodeIO.writeBinary(model)),
|
||||
|
||||
Reference in new issue
Block a user