Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / LobbiesResource

Interface: LobbiesResource ​

Defined in: packages/ts-sdk/src/resources/lobbies.ts:44

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

console.log(lobbiesResource)

Methods ​

acceptMatchmaking() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { acceptMatchmaking } = lobbiesResource

console.log(acceptMatchmaking)

acceptMatchmaking(lobbyId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:52

Parameters ​

lobbyId ​

string

request ​

LobbyMatchmakingDecisionRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


addAiPlayer() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { addAiPlayer } = lobbiesResource

console.log(addAiPlayer)

addAiPlayer(lobbyId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:95

Parameters ​

lobbyId ​

string

request ​

AddLobbyAiPlayerRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


becomeSpectator() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { becomeSpectator } = lobbiesResource

console.log(becomeSpectator)

becomeSpectator(lobbyId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:84

Gives up the caller's waiting seat and admits them as a spectator of the same lobby in one step. The response carries the new spectator credential; the old seat token is released.

Parameters ​

lobbyId ​

string

request ​

BecomeLobbySpectatorRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


create() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { create } = lobbiesResource

console.log(create)

create(request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:45

Parameters ​

request ​

CreateLobbyRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


createSession() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { createSession } = lobbiesResource

console.log(createSession)

createSession(access): LobbySession

Defined in: packages/ts-sdk/src/resources/lobbies.ts:155

Parameters ​

access ​

LobbyAccessResponse | LobbyAccessInput

Returns ​

LobbySession


declineMatchmaking() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { declineMatchmaking } = lobbiesResource

console.log(declineMatchmaking)

declineMatchmaking(lobbyId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:57

Parameters ​

lobbyId ​

string

request ​

LobbyMatchmakingDecisionRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


get() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { get } = lobbiesResource

console.log(get)

get(lobbyId, options?): Promise<LobbySnapshot>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:72

Parameters ​

lobbyId ​

string

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbySnapshot>


join() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { join } = lobbiesResource

console.log(join)

join(lobbyId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:73

Parameters ​

lobbyId ​

string

request ​

JoinLobbyRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


kickPlayer() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { kickPlayer } = lobbiesResource

console.log(kickPlayer)

kickPlayer(lobbyId, playerId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:111

Parameters ​

lobbyId ​

string

playerId ​

string

request ​

KickLobbyPlayerRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


kickSpectator() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { kickSpectator } = lobbiesResource

console.log(kickSpectator)

kickSpectator(lobbyId, spectatorId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:117

Parameters ​

lobbyId ​

string

spectatorId ​

string

request ​

KickLobbySpectatorRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


leave() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { leave } = lobbiesResource

console.log(leave)

leave(lobbyId, request, options?): Promise<void>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:154

Leaves a lobby. Accepts a player token or a spectator token (the playerToken of a spectator access); a spectator simply stops watching.

Parameters ​

lobbyId ​

string

request ​

LeaveLobbyRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<void>


list() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { list } = lobbiesResource

console.log(list)

list(options?): Promise<LobbyListResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:62

Parameters ​

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyListResponse>


matchmake() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { matchmake } = lobbiesResource

console.log(matchmake)

matchmake(request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:51

Queues the player through the unified matchmaking entry point. The server chooses the pairing pool; the response never reveals more than the shared lobby matchmaking handshake.

Parameters ​

request ​

LobbyMatchmakingRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


prepareLimitedAiDecks() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { prepareLimitedAiDecks } = lobbiesResource

console.log(prepareLimitedAiDecks)

prepareLimitedAiDecks(lobbyId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:135

Parameters ​

lobbyId ​

string

request ​

PrepareLobbyLimitedAiDecksRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


returnMatch() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { returnMatch } = lobbiesResource

console.log(returnMatch)

returnMatch(lobbyId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:125

Parameters ​

lobbyId ​

string

request ​

ReturnLobbyMatchRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


sendChat() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { sendChat } = lobbiesResource

console.log(sendChat)

sendChat(lobbyId, request, options?): Promise<LobbyChatResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:123

Parameters ​

lobbyId ​

string

request ​

LobbyChatRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyChatResponse>


spectate() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { spectate } = lobbiesResource

console.log(spectate)

spectate(lobbyId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:74

Parameters ​

lobbyId ​

string

request ​

SpectateLobbyRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


start() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { start } = lobbiesResource

console.log(start)

start(lobbyId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:124

Parameters ​

lobbyId ​

string

request ​

StartLobbyRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


startLimitedMatch() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { startLimitedMatch } = lobbiesResource

console.log(startLimitedMatch)

startLimitedMatch(lobbyId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:145

Hands a completed limited event to play. Tournament lobbies start their next round instead: every seated human receives live match access, and AI-versus-AI tables resolve instantly.

Parameters ​

lobbyId ​

string

request ​

StartLobbyLimitedMatchRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


submitLimitedDeck() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { submitLimitedDeck } = lobbiesResource

console.log(submitLimitedDeck)

submitLimitedDeck(lobbyId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:130

Parameters ​

lobbyId ​

string

request ​

SubmitLobbyLimitedDeckRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


subscribeList() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { subscribeList } = lobbiesResource

console.log(subscribeList)

subscribeList(options?): LobbyListSession

Defined in: packages/ts-sdk/src/resources/lobbies.ts:71

Subscribes to live public lobby-list updates over GET /ws/lobbies.

Returns a session controller that opens an unauthenticated WebSocket, emits the current list on connect and a fresh full snapshot on every change, and auto-reconnects on abnormal close. Prefer this over polling list; keep list as a one-shot fallback when the socket cannot open.

Parameters ​

options? ​

LobbyListSessionOptions

Returns ​

LobbyListSession


sync() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { sync } = lobbiesResource

console.log(sync)

sync(lobbyId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:89

Parameters ​

lobbyId ​

string

request ​

LobbySyncRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


updateAiPlayer() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { updateAiPlayer } = lobbiesResource

console.log(updateAiPlayer)

updateAiPlayer(lobbyId, playerId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:100

Parameters ​

lobbyId ​

string

playerId ​

string

request ​

UpdateLobbyAiPlayerRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


updatePlayer() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { updatePlayer } = lobbiesResource

console.log(updatePlayer)

updatePlayer(lobbyId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:90

Parameters ​

lobbyId ​

string

request ​

UpdateLobbyPlayerRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>


updateSettings() ​

Example:

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

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const lobbiesResource = simulatorClient.lobbies

const { updateSettings } = lobbiesResource

console.log(updateSettings)

updateSettings(lobbyId, request, options?): Promise<LobbyAccessResponse>

Defined in: packages/ts-sdk/src/resources/lobbies.ts:106

Parameters ​

lobbyId ​

string

request ​

UpdateLobbySettingsRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<LobbyAccessResponse>

Released under the MIT License.