#[non_exhaustive]pub enum GameEvent {
Show 17 variants
GameState(GameStateEvent),
ClientAction(ClientActionEvent),
MatchState(MatchStateEvent),
DraftBot(DraftBotEvent),
DraftHuman(DraftHumanEvent),
DraftComplete(DraftCompleteEvent),
EventLifecycle(EventLifecycleEvent),
Session(SessionEvent),
Rank(RankEvent),
Inventory(InventoryEvent),
GameResult(GameResultEvent),
LogFileRotated(LogFileRotatedEvent),
DetailedLoggingStatus(DetailedLoggingStatusEvent),
MatchConnectionState(MatchConnectionStateEvent),
TcpConnectionClose(TcpConnectionCloseEvent),
WebSocketClosed(WebSocketClosedEvent),
ConnectionError(ConnectionErrorEvent),
}Expand description
A parsed MTG Arena log event.
Each variant wraps a category-specific struct containing parsed fields, the original raw log bytes, and a precomputed payload hash. Consumers subscribe to the event bus and pattern-match on this enum.
Marked #[non_exhaustive] so that new event categories can be added
in future releases without a breaking change for downstream consumers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
GameState(GameStateEvent)
GRE-to-client messages: GameStateMessage, ConnectResp,
QueuedGameStateMessage. Class 1 — interactive dispatch.
ClientAction(ClientActionEvent)
Client-to-GRE messages: SelectNResp, SubmitDeckResp,
MulliganResp. Class 1 — interactive dispatch.
MatchState(MatchStateEvent)
Match room state changes (matchGameRoomStateChangedEvent).
Class 1 — interactive dispatch.
DraftBot(DraftBotEvent)
Bot draft picks (DraftStatus: "PickNext", BotDraft_DraftPick).
Class 2 — durable per-event.
DraftHuman(DraftHumanEvent)
Human draft picks (Draft.Notify, EventPlayerDraftMakePick).
Class 2 — durable per-event.
DraftComplete(DraftCompleteEvent)
Draft completion (Draft_CompleteDraft).
Class 2 — durable per-event.
EventLifecycle(EventLifecycleEvent)
Event lifecycle: ==> EventJoin, ==> EventClaimPrize,
==> EventEnterPairing. Class 2 — durable per-event.
Session(SessionEvent)
Session: login, account identity, logout. Class 2 — durable per-event.
Rank(RankEvent)
Rank snapshot (<== RankGetCombinedRankInfo).
Class 2 — durable per-event.
Inventory(InventoryEvent)
Inventory snapshot (<== StartHook with InventoryInfo):
currency, wildcards, etc. Class 2 — durable per-event.
GameResult(GameResultEvent)
Game result (GameStage_GameOver from GRE GameStateMessage).
Class 3 — triggers post-game batch assembly.
LogFileRotated(LogFileRotatedEvent)
Log file rotation detected — Player.log was replaced (MTGA restart).
Emitted by the file tailer when it detects that the log file at the monitored path has been replaced (file size shrinkage or mtime jump). Downstream consumers should reset their state for a new session. Class 1 — interactive dispatch (local reset signal).
DetailedLoggingStatus(DetailedLoggingStatusEvent)
Detailed logging status change detected.
Emitted by the file tailer when it determines whether Arena’s
“Detailed Logs (Plugin Support)” setting is enabled. enabled: false
is emitted after 30 seconds of observed log writes without any
[UnityCrossThreadLogger] or [Client GRE] headers. enabled: true
is emitted if structured headers are later detected (user enabled the
setting and restarted Arena).
Class 1 — interactive dispatch (local status signal).
MatchConnectionState(MatchConnectionStateEvent)
Match connection state machine transition (STATE CHANGED).
Parsed from [UnityCrossThreadLogger]STATE CHANGED {"old":"...","new":"..."}
entries. Payload is {"old": "<state>", "new": "<state>"}. Drives the
connection health indicator (AC-DET-1) — the definitive signal for
local-client disconnect detection.
Class 1 — interactive dispatch.
TcpConnectionClose(TcpConnectionCloseEvent)
TCP connection close event (Client.TcpConnection.Close).
Parsed from [UnityCrossThreadLogger]Client.TcpConnection.Close {...}
entries. The payload is the full parsed JSON from the log line,
preserving status, reason, and abnormal-close-only fields
(function, description, exception). Feeds the desktop
connection health monitor (AC-DET-2); the parser is agnostic to
status semantics (per ADR-011).
Class 1 — interactive dispatch.
WebSocketClosed(WebSocketClosedEvent)
WebSocket close event (GREConnection.HandleWebSocketClosed).
Parsed from
[UnityCrossThreadLogger]GREConnection.HandleWebSocketClosed {...}
entries. The payload is the full parsed JSON from the log line,
which always includes closeType, reason, and a nested tcpConn
object snapshot of the paired TCP connection. Feeds the desktop
connection health monitor (AC-DET-3); the parser is agnostic to
closeType semantics (per ADR-011).
Class 1 — interactive dispatch.
ConnectionError(ConnectionErrorEvent)
Connection error event (error-path markers).
Parsed from four JSON-bearing markers under [UnityCrossThreadLogger]:
TcpConnection.ProcessRead.Exception,
Client.TcpConnection.ProcessFailure,
GREConnection.MatchDoorConnectionError, and
TcpConnection.Close.Exception. Each variant is discriminated by a
stable error_type string and wraps the full parsed JSON under a
payload key. Feeds the desktop connection health monitor (AC-DET-5);
the parser is agnostic to inner error-code semantics (per ADR-011).
Class 1 — interactive dispatch.
Implementations§
Source§impl GameEvent
impl GameEvent
Sourcepub fn performance_class(&self) -> PerformanceClass
pub fn performance_class(&self) -> PerformanceClass
Returns the performance class for this event.
- Class 1: interactive dispatch (local, ≤ 100 ms)
- Class 2: durable per-event upload
- Class 3: post-game batch upload trigger
Sourcepub fn metadata(&self) -> &EventMetadata
pub fn metadata(&self) -> &EventMetadata
Returns the shared metadata common to all events.