Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / RestoreMatchSaveResponse

Interface: RestoreMatchSaveResponse ​

Defined in: packages/ts-sdk/src/generated/types/common.ts:5373

Response body for POST /api/matches/restore.

Example:

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

const restoreMatchSaveResponse: RestoreMatchSaveResponse = {
  "matchId": 'example',
  "accesses": [],
  "snapshot": {
    "matchId": 'example',
    "format": "premier",
    "playerCount": 2,
    "series": {
      "format": "premier",
      "bestOfGames": 1,
      "currentGameNumber": 0,
      "games": [],
      "seats": [],
    },
    "status": "lobby",
    "phase": "lobby",
    "prompt": "lobbyReady",
    "roundNumber": 0,
    "turnPlayer": "one",
    "initiative": {
      "available": false,
    },
    "availableCounters": [],
    "consecutivePasses": 0,
    "winners": [],
    "eventsApplied": 0,
    "activeEffects": [],
    "delayedEffects": [],
    "currentAttack": {
      "attackerId": 0,
      "target": {
        "playerBase": {
          "seat": "one",
        },
      },
    },
    "pendingAbilities": [],
    "availableLeaderDeploys": [],
    "availableAttacks": [],
    "playActions": [],
    "rejectedPlayReasons": [],
    "actionAbilities": [],
    "groundArena": [],
    "spaceArena": [],
    "players": [],
  },
}

console.log(restoreMatchSaveResponse)

Properties ​

accesses ​

Example:

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

const restoreMatchSaveResponse: RestoreMatchSaveResponse = {
  "matchId": 'example',
  "accesses": [],
  "snapshot": {
    "matchId": 'example',
    "format": "premier",
    "playerCount": 2,
    "series": {
      "format": "premier",
      "bestOfGames": 1,
      "currentGameNumber": 0,
      "games": [],
      "seats": [],
    },
    "status": "lobby",
    "phase": "lobby",
    "prompt": "lobbyReady",
    "roundNumber": 0,
    "turnPlayer": "one",
    "initiative": {
      "available": false,
    },
    "availableCounters": [],
    "consecutivePasses": 0,
    "winners": [],
    "eventsApplied": 0,
    "activeEffects": [],
    "delayedEffects": [],
    "currentAttack": {
      "attackerId": 0,
      "target": {
        "playerBase": {
          "seat": "one",
        },
      },
    },
    "pendingAbilities": [],
    "availableLeaderDeploys": [],
    "availableAttacks": [],
    "playActions": [],
    "rejectedPlayReasons": [],
    "actionAbilities": [],
    "groundArena": [],
    "spaceArena": [],
    "players": [],
  },
}

const { accesses } = restoreMatchSaveResponse

console.log(accesses)

accesses: MatchAccessResponse[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:5379

Per-seat access tokens for the restored session. Original tokens are not preserved; SDK consumers should treat the restored match as a fresh session.


matchId ​

Example:

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

const restoreMatchSaveResponse: RestoreMatchSaveResponse = {
  "matchId": 'example',
  "accesses": [],
  "snapshot": {
    "matchId": 'example',
    "format": "premier",
    "playerCount": 2,
    "series": {
      "format": "premier",
      "bestOfGames": 1,
      "currentGameNumber": 0,
      "games": [],
      "seats": [],
    },
    "status": "lobby",
    "phase": "lobby",
    "prompt": "lobbyReady",
    "roundNumber": 0,
    "turnPlayer": "one",
    "initiative": {
      "available": false,
    },
    "availableCounters": [],
    "consecutivePasses": 0,
    "winners": [],
    "eventsApplied": 0,
    "activeEffects": [],
    "delayedEffects": [],
    "currentAttack": {
      "attackerId": 0,
      "target": {
        "playerBase": {
          "seat": "one",
        },
      },
    },
    "pendingAbilities": [],
    "availableLeaderDeploys": [],
    "availableAttacks": [],
    "playActions": [],
    "rejectedPlayReasons": [],
    "actionAbilities": [],
    "groundArena": [],
    "spaceArena": [],
    "players": [],
  },
}

const { matchId } = restoreMatchSaveResponse

console.log(matchId)

matchId: string

Defined in: packages/ts-sdk/src/generated/types/common.ts:5383

Newly minted match id for the restored session.


snapshot ​

Example:

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

const restoreMatchSaveResponse: RestoreMatchSaveResponse = {
  "matchId": 'example',
  "accesses": [],
  "snapshot": {
    "matchId": 'example',
    "format": "premier",
    "playerCount": 2,
    "series": {
      "format": "premier",
      "bestOfGames": 1,
      "currentGameNumber": 0,
      "games": [],
      "seats": [],
    },
    "status": "lobby",
    "phase": "lobby",
    "prompt": "lobbyReady",
    "roundNumber": 0,
    "turnPlayer": "one",
    "initiative": {
      "available": false,
    },
    "availableCounters": [],
    "consecutivePasses": 0,
    "winners": [],
    "eventsApplied": 0,
    "activeEffects": [],
    "delayedEffects": [],
    "currentAttack": {
      "attackerId": 0,
      "target": {
        "playerBase": {
          "seat": "one",
        },
      },
    },
    "pendingAbilities": [],
    "availableLeaderDeploys": [],
    "availableAttacks": [],
    "playActions": [],
    "rejectedPlayReasons": [],
    "actionAbilities": [],
    "groundArena": [],
    "spaceArena": [],
    "players": [],
  },
}

const { snapshot: matchSnapshot } = restoreMatchSaveResponse

console.log(matchSnapshot)

snapshot: GameState

Defined in: packages/ts-sdk/src/generated/types/common.ts:5388

Public game state of the restored session, identical in shape to a GET /api/matches/{id} snapshot.

Released under the MIT License.