Skip to main content

Crate hots_replay_parser

Crate hots_replay_parser 

Source
Expand description

Offline Heroes of the Storm .StormReplay decoder: a Rust port of Blizzard’s heroprotocol (schema-driven bit decoders) and mpyq (MPQ archive reader).

Two phases, joined only by ReplayFiles:

  1. mpq: archive → raw section bytes (no protocol, no JSON)
  2. decode: raw section bytes + per-build protocol → JSON (no MPQ)

On top of them, summary turns a decoded replay into a compact, typed ReplaySummary for stats and charts.

Re-exports§

pub use crate::decode::Attribute;
pub use crate::decode::AttributeEvents;
pub use crate::decode::BattleLobby;
pub use crate::decode::Event;
pub use crate::decode::LobbyPlayer;
pub use crate::decode::ParsedReplay;
pub use crate::decode::Toon;
pub use crate::decode::UserId;

Modules§

decode
Raw section bytes → JSON, driven by heroprotocol’s per-build schemas. Knows nothing about MPQ: input is a ReplayFiles.
mpq
Minimal MPQ archive reader, ported from mpyq. Knows nothing about replays or protocols: it only turns an archive into named byte blobs.
summary
Typed, compact per-game summary for stats and charts: who played what, who won, the end-of-game score screen, and a timeline of deaths, levels, talents, XP and objectives.

Structs§

ReplayFiles
Raw, still-encoded bytes of every replay section.
Sections
Which replay sections to extract and decode. The header is always included.

Enums§

Error
Any failure of parse_replay, summarize_replay, ReplayFiles or decode_replay.

Functions§

parse_replay
Open a .StormReplay file and decode every section: ReplayFiles::open then decode::decode_replay.
summarize_replay
Open a .StormReplay file and summarize it, decoding only the Sections::SUMMARY sections: game and message events, most of the file, are never decompressed nor decoded.