Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / formatEventMessage

Function: formatEventMessage() ​

formatEventMessage(command): ClientMessage

Defined in: packages/ts-sdk/src/messages.ts:226

Wraps one format-event command into a socket envelope.

Example:

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

// Format events drive out-of-game flows such as next-game readiness.
const clientMessage = formatEventMessage({ type: 'readyNextGame' })

console.log(clientMessage.type)

Parameters ​

command ​

Example:

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

// Format events drive out-of-game flows such as next-game readiness.
const clientMessage = formatEventMessage({ type: 'readyNextGame' })

console.log(clientMessage.type)

FormatEventCommand

Returns ​

ClientMessage

Example ​

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

const clientMessage = formatEventMessage({ type: 'readyNextGame' })
console.log(clientMessage.type)

See ​

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

Released under the MIT License.