Parses and checks a replay file, refusing by name anything that is not this game on this framework: a replay from another build does not fail somewhere mid-playback, it is rejected at the door with what it actually carries.
import { importReplayFile, version } from '@datamoc/mwg';declare const json: string; // read from a file, see readReplayFileconst file = importReplayFile(json, { framework: version, game: 'my-game' });console.log(file.events.length, file.seed); Copy
import { importReplayFile, version } from '@datamoc/mwg';declare const json: string; // read from a file, see readReplayFileconst file = importReplayFile(json, { framework: version, game: 'my-game' });console.log(file.events.length, file.seed);
Parses and checks a replay file, refusing by name anything that is not this game on this framework: a replay from another build does not fail somewhere mid-playback, it is rejected at the door with what it actually carries.