Skip to content

nydus/storm-replay

Repository files navigation

storm-replay

Works with Node v8 Works with Node v10 Does NOT work with Node v12 Does NOT work with Node v14

Works with node-gyp v6.1.0 Does NOT work with node-gyp v7

Works with StormLib v9.21 Does NOT work with StormLib v9.22

2018-12 Update Since Blizzard has decided to effectively kill Heroes of the Storm by ending all competitive esports entirely, shifting developers off the game, and “changing the cadence” of updates, I have no longer cared about the game and have halted all development. Shame, as it was a beloved game for me, but seeing as they completely dropped by the ball by failing to bring the game to market in a timely manner to compete in the MOBA space, my updates to this project will be considered few and very far between.

NodeJS wrapper for StormLib (https://github.com/ladislav-zezula/StormLib) for parsing Heroes of the Storm replay files (.StormReplay).

This is a backend library designed for speedy extraction of files. In tests against the javascript library, extraction times improved nearly 60%.

API

.getHeader(Archive)

Retrieve the MPQ Header information for the Archive. This header includes the all important build information for parsing.

The object returned contains the full header as .header.data and the parsed header as .content.data. You will most likely want .content.data. The other data provided, .err and .content.size, is there for validation.

    return {
        err: (Header.length === undefined),
        header: {
            data: Header,
            size: Header.length
        },
        content: {
            data: Header.slice(16, 16 + Header.readUInt32LE(12)),
            size: Header.readUInt32LE(12)
        }
    };

.extractFile(Archive, File)

Extract File from Archive as a buffer.

The object returned has the data you want as .content.data. The other data provided, .err and .content.size, is there for validation.

    return {
        err: (File.length === undefined),
        content: {
            data: File,
            size: File.length
        }
    };

.removeMessages(Archive)

Remove replay.message.events from the archive.

Chat messages may be toxic, offensive, taken out of context or otherwise not fit for human consumption. This sanitation method provides some protection to ensure a player's actions speak louder than his or her words.

Returns true if there are no messages in the file, false if there was an issue.

    return bool;

References