Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / undoResponseMessage

Function: undoResponseMessage() ​

undoResponseMessage(approve): ClientMessage

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

Builds one undoResponse socket message.

Answers the pending undo approval request carried by GameState.pendingUndo. Approving as the last outstanding seat applies the undo; declining cancels it. A response sent by the original requester withdraws the request regardless of approve.

Example:

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

// The opponent answers an undo request with approve or reject.
const clientMessage = undoResponseMessage(true)

console.log(clientMessage.type)

Parameters ​

approve ​

Example:

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

// The opponent answers an undo request with approve or reject.
const clientMessage = undoResponseMessage(true)

console.log(clientMessage.type)

boolean

Returns ​

ClientMessage

Example ​

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

const clientMessage = undoResponseMessage(true)
console.log(clientMessage.type)

See ​

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

Released under the MIT License.