The template's lost-seat search counts the tables it cannot give back rather than naming them, leaves a seat a bot stands in for to the host, and the keeper's door looks a name up across tables
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CCLa2PaEeCj8njQZSWGqHx
This commit is contained in:
1 parent
dcb18b2b7e
commit
e3f8a03215
7 files changed
+69
-35
No files matched your search
@@ -134,8 +134,8 @@
|
||||
for (const s of r.seated) rememberSeat(s.roomId, { seat: s.seat, token: s.token });
|
||||
if (r.seated.length) seats = allSeats();
|
||||
const back = r.seated.length ? `Seated again at ${r.seated.map((s) => s.roomId).join(', ')}.` : '';
|
||||
const others = r.elsewhere.map((s) => `${s.roomId} with ${s.players.join(', ') || 'nobody yet'}`);
|
||||
const ask = others.length ? ` ${r.seated.length ? 'Also at' : 'At'} ${others.join('; ')}: that seat was last used from another address, so ask the host there for a transfer phrase, or write to the keeper.` : '';
|
||||
const n = r.elsewhere;
|
||||
const ask = n ? ` ${n === 1 ? 'One more table' : `${n} more tables`} in play ${n === 1 ? 'has' : 'have'} a seat under your name, last used from another address, or given to a bot by the host: ask the host there for a transfer phrase, or write to the keeper.` : '';
|
||||
found = back + ask || 'No table still in play has a seat under that name.';
|
||||
} catch (e) {
|
||||
error = e instanceof Error ? e.message : 'The search did not go through.';
|
||||
|
||||
@@ -181,9 +181,8 @@ export function makeApi<State, Input>() {
|
||||
hostPhrase: (roomId: string, token: string, seat: SeatId) => call<{ phrase: string; expiresAt: number }>('POST', `/api/rooms/${roomId}/phrase`, { token, seat }),
|
||||
standIn: (roomId: string, token: string, seat: SeatId) => call<View>('POST', `/api/rooms/${roomId}/standin`, { token, seat }),
|
||||
claim: (phrase: string) => call<{ roomId: string; seat: SeatId; token: string }>('POST', '/api/transfer', { phrase }),
|
||||
/** The seats a name holds at tables not over: those last used from this address come back seated; the rest are named. */
|
||||
findSeats: (name: string, roomId?: string) =>
|
||||
call<{ seated: { roomId: string; seat: SeatId; token: string }[]; elsewhere: { roomId: string; seat: SeatId; players: string[] }[] }>('POST', '/api/seats/find', { name, ...(roomId ? { roomId } : {}) }),
|
||||
/** The seats a name holds at tables not over: those last used from this address come back seated; the rest are only counted. */
|
||||
findSeats: (name: string, roomId?: string) => call<{ seated: { roomId: string; seat: SeatId; token: string }[]; elsewhere: number }>('POST', '/api/seats/find', { name, ...(roomId ? { roomId } : {}) }),
|
||||
report: (roomId: string, token: string, happened: string, expected: string) =>
|
||||
call<{ id: string }>('POST', `/api/rooms/${roomId}/report`, { token, happened, expected }),
|
||||
reportImage: (id: string, file: File) =>
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
const r = await api.findSeats(name.trim(), roomId).catch(() => null);
|
||||
const mine = r?.seated.find((s) => s.roomId === roomId);
|
||||
if (!mine) {
|
||||
if (r?.elsewhere.length) error = `A seat here is under that name, last used from another address. Ask the host for a transfer phrase, or write to the keeper.`;
|
||||
if (r?.elsewhere) error = 'A seat here is under that name, but it was last used from another address, or the host gave it to a bot. Ask the host for a transfer phrase, or write to the keeper.';
|
||||
return false;
|
||||
}
|
||||
rememberSeat(roomId, { seat: mine.seat, token: mine.token });
|
||||
|
||||
Reference in new issue
Block a user