Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / commandMessage

Function: commandMessage() ​

commandMessage(command): ClientMessage

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

Wraps one game command into a socket envelope.

Example:

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

// Command messages carry player choices such as pass or attack.
const clientMessage = commandMessage('pass')

console.log(clientMessage.type)

Parameters ​

command ​

Example:

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

// Command messages carry player choices such as pass or attack.
const clientMessage = commandMessage('pass')

console.log(clientMessage.type)

GameCommand

Returns ​

ClientMessage

Example ​

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

const clientMessage = commandMessage('pass')
console.log(clientMessage.type)

See ​

https://simulator-sdk.my-swu.com/guide/driving-gameplay

Released under the MIT License.