@my-swu/simulator-client / undoMessage
Function: undoMessage()
undoMessage():
ClientMessage
Defined in: packages/ts-sdk/src/messages.ts:48
Builds one undo socket message.
The server rolls back the latest accepted player action for the match. In AI matches, one human undo also consumes any AI responses that happened after that human action, pauses the AI, then automatically resumes it after the next successful human mutation.
In matches with other human seats, a sensitive undo (hidden information was revealed, or another player acted since) does not apply immediately: the server records it on GameState.pendingUndo, emits undoRequested, and waits for every other human seat to answer with an undoResponse.
Example:
ts
import { undoMessage } from '@my-swu/simulator-client'
// Undo frames ask the server to roll back the latest accepted player action.
const clientMessage = undoMessage()
console.log(clientMessage.type)Returns
Example
ts
import { undoMessage } from '@my-swu/simulator-client'
const clientMessage = undoMessage()
console.log(clientMessage.type)