pvpokemon/src/scripts/convertGameMasterToJson.js
2019-03-19 01:08:22 -04:00

8 lines
457 B
JavaScript

const POGOProtos = require('pogo-protos');
const fs = require('fs');
const path = require('path');
const gamemaster = fs.readFileSync(path.resolve('externals/pokemongo-game-master/versions/latest', 'GAME_MASTER.protobuf'));
const decoded = POGOProtos.Networking.Responses.DownloadItemTemplatesResponse.decode(gamemaster);
fs.writeFileSync(path.resolve('externals/generated', `gamemaster_${ decoded.timestamp_ms }.json`), JSON.stringify(decoded, null, 2));