Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / MatchSessionOptions

Interface: MatchSessionOptions ​

Defined in: packages/ts-sdk/src/match-session/session-state.ts:173

Options for creating one SDK-owned match session.

These options configure session-owned state, event retention, and default socket handshake behavior.

Example:

ts
import type { MatchSessionOptions } from '@my-swu/simulator-client'

const matchSessionOptions: MatchSessionOptions = { handshakeTimeoutMs: 10_000, maxEventHistory: 25 }

console.log(matchSessionOptions)

See ​

https://simulator-sdk.my-swu.com/guide/match-session

Extends ​

Properties ​

autoReconnect? ​

Example:

ts
import type { MatchSessionOptions } from '@my-swu/simulator-client'

const matchSessionOptions: MatchSessionOptions = { handshakeTimeoutMs: 10_000, maxEventHistory: 25 }

const { autoReconnect } = matchSessionOptions

console.log(autoReconnect)

optional autoReconnect?: MatchSessionAutoReconnectOptions

Defined in: packages/ts-sdk/src/match-session/session-state.ts:175

Opt-in automatic reconnect policy for abnormal socket closes.


handshakeTimeoutMs? ​

Example:

ts
import type { MatchSessionOptions } from '@my-swu/simulator-client'

const matchSessionOptions: MatchSessionOptions = { handshakeTimeoutMs: 10_000, maxEventHistory: 25 }

const { handshakeTimeoutMs } = matchSessionOptions

console.log(handshakeTimeoutMs)

optional handshakeTimeoutMs?: number

Defined in: packages/ts-sdk/src/match-session/session-state.ts:111

Milliseconds to wait for welcome plus first snapshot.

Inherited from ​

MatchSessionConnectOptions.handshakeTimeoutMs


maxErrorHistory? ​

Example:

ts
import type { MatchSessionOptions } from '@my-swu/simulator-client'

const matchSessionOptions: MatchSessionOptions = { handshakeTimeoutMs: 10_000, maxEventHistory: 25 }

const { maxErrorHistory } = matchSessionOptions

console.log(maxErrorHistory)

optional maxErrorHistory?: number

Defined in: packages/ts-sdk/src/match-session/session-state.ts:179

Maximum number of recent errors retained by the session.


maxEventHistory? ​

Example:

ts
import type { MatchSessionOptions } from '@my-swu/simulator-client'

const matchSessionOptions: MatchSessionOptions = { handshakeTimeoutMs: 10_000, maxEventHistory: 25 }

const { maxEventHistory } = matchSessionOptions

console.log(maxEventHistory)

optional maxEventHistory?: number

Defined in: packages/ts-sdk/src/match-session/session-state.ts:177

Maximum number of recent game events retained by the session.

Released under the MIT License.