ReplayParser
Top-level orchestrator that wires stream decoding, schema/entity updates, event ingestion, and extractor outputs.
See also: Quickstart, Architecture
Generated API
gem.parser.ReplayParser
ReplayParser
class ReplayParserDrives a full Source 2 replay parse, wiring all subsystems together.
Source: src/gem/parser.py:231
Properties
net_tick
Signature: def ReplayParser.net_tick(self) -> int
Current net tick (from net_Tick inner messages).
Source: src/gem/parser.py:312
game_time_s
Signature: def ReplayParser.game_time_s(self) -> int | None
Rounded game-relative clock, refreshed at network-tick start.
Source: src/gem/parser.py:321
raw_game_time_s
Signature: def ReplayParser.raw_game_time_s(self) -> int | None
Rounded server game time before the game-start shift, from pregame on.
Source: src/gem/parser.py:330
opendota_tick_start_raw_s
Signature: def ReplayParser.opendota_tick_start_raw_s(self) -> int | None
OpenDota's running clock at this outer tick's start, before the game-start shift.
Source: src/gem/parser.py:335
opendota_start_s
Signature: def ReplayParser.opendota_start_s(self) -> int | None
OpenDota's rounded game-start anchor, latched when first seen.
Source: src/gem/parser.py:344
combat_log_start_s
Signature: def ReplayParser.combat_log_start_s(self) -> int | None
Rounded combat-log GAME_IN_PROGRESS timestamp anchor, when observed.
Source: src/gem/parser.py:349
game_clock
Signature: def ReplayParser.game_clock(self) -> GameClock
Pause-aware tick/game-time anchors and observed pauses.
Source: src/gem/parser.py:372
game_start_tick
Signature: def ReplayParser.game_start_tick(self) -> int | None
Replay tick at which the game start (horn) was first seen.
Source: src/gem/parser.py:381
combat_log_time_s
Signature: def ReplayParser.combat_log_time_s(self) -> int | None
Horn-anchored time of the latest timed combat-log entry.
Source: src/gem/parser.py:390
duration_s
Signature: def ReplayParser.duration_s(self) -> int | None
OpenDota-style match duration: combat-log time at POST_GAME.
Source: src/gem/parser.py:403
Methods
net_tick
Signature: def ReplayParser.net_tick(self, value: int) -> None
No docstring available.
Source: src/gem/parser.py:317
game_time_s
Signature: def ReplayParser.game_time_s(self, value: int | None) -> None
No docstring available.
Source: src/gem/parser.py:326
game_clock
Signature: def ReplayParser.game_clock(self, value: GameClock) -> None
No docstring available.
Source: src/gem/parser.py:377
game_start_tick
Signature: def ReplayParser.game_start_tick(self, value: int | None) -> None
No docstring available.
Source: src/gem/parser.py:386
combat_log_time_s
Signature: def ReplayParser.combat_log_time_s(self, value: int | None) -> None
No docstring available.
Source: src/gem/parser.py:399
duration_s
Signature: def ReplayParser.duration_s(self, value: int | None) -> None
No docstring available.
Source: src/gem/parser.py:408
on_entity
Signature: def ReplayParser.on_entity(self, callback: EntityCallback) -> None
Register a handler called for every entity create/update/delete.
Source: src/gem/parser.py:415
on_tick_start
Signature: def ReplayParser.on_tick_start(self, callback: TickStartCallback) -> None
Register a handler called before the current tick's entity deltas.
Source: src/gem/parser.py:447
on_game_event
Signature: def ReplayParser.on_game_event(self, name: str, handler: GameEventHandler) -> None
Register a handler for the named game event.
Source: src/gem/parser.py:477
on_combat_log_entry
Signature: def ReplayParser.on_combat_log_entry(self, handler: CombatLogHandler) -> None
Register a handler for all combat log entries (S1 + S2).
Source: src/gem/parser.py:486
on_chat_message
Signature: def ReplayParser.on_chat_message(self, handler: ChatCallback) -> None
Register a handler for all-chat and team-chat messages.
Source: src/gem/parser.py:494
on_chat_event
Signature: def ReplayParser.on_chat_event(self, handler: ChatEventCallback) -> None
Register a handler for all CDOTAUserMsg_ChatEvent messages.
Source: src/gem/parser.py:502
on_neutral_item_found
Signature: def ReplayParser.on_neutral_item_found(self, handler: NeutralItemFoundCallback) -> None
Register a handler for neutral item found messages.
Source: src/gem/parser.py:510
on_game_start
Signature: def ReplayParser.on_game_start(self, callback: Callable[[int], None]) -> None
Register a handler called once when game time reaches zero.
Source: src/gem/parser.py:518
on_game_end
Signature: def ReplayParser.on_game_end(self, callback: Callable[[int], None]) -> None
Register a handler called once when the ancient is destroyed.
Source: src/gem/parser.py:530
stop_after_tick
Signature: def ReplayParser.stop_after_tick(self, tick: int) -> None
Stop parsing after this tick (inclusive).
Source: src/gem/parser.py:572
parse
Signature: def ReplayParser.parse(self) -> None
Parse the replay from start to finish (or until stop_after_tick).
Source: src/gem/parser.py:584
Module gem.errors
Exceptions for problems in the replay data itself.
Source: src/gem/errors.py
Top-level classes
ReplayDataError
class ReplayDataError(ValueError)The replay's bytes can't be decoded: truncated, corrupt, or unsupported.
Source: src/gem/errors.py:18
TruncatedReplayError
class TruncatedReplayError(ReplayDataError, EOFError)The replay file ends in the middle of a message.
Source: src/gem/errors.py:22
VarintOverflowError
class VarintOverflowError(ReplayDataError, OverflowError)A varint in the replay encodes a value too large for its type.
Source: src/gem/errors.py:26
UnsupportedReplayError
class UnsupportedReplayError(ReplayDataError, NotImplementedError)The replay uses a format gem doesn't support (e.g. LZSS string tables).
Source: src/gem/errors.py:30
UnknownStringTableError
class UnknownStringTableError(ReplayDataError, KeyError)A string-table update refers to a table that was never created.
Source: src/gem/errors.py:34
EntityStateError
class EntityStateError(ReplayDataError, RuntimeError)An entity update contradicts the entity table (unknown class, missing entity).
Source: src/gem/errors.py:38