@edv4h/usketch-plugin-croupier 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +84 -2
- package/dist/awareness-presence.d.ts +22 -0
- package/dist/awareness-presence.d.ts.map +1 -0
- package/dist/awareness-presence.js +57 -0
- package/dist/awareness-presence.js.map +1 -0
- package/dist/croupier-service.d.ts +68 -0
- package/dist/croupier-service.d.ts.map +1 -0
- package/dist/croupier-service.js +133 -0
- package/dist/croupier-service.js.map +1 -0
- package/dist/game-state.d.ts +44 -0
- package/dist/game-state.d.ts.map +1 -0
- package/dist/game-state.js +55 -0
- package/dist/game-state.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +59 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +256 -0
- package/dist/plugin.js.map +1 -0
- package/dist/table-ops.d.ts +100 -0
- package/dist/table-ops.d.ts.map +1 -0
- package/dist/table-ops.js +505 -0
- package/dist/table-ops.js.map +1 -0
- package/dist/table-shape.d.ts +59 -0
- package/dist/table-shape.d.ts.map +1 -0
- package/dist/table-shape.js +185 -0
- package/dist/table-shape.js.map +1 -0
- package/dist/types.d.ts +117 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +14 -0
- package/dist/types.js.map +1 -0
- package/package.json +49 -3
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getActiveTimeoutMs } from "@edv4h/croupier-core";
|
|
3
|
+
import { createAddShapeCommand } from "@edv4h/usketch-store";
|
|
4
|
+
import { createCroupierApi, croupierService, } from "./croupier-service.js";
|
|
5
|
+
import { bindGameState, readGameState } from "./game-state.js";
|
|
6
|
+
import { DEFAULT_TABLE_SIZE, listSeats, listTables, repairTables, } from "./table-ops.js";
|
|
7
|
+
import { seatShapeDefinition, tableShapeDefinition, } from "./table-shape.js";
|
|
8
|
+
import { CROUPIER_SEAT_TYPE, CROUPIER_TABLE_TYPE, } from "./types.js";
|
|
9
|
+
export const CROUPIER_TABLE_TOOL_ID = "croupier-table-draw";
|
|
10
|
+
const WATCH_INTERVAL_MS = 2000;
|
|
11
|
+
function DefaultToolIcon() {
|
|
12
|
+
return (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", "aria-hidden": true, children: [_jsx("rect", { x: "2.5", y: "5", width: "15", height: "10", rx: "5", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("rect", { x: "8", y: "7.5", width: "4", height: "5", rx: "0.8", fill: "currentColor" })] }));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Plays croupier (`@edv4h/croupier-core`) games on the board. A `croupier-table`
|
|
16
|
+
* shape holds the game and its engine snapshot; each joined player gets a
|
|
17
|
+
* `croupier-seat` child shape. The plugin knows no rules — games come from
|
|
18
|
+
* {@link CroupierPluginOptions.games}. Operations are on the
|
|
19
|
+
* {@link croupierService} (and the HUD actions call the same functions).
|
|
20
|
+
*/
|
|
21
|
+
export function createCroupierPlugin(options) {
|
|
22
|
+
return {
|
|
23
|
+
id: "usketch-plugin-croupier",
|
|
24
|
+
name: "クルーピエ",
|
|
25
|
+
setup(ctx) {
|
|
26
|
+
const registry = new Map(options.games.map((g) => [g.id, g]));
|
|
27
|
+
const now = options.now ?? Date.now;
|
|
28
|
+
const tableSize = options.tableSize ?? DEFAULT_TABLE_SIZE;
|
|
29
|
+
const unbindGameState = options.gameState
|
|
30
|
+
? bindGameState(ctx.store, options.gameState)
|
|
31
|
+
: () => { };
|
|
32
|
+
const api = createCroupierApi({
|
|
33
|
+
store: ctx.store,
|
|
34
|
+
registry,
|
|
35
|
+
player: options.player,
|
|
36
|
+
presence: options.presence,
|
|
37
|
+
gameState: options.gameState,
|
|
38
|
+
now,
|
|
39
|
+
tableSize,
|
|
40
|
+
// Creating / removing a table is undoable like any shape.
|
|
41
|
+
addShape: (shape) => ctx.commands.execute(createAddShapeCommand(ctx.store, shape)),
|
|
42
|
+
});
|
|
43
|
+
const unprovide = croupierService.provide(ctx.services, api);
|
|
44
|
+
ctx.shapes.register(CROUPIER_TABLE_TYPE, tableShapeDefinition({
|
|
45
|
+
api,
|
|
46
|
+
renderTable: options.renderTable,
|
|
47
|
+
tableSize,
|
|
48
|
+
defaultGame: () => api.getPendingGame(),
|
|
49
|
+
}));
|
|
50
|
+
ctx.shapes.register(CROUPIER_SEAT_TYPE, seatShapeDefinition({ api, renderSeat: options.renderSeat }));
|
|
51
|
+
// ── Placement tool: click places a table of the pending game ──
|
|
52
|
+
if (options.tool !== false) {
|
|
53
|
+
ctx.tools.register(CROUPIER_TABLE_TOOL_ID, {
|
|
54
|
+
icon: options.toolIcon ?? DefaultToolIcon,
|
|
55
|
+
label: "ゲームテーブル",
|
|
56
|
+
cursor: "crosshair",
|
|
57
|
+
onPointerDown: (toolCtx, event) => {
|
|
58
|
+
const game = api.getPendingGame();
|
|
59
|
+
if (!game)
|
|
60
|
+
return;
|
|
61
|
+
const id = api.createTable(game, event.worldPoint);
|
|
62
|
+
if (id)
|
|
63
|
+
toolCtx.store.setSelection([id]);
|
|
64
|
+
toolCtx.store.resetToDefaultTool();
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
// ── HUD actions (Controls → "Croupier") ──
|
|
69
|
+
const selectedTable = () => {
|
|
70
|
+
for (const id of ctx.store.getSelection()) {
|
|
71
|
+
const shape = ctx.store.getShape(id);
|
|
72
|
+
if (shape?.type === CROUPIER_TABLE_TYPE)
|
|
73
|
+
return shape;
|
|
74
|
+
}
|
|
75
|
+
return undefined;
|
|
76
|
+
};
|
|
77
|
+
const viewOfSelected = () => {
|
|
78
|
+
const table = selectedTable();
|
|
79
|
+
return table ? api.getView(table.id) : undefined;
|
|
80
|
+
};
|
|
81
|
+
const offActions = [
|
|
82
|
+
...options.games.map((game, i) => ctx.actions.register({
|
|
83
|
+
id: `croupier:new-table:${game.id}`,
|
|
84
|
+
label: `${game.label} のテーブルを置く`,
|
|
85
|
+
group: "Croupier",
|
|
86
|
+
order: i,
|
|
87
|
+
run: () => {
|
|
88
|
+
const vp = ctx.store.getViewport();
|
|
89
|
+
const center = {
|
|
90
|
+
x: (window.innerWidth / 2 - vp.x) / vp.zoom,
|
|
91
|
+
y: (window.innerHeight / 2 - vp.y) / vp.zoom,
|
|
92
|
+
};
|
|
93
|
+
const id = api.createTable(game.id, center);
|
|
94
|
+
if (id)
|
|
95
|
+
ctx.store.setSelection([id]);
|
|
96
|
+
},
|
|
97
|
+
})),
|
|
98
|
+
ctx.actions.register({
|
|
99
|
+
id: "croupier:join",
|
|
100
|
+
label: "選択中のテーブルに参加",
|
|
101
|
+
group: "Croupier",
|
|
102
|
+
order: 100,
|
|
103
|
+
isEnabled: () => viewOfSelected()?.canJoin ?? false,
|
|
104
|
+
run: () => {
|
|
105
|
+
const table = selectedTable();
|
|
106
|
+
if (table)
|
|
107
|
+
api.join(table.id);
|
|
108
|
+
},
|
|
109
|
+
}),
|
|
110
|
+
ctx.actions.register({
|
|
111
|
+
id: "croupier:leave",
|
|
112
|
+
label: "選択中のテーブルから抜ける",
|
|
113
|
+
group: "Croupier",
|
|
114
|
+
order: 101,
|
|
115
|
+
isEnabled: () => {
|
|
116
|
+
const view = viewOfSelected();
|
|
117
|
+
return view?.phase === "lobby" && view.mySeat !== undefined;
|
|
118
|
+
},
|
|
119
|
+
run: () => {
|
|
120
|
+
const table = selectedTable();
|
|
121
|
+
if (table)
|
|
122
|
+
api.leave(table.id);
|
|
123
|
+
},
|
|
124
|
+
}),
|
|
125
|
+
ctx.actions.register({
|
|
126
|
+
id: "croupier:start",
|
|
127
|
+
label: "選択中のテーブルでスタート",
|
|
128
|
+
group: "Croupier",
|
|
129
|
+
order: 102,
|
|
130
|
+
isEnabled: () => viewOfSelected()?.canStart ?? false,
|
|
131
|
+
run: () => {
|
|
132
|
+
const table = selectedTable();
|
|
133
|
+
if (table)
|
|
134
|
+
api.start(table.id);
|
|
135
|
+
},
|
|
136
|
+
}),
|
|
137
|
+
ctx.actions.register({
|
|
138
|
+
id: "croupier:reset",
|
|
139
|
+
label: "選択中のテーブルをロビーに戻す",
|
|
140
|
+
group: "Croupier",
|
|
141
|
+
order: 103,
|
|
142
|
+
isEnabled: () => {
|
|
143
|
+
const view = viewOfSelected();
|
|
144
|
+
return (view?.isHost ?? false) && view?.phase !== "lobby";
|
|
145
|
+
},
|
|
146
|
+
run: () => {
|
|
147
|
+
const table = selectedTable();
|
|
148
|
+
if (table)
|
|
149
|
+
api.reset(table.id);
|
|
150
|
+
},
|
|
151
|
+
}),
|
|
152
|
+
];
|
|
153
|
+
// ── Housekeeping: reset copied tables, drop seats of deleted tables ──
|
|
154
|
+
let lastShapes = null;
|
|
155
|
+
let seenTables = new Set();
|
|
156
|
+
const repair = () => {
|
|
157
|
+
const shapes = ctx.store.getShapes();
|
|
158
|
+
if (shapes === lastShapes)
|
|
159
|
+
return;
|
|
160
|
+
lastShapes = shapes;
|
|
161
|
+
const tables = new Set(listTables(ctx.store).map((t) => t.id));
|
|
162
|
+
const removed = new Set([...seenTables].filter((id) => !tables.has(id)));
|
|
163
|
+
seenTables = tables;
|
|
164
|
+
repairTables(ctx.store, removed);
|
|
165
|
+
};
|
|
166
|
+
const offRepair = ctx.store.subscribe(repair);
|
|
167
|
+
repair();
|
|
168
|
+
// ── Absent players (host's client only) ──
|
|
169
|
+
const awayGraceMs = options.awayGraceMs;
|
|
170
|
+
const grace = awayGraceMs === false ? Number.POSITIVE_INFINITY : (awayGraceMs ?? 20_000);
|
|
171
|
+
const offlineSince = new Map();
|
|
172
|
+
const busy = new Set();
|
|
173
|
+
// Snapshot revision at which a takeover last failed, per table: retry only
|
|
174
|
+
// once the game moved, instead of re-running the bot every tick.
|
|
175
|
+
const failedRevision = new Map();
|
|
176
|
+
const watch = () => {
|
|
177
|
+
const presence = options.presence;
|
|
178
|
+
const t = now();
|
|
179
|
+
const online = (userId) => presence?.isOnline(userId) ?? true;
|
|
180
|
+
const awayFor = (userId) => {
|
|
181
|
+
if (online(userId)) {
|
|
182
|
+
offlineSince.delete(userId);
|
|
183
|
+
return 0;
|
|
184
|
+
}
|
|
185
|
+
const since = offlineSince.get(userId) ?? t;
|
|
186
|
+
offlineSince.set(userId, since);
|
|
187
|
+
return t - since;
|
|
188
|
+
};
|
|
189
|
+
for (const table of listTables(ctx.store)) {
|
|
190
|
+
const me = api.me().userId;
|
|
191
|
+
const seats = listSeats(ctx.store, table.id);
|
|
192
|
+
if (!seats.some((s) => s.meta.userId === me))
|
|
193
|
+
continue;
|
|
194
|
+
// Host gone: the first connected player (in join order) takes over.
|
|
195
|
+
if (table.meta.hostUserId !== me) {
|
|
196
|
+
const host = table.meta.hostUserId;
|
|
197
|
+
const hostGone = !seats.some((s) => s.meta.userId === host) || awayFor(host) >= grace;
|
|
198
|
+
const firstOnline = seats.find((s) => online(s.meta.userId));
|
|
199
|
+
if (hostGone && firstOnline?.meta.userId === me)
|
|
200
|
+
api.claimHost(table.id);
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
if (table.meta.phase !== "playing" || busy.has(table.id))
|
|
204
|
+
continue;
|
|
205
|
+
const game = readGameState(ctx.store, table);
|
|
206
|
+
const revision = game?.snapshot.revision;
|
|
207
|
+
if (revision !== undefined && failedRevision.get(table.id) === revision)
|
|
208
|
+
continue;
|
|
209
|
+
const view = api.getView(table.id);
|
|
210
|
+
if (!view || view.isMyTurn)
|
|
211
|
+
continue;
|
|
212
|
+
const def = registry.get(table.meta.game);
|
|
213
|
+
const timeout = def
|
|
214
|
+
? getActiveTimeoutMs(def.createConfig(table.meta.options), {
|
|
215
|
+
phase: game?.snapshot.phase ?? "",
|
|
216
|
+
stage: game?.snapshot.stage,
|
|
217
|
+
currentPlayers: view.currentPlayers,
|
|
218
|
+
players: seats.map((s) => s.meta.userId),
|
|
219
|
+
finished: false,
|
|
220
|
+
})
|
|
221
|
+
: undefined;
|
|
222
|
+
const timedOut = timeout !== undefined &&
|
|
223
|
+
game?.turnStartedAt != null &&
|
|
224
|
+
t - game.turnStartedAt >= timeout;
|
|
225
|
+
const absent = view.currentPlayers.filter((p) => awayFor(p) >= grace);
|
|
226
|
+
if (absent.length === 0 && !timedOut)
|
|
227
|
+
continue;
|
|
228
|
+
busy.add(table.id);
|
|
229
|
+
// Play only for the absent players (several may be due at once); on a
|
|
230
|
+
// turn timeout, for everyone still due.
|
|
231
|
+
void api
|
|
232
|
+
.takeOver(table.id, timedOut ? undefined : absent)
|
|
233
|
+
.then((result) => {
|
|
234
|
+
if (result.ok)
|
|
235
|
+
failedRevision.delete(table.id);
|
|
236
|
+
else if (revision !== undefined)
|
|
237
|
+
failedRevision.set(table.id, revision);
|
|
238
|
+
})
|
|
239
|
+
.finally(() => busy.delete(table.id));
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
const timer = awayGraceMs === false ? null : setInterval(watch, WATCH_INTERVAL_MS);
|
|
243
|
+
return () => {
|
|
244
|
+
if (timer)
|
|
245
|
+
clearInterval(timer);
|
|
246
|
+
offRepair();
|
|
247
|
+
for (const off of offActions)
|
|
248
|
+
off();
|
|
249
|
+
unprovide();
|
|
250
|
+
api.dispose();
|
|
251
|
+
unbindGameState();
|
|
252
|
+
};
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAGN,iBAAiB,EACjB,eAAe,GACf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,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;gBACxC,CAAC;YACF,CAAC,CAAC;YACF,MAAM,KAAK,GAAG,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;YAEnF,OAAO,GAAG,EAAE;gBACX,IAAI,KAAK;oBAAE,aAAa,CAAC,KAAK,CAAC,CAAC;gBAChC,SAAS,EAAE,CAAC;gBACZ,KAAK,MAAM,GAAG,IAAI,UAAU;oBAAE,GAAG,EAAE,CAAC;gBACpC,SAAS,EAAE,CAAC;gBACZ,GAAG,CAAC,OAAO,EAAE,CAAC;gBACd,eAAe,EAAE,CAAC;YACnB,CAAC,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table operations as plain functions over a {@link BoardStore}. The HUD actions,
|
|
3
|
+
* the default renderer and the host-facing service all call these.
|
|
4
|
+
*
|
|
5
|
+
* Sync model: a board shape is synced as one value (last writer wins), so each
|
|
6
|
+
* kind of write is owned by one party —
|
|
7
|
+
* - the table (`croupier-table`): the host in the lobby / on reset, and the player
|
|
8
|
+
* whose turn it is while playing (only one writer at a time);
|
|
9
|
+
* - a seat (`croupier-seat`): the seated player (joining, leaving, the result note).
|
|
10
|
+
* Joining therefore adds a shape instead of editing a shared list, so two players
|
|
11
|
+
* joining at the same moment never drop each other.
|
|
12
|
+
*
|
|
13
|
+
* Game state is the engine's own snapshot (`CroupierCore#toSnapshot`). An action
|
|
14
|
+
* restores the engine from the table, dispatches, and writes the new snapshot back.
|
|
15
|
+
* Every client can read the snapshot (hidden information is only hidden by
|
|
16
|
+
* `getPlayerView`), which is the accepted trade-off of a serverless board.
|
|
17
|
+
*/
|
|
18
|
+
import { type PlayerId } from "@edv4h/croupier-core";
|
|
19
|
+
import type { BoardStore, ShapeData } from "@edv4h/usketch-shared";
|
|
20
|
+
import { type CroupierGameDefinition, type CroupierPlayer, type GameOptions, type OpResult, type SeatShape, type TableShape, type TableView } from "./types.js";
|
|
21
|
+
export declare const DEFAULT_TABLE_SIZE: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
export declare const SEAT_SIZE: {
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
};
|
|
29
|
+
/** Log entries kept in the snapshot (the table is rewritten every action, so keep it small). */
|
|
30
|
+
export declare const SNAPSHOT_LOG_LIMIT = 30;
|
|
31
|
+
export type GameRegistry = ReadonlyMap<string, CroupierGameDefinition>;
|
|
32
|
+
export declare function isTable(shape: ShapeData | undefined): shape is TableShape;
|
|
33
|
+
export declare function isSeat(shape: ShapeData | undefined): shape is SeatShape;
|
|
34
|
+
export declare function getTable(store: BoardStore, tableId: string): TableShape | undefined;
|
|
35
|
+
/** Seats of a table in join order (= turn order). */
|
|
36
|
+
export declare function listSeats(store: BoardStore, tableId: string): SeatShape[];
|
|
37
|
+
export declare function listTables(store: BoardStore): TableShape[];
|
|
38
|
+
/** Deterministic, so two tabs of the same user joining at once write the same seat. */
|
|
39
|
+
export declare function seatIdFor(tableId: string, userId: string): string;
|
|
40
|
+
export interface CreateTableParams {
|
|
41
|
+
id: string;
|
|
42
|
+
game: string;
|
|
43
|
+
/** Top-left of the table in world coordinates. */
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
host: CroupierPlayer;
|
|
47
|
+
options?: GameOptions;
|
|
48
|
+
size?: {
|
|
49
|
+
width: number;
|
|
50
|
+
height: number;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export declare function makeTableShape(registry: GameRegistry, params: CreateTableParams): TableShape;
|
|
54
|
+
/**
|
|
55
|
+
* Place seats in a row along the inside bottom edge of the table. Only seats whose
|
|
56
|
+
* geometry actually changes get a patch: every write is a sync, and the container
|
|
57
|
+
* arrange step applies these patches on every table update (e.g. each action).
|
|
58
|
+
*/
|
|
59
|
+
export declare function layoutSeats(table: ShapeData, seats: readonly ShapeData[]): Array<{
|
|
60
|
+
id: string;
|
|
61
|
+
patch: Partial<ShapeData>;
|
|
62
|
+
}>;
|
|
63
|
+
export declare function joinTable(store: BoardStore, registry: GameRegistry, tableId: string, player: CroupierPlayer, now: number): OpResult;
|
|
64
|
+
/** Leave the lobby (removes the seat). While playing the seat stays so the game can go on. */
|
|
65
|
+
export declare function leaveTable(store: BoardStore, tableId: string, userId: string): OpResult;
|
|
66
|
+
export declare function setTableOptions(store: BoardStore, tableId: string, actorId: string, options: GameOptions): OpResult;
|
|
67
|
+
/** Remove a player (host only, lobby only). */
|
|
68
|
+
export declare function kickFromTable(store: BoardStore, tableId: string, actorId: string, userId: string): OpResult;
|
|
69
|
+
/**
|
|
70
|
+
* Take over as host. Allowed for a seated player when the host has no seat, or
|
|
71
|
+
* when `hostAway` is set (the caller decided the host is gone, e.g. from presence).
|
|
72
|
+
*/
|
|
73
|
+
export declare function claimHost(store: BoardStore, tableId: string, actorId: string, hostAway?: boolean): OpResult;
|
|
74
|
+
export declare function startGame(store: BoardStore, registry: GameRegistry, tableId: string, actorId: string, now: number, seed?: number): OpResult;
|
|
75
|
+
export declare function dispatchAction(store: BoardStore, registry: GameRegistry, tableId: string, actorId: string, action: string, payload: unknown, now: number): OpResult;
|
|
76
|
+
/**
|
|
77
|
+
* Play the current turn with the game's bot strategy (host only). `players`
|
|
78
|
+
* limits it to those players (e.g. the absent ones in a game where several act
|
|
79
|
+
* at once); by default it plays for everyone whose turn it is.
|
|
80
|
+
*/
|
|
81
|
+
export declare function takeOverTurn(store: BoardStore, registry: GameRegistry, tableId: string, actorId: string, now: () => number, players?: readonly PlayerId[]): Promise<OpResult>;
|
|
82
|
+
/** End the game now with the game's own result (host only). */
|
|
83
|
+
export declare function endGame(store: BoardStore, registry: GameRegistry, tableId: string, actorId: string, now: number): OpResult;
|
|
84
|
+
/** Back to the lobby with the same seats (host only). */
|
|
85
|
+
export declare function resetTable(store: BoardStore, tableId: string, actorId: string): OpResult;
|
|
86
|
+
/** Attach a note to the viewer's own seat (e.g. a reason shown with the result). */
|
|
87
|
+
export declare function setSeatNote(store: BoardStore, tableId: string, userId: string, note: string): OpResult;
|
|
88
|
+
/**
|
|
89
|
+
* Repair what copy/paste and deletion leave behind. Every client may run it on
|
|
90
|
+
* each store change: it only writes values that every client computes alike.
|
|
91
|
+
* - A copied table (its id differs from `meta.tableId`) becomes a fresh lobby
|
|
92
|
+
* with the same host, and seats copied along with it are removed.
|
|
93
|
+
* - Seats of the tables in `removedTables` are removed. Pass only tables this
|
|
94
|
+
* client has seen and then lost: a seat that merely arrived before its table
|
|
95
|
+
* (board still loading, out-of-order sync) must not be taken for an orphan.
|
|
96
|
+
* - A bare seat (no table or no meta, e.g. from the shape's `createDefault`) is removed.
|
|
97
|
+
*/
|
|
98
|
+
export declare function repairTables(store: BoardStore, removedTables?: ReadonlySet<string>): void;
|
|
99
|
+
export declare function getTableView(store: BoardStore, registry: GameRegistry, tableId: string, viewerId: string): TableView | undefined;
|
|
100
|
+
//# sourceMappingURL=table-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-ops.d.ts","sourceRoot":"","sources":["../src/table-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAIN,KAAK,QAAQ,EACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAGN,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,QAAQ,EAEb,KAAK,SAAS,EAEd,KAAK,UAAU,EACf,KAAK,SAAS,EACd,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,kBAAkB;IAAK,KAAK;IAAO,MAAM;CAAO,CAAC;AAC9D,eAAO,MAAM,SAAS;IAAK,KA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