Skip to main content

GameEvent

Enum GameEvent 

Source
#[non_exhaustive]
pub enum GameEvent {
Show 18 variants GameState(GameStateEvent), ClientAction(ClientActionEvent), MatchState(MatchStateEvent), DraftBot(DraftBotEvent), DraftHuman(DraftHumanEvent), DraftComplete(DraftCompleteEvent), EventLifecycle(EventLifecycleEvent), Session(SessionEvent), Rank(RankEvent), DeckCollection(DeckCollectionEvent), 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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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 events (<== BotDraftDraftStatus, <== BotDraftDraftPick, ==> BotDraftDraftPick). 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.

§

DeckCollection(DeckCollectionEvent)

Deck snapshot (<== StartHook with DeckSummaries and Decks). 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

Source

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
Source

pub fn metadata(&self) -> &EventMetadata

Returns the shared metadata common to all events.

Source

pub fn payload(&self) -> &Value

Returns the parsed JSON payload of the event.

Trait Implementations§

Source§

impl Clone for GameEvent

Source§

fn clone(&self) -> GameEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GameEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for GameEvent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for GameEvent

Source§

fn eq(&self, other: &GameEvent) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for GameEvent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for GameEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,