Simplify sealed auction logs and show winner payments

This commit is contained in:
coyotte508 2026-10-04 14:31:21 +02:00
commit 511d935add
29 changed files with 187 additions and 89 deletions

View file

@ -1,6 +1,6 @@
{
"name": "outpost-engine",
"version": "0.10.21",
"version": "0.10.22",
"description": "Unofficial Outpost rules engine for boardgamers.space",
"license": "AGPL-3.0",
"files": [

View file

@ -55,7 +55,7 @@ test("sealed history stays private until completion, including passes and the op
}
});
test("completed bids remain public during the next sealed auction, including sliced descriptions", () => {
test("completed results keep every bid while descriptions show only the viewer's own amount", () => {
const state = game();
const [opener, winner, passer, last] = open(state);
const openingIndex = state.log.length - 1;
@ -68,14 +68,29 @@ test("completed bids remain public during the next sealed auction, including sli
applyMove(state, { action: "bidPass" }, winner);
for (const viewer of [undefined, opener, winner, passer, last]) {
const visible = stripSecret(state, viewer);
const lines = describeLog(visible);
assert.match(lines[openingIndex]!, /up for auction at 25/);
assert.equal(lines[openingIndex + 1], `${state.players[winner]!.name} bids 40`);
assert.equal(lines[openingIndex + 2], `${state.players[passer]!.name} passes on the auction`);
assert.equal(describeLogEntry(visible, visible.log[openingIndex + 1]!), lines[openingIndex + 1]);
assert.match(lines.at(-2)!, /up for sealed auction$/);
assert.match(lines.at(-1)!, /takes part in the sealed auction$/);
const lines = describeLog(visible, viewer);
assert.match(lines[openingIndex]!, viewer === opener ? /up for auction at 25$/ : /up for sealed auction$/);
assert.equal(
lines[openingIndex + 1],
`${state.players[winner]!.name} ${viewer === winner ? "bids 40" : "takes part in the sealed auction"}`
);
assert.equal(
lines[openingIndex + 2],
`${state.players[passer]!.name} ${viewer === passer ? "passes on the auction" : "takes part in the sealed auction"}`
);
assert.equal(describeLogEntry(visible, visible.log[openingIndex + 1]!, viewer), lines[openingIndex + 1]);
assert.match(lines.at(-2)!, viewer === opener ? /up for auction at 25$/ : /up for sealed auction$/);
assert.match(lines.at(-1)!, viewer === winner ? /passes on the auction$/ : /takes part in the sealed auction$/);
assert.ok(lines.every((line) => !line.includes(" wins ")));
assert.match(lines[resultIndex + 1]!, /buys .* \(paid 40\)$/);
assert.deepEqual([...sealedAuctionHistory(visible.log).results.keys()], [resultIndex]);
assert.deepEqual(
sealedAuctionHistory(visible.log)
.results.get(resultIndex)
?.bids.map((bid) => bid.amount),
[40, 30, 25, 0]
);
assert.equal(sealedAuctionHistory(visible.log).results.get(resultIndex)?.paid, 40);
const slice = logSlice(state, { player: viewer, start: openingIndex + 1, end: openingIndex + 3 });
assert.deepEqual(
slice.log.map((entry) => entry.simple),
@ -86,6 +101,26 @@ test("completed bids remain public during the next sealed auction, including sli
assert.deepEqual(sealedAuctionHistory(replayed.log), sealedAuctionHistory(stripSecret(state).log));
});
test("own sealed bids remain visible while collecting bids without revealing other players' actions", () => {
const state = game();
const [opener, bidder, passer] = open(state);
const openingIndex = state.log.length - 1;
applyMove(state, { action: "bid", amount: 40 }, bidder);
applyMove(state, { action: "bidPass" }, passer);
for (const viewer of [undefined, opener, bidder, passer]) {
const visible = stripSecret(state, viewer);
const lines = describeLog(visible, viewer);
assert.match(lines[openingIndex]!, viewer === opener ? /up for auction at 25$/ : /up for sealed auction$/);
assert.match(lines.at(-2)!, viewer === bidder ? /bids 40$/ : /takes part in the sealed auction$/);
assert.match(lines.at(-1)!, viewer === passer ? /passes on the auction$/ : /takes part in the sealed auction$/);
assert.equal(sealedAuctionHistory(visible.log).results.size, 0);
assert.deepEqual(
logSlice(state, { player: viewer }).log.map((entry) => entry.simple),
lines
);
}
});
test("an immediately resolved auction reveals the opener and every automatic pass", () => {
const state = game();
const opener = state.activeSeat;

View file

@ -3,6 +3,7 @@ import type { LogEntry } from "./types.js";
export interface SealedAuctionResult {
winner: number;
bids: { player: number; amount: number }[];
paid?: number;
}
export function sealedAuctionHistory(log: LogEntry[]): {
@ -13,17 +14,25 @@ export function sealedAuctionHistory(log: LogEntry[]): {
const results = new Map<number, SealedAuctionResult>();
let pending: number[] = [];
let bids = new Map<number, number>();
let awaitingPayment: SealedAuctionResult | undefined;
for (const [index, entry] of log.entries()) {
if (entry.type !== "move") {
continue;
}
if (entry.move.action === "auction") {
awaitingPayment = undefined;
pending = [];
bids = new Map([[entry.player, entry.move.bid]]);
} else if (entry.move.action === "bid") {
bids.set(entry.player, entry.move.amount);
} else if (entry.move.action === "bidPass") {
bids.set(entry.player, 0);
} else if (entry.move.action === "pay") {
if (awaitingPayment?.winner === entry.player && entry.info?.paid !== undefined) {
awaitingPayment.paid = entry.info.paid;
}
awaitingPayment = undefined;
continue;
} else {
continue;
}
@ -36,7 +45,7 @@ export function sealedAuctionHistory(log: LogEntry[]): {
revealed.add(bidIndex);
}
const winner = entry.info.winner ?? entry.player;
results.set(index, {
awaitingPayment = {
winner,
bids: [...bids]
.filter(([, amount]) => amount >= 0)
@ -45,7 +54,8 @@ export function sealedAuctionHistory(log: LogEntry[]): {
(a, b) =>
b.amount - a.amount || Number(b.player === winner) - Number(a.player === winner) || a.player - b.player
),
});
};
results.set(index, awaitingPayment);
pending = [];
bids.clear();
}

View file

@ -1,5 +1,4 @@
import { FACTORIES, KICKER_SPECS, UPGRADE_SPECS } from "./data.js";
import { sealedAuctionHistory } from "./auction-history.js";
import type { GameState, LogEntry, MoveInfo } from "./types.js";
/** Display name of the card a move concerns (colony upgrade or Kicker card). */
@ -13,11 +12,6 @@ function cardName(info: MoveInfo | undefined, fallback: string): string {
return fallback;
}
function sealedPrice(info: MoveInfo): number {
const floor = info.kicker ? KICKER_SPECS[info.kicker].price : info.upgrade ? UPGRADE_SPECS[info.upgrade].price : 0;
return Math.min(info.winningBid ?? 0, Math.max(floor, (info.secondBid ?? 0) + 1));
}
function playerName(state: GameState, seat: number): string {
return state.players[seat]?.name ?? `Player ${seat + 1}`;
}
@ -37,22 +31,7 @@ function autoPassSuffix(state: GameState, info: MoveInfo | undefined): string {
return ` — ${seats.map((s) => playerName(state, s)).join(", ")} auto-pass${seats.length === 1 ? "es" : ""} (can't reach the price)`;
}
/**
* fastBid keeps its moveset quiet while an auction collects sealed bids:
* the opening, every bid and every pass of an unresolved auction all read
* as a neutral "sealed auction in progress" — no amounts, no pass-vs-bid,
* no auto-pass names. Once the resolving move is logged the real moves are
* revealed (amounts, passes) by the wrapper's unmasking and described fully.
*/
function sealedQuiet(state: GameState, entry: LogEntry, revealed?: boolean): boolean {
return (
state.phase === "auction" &&
state.auction?.bids !== undefined &&
!(revealed ?? sealedAuctionHistory(state.log).revealed.has(state.log.indexOf(entry)))
);
}
export function describeLogEntry(state: GameState, entry: LogEntry, sealedBidVisible?: boolean): string {
export function describeLogEntry(state: GameState, entry: LogEntry, viewer?: number): string {
switch (entry.type) {
case "init":
return `Game started with ${entry.players} players`;
@ -71,6 +50,7 @@ export function describeLogEntry(state: GameState, entry: LogEntry, sealedBidVis
const name = playerName(state, entry.player);
const move = entry.move;
const info = entry.info;
const sealed = state.options.fastBid === true;
switch (move.action) {
case "mega": {
if (info?.megaSealed) {
@ -84,36 +64,24 @@ export function describeLogEntry(state: GameState, entry: LogEntry, sealedBidVis
case "discard":
return `${name} discards ${info?.discarded ?? move.cards.length} card(s)`;
case "auction":
// fastBid: while the sealed bids are collected, the opening is
// neutral for everyone (even the auctioneer — the amount is
// sealed). After resolution the wrapper reveals the bid.
if (sealedQuiet(state, entry, sealedBidVisible) || move.bid < 0) {
if ((sealed && entry.player !== viewer) || move.bid < 0) {
return `${name} puts ${cardName(info, "an upgrade")} up for sealed auction`;
}
return (
`${name} puts ${cardName(info, "an upgrade")} up for auction at ${move.bid}` + autoPassSuffix(state, info)
`${name} puts ${cardName(info, "an upgrade")} up for auction at ${move.bid}` +
(sealed ? "" : autoPassSuffix(state, info))
);
case "bid": {
// fastBid: the resolving move carries the outcome in its info.
if (info?.winningBid !== undefined) {
const won = playerName(state, info.winner ?? entry.player);
return `${name} bids ${move.amount} (sealed) — ${won} wins at ${sealedPrice(info)}`;
}
if (sealedQuiet(state, entry, sealedBidVisible) || move.amount < 0) {
if ((sealed && entry.player !== viewer) || move.amount < 0) {
return `${name} takes part in the sealed auction`;
}
return `${name} bids ${move.amount}` + autoPassSuffix(state, info);
return `${name} bids ${move.amount}` + (sealed ? "" : autoPassSuffix(state, info));
}
case "bidPass":
// fastBid: a pass can be the resolving move — it carries the outcome.
if (info?.winningBid !== undefined) {
const won = playerName(state, info.winner ?? entry.player);
return `${name} passes — ${won} wins the sealed auction at ${sealedPrice(info)}`;
}
if (sealedQuiet(state, entry, sealedBidVisible)) {
if (sealed && entry.player !== viewer) {
return `${name} takes part in the sealed auction`;
}
return `${name} passes on the auction` + autoPassSuffix(state, info);
return `${name} passes on the auction` + (sealed ? "" : autoPassSuffix(state, info));
case "pay":
return `${name} buys ${cardName(info, "the upgrade")} (paid ${info?.paid ?? 0})`;
case "exchange": {
@ -162,7 +130,6 @@ export function describeLogEntry(state: GameState, entry: LogEntry, sealedBidVis
}
}
export function describeLog(state: GameState): string[] {
const { revealed } = sealedAuctionHistory(state.log);
return state.log.map((entry, index) => describeLogEntry(state, entry, revealed.has(index)));
export function describeLog(state: GameState, viewer?: number): string[] {
return state.log.map((entry) => describeLogEntry(state, entry, viewer));
}

View file

@ -162,7 +162,7 @@ test("fastBid: a sole bidder pays the list price", () => {
assert.equal(state.phase, "auctionPayment");
assert.equal(state.auction?.highBidder, opener);
assert.equal(state.auction?.highBid, 25);
assert.match(describeLogEntry(state, state.log.at(-1)!), /wins the sealed auction at 25$/);
assert.match(describeLogEntry(state, state.log.at(-1)!), /takes part in the sealed auction$/);
});
test("fastBid: overbidding the opening still pays only the list price when everyone passes", () => {
@ -177,7 +177,7 @@ test("fastBid: overbidding the opening still pays only the list price when every
assert.equal(state.phase, "auctionPayment");
assert.equal(state.auction?.highBidder, opener);
assert.equal(state.auction?.highBid, 25);
assert.match(describeLogEntry(state, state.log.at(-1)!), /wins the sealed auction at 25$/);
assert.match(describeLogEntry(state, state.log.at(-1)!), /takes part in the sealed auction$/);
});
test("fastBid: bid below list price is rejected", () => {

View file

@ -67,6 +67,13 @@ export function replay(state: GameState, options?: { to?: number; trackKnowledge
}
setReplayExchangeTake(entry.info?.exchangeTake ?? -1);
applyMove(replayed, entry.move, entry.player);
if (entry.move.action === "pay" && entry.info?.paid !== undefined) {
// The public payment is known even when the replay's card values are masked.
const applied = replayed.log[i];
if (applied?.type === "move") {
applied.info = { ...applied.info, paid: entry.info.paid };
}
}
if (entry.info?.megaSealed) {
const applied = replayed.log.at(-1);
if (applied?.type === "move") {

View file

@ -321,10 +321,9 @@ export function logSlice(data: GameState, options?: LogSliceOptions): LogSliceRe
// in the game list, and our structured entries otherwise stringify to noise.
// describeLogEntry never reveals hidden values (unresolved sealed bids,
// exchange takes).
const { revealed } = sealedAuctionHistory(data.log);
const log = maskLog(data, viewer, start, end).map((masked, index) => ({
const log = maskLog(data, viewer, start, end).map((masked) => ({
...masked,
simple: describeLogEntry(data, masked, revealed.has(start + index)),
simple: describeLogEntry(data, masked, viewer),
}));
const result: LogSliceResult = { log };
if (options?.end === undefined) {

View file

@ -1,6 +1,6 @@
{
"name": "outpost-viewer",
"version": "0.1.17",
"version": "0.1.18",
"description": "Browser viewer for the Outpost game on boardgamers.space",
"license": "AGPL-3.0",
"files": [

View file

@ -26,7 +26,7 @@
{#if state}
<div class="board">
<div class="page">
<ReplayBar {store} />
{#if __DEV__}<ReplayBar {store} />{/if}
<HeaderStrip {state} />
<GameEndBanner {store} />

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { tick, untrack } from "svelte";
import { sealedAuctionHistory } from "outpost-engine";
import { sealedAuctionHistory, upgradeDiscount } from "outpost-engine";
import type { ViewerStore } from "./store.svelte";
interface Props {
@ -10,6 +10,24 @@
let { store }: Props = $props();
const lines = $derived(store.logLines);
const results = $derived(sealedAuctionHistory(store.liveState?.log ?? []).results);
const pendingPayment = $derived.by(() => {
const state = store.liveState;
const auction = state?.auction;
if (!state || state.phase !== "auctionPayment" || !auction?.bids) {
return null;
}
const index = [...results.keys()].at(-1);
const winner = state.players[auction.highBidder];
if (
index === undefined ||
!winner ||
state.log.slice(index + 1).some((entry) => entry.type === "move" && entry.move.action === "auction")
) {
return null;
}
const discount = auction.upgrade ? upgradeDiscount(winner, auction.upgrade) : 0;
return { index, due: Math.max(0, auction.highBid - discount) };
});
const recent = $derived(lines.map((line, index) => ({ line, index })).slice(-150));
let feed = $state<HTMLDivElement>();
let content = $state<HTMLDivElement>();
@ -80,7 +98,16 @@
<span class="bidder" translate="no"
>{store.liveState?.players[bid.player]?.name ?? `Player ${bid.player + 1}`}</span
>
<strong>{bid.amount === 0 ? "Pass" : `◈ ${bid.amount}`}</strong>
<span class="bid-value">
<strong>{bid.amount === 0 ? "Pass" : `◈ ${bid.amount}`}</strong>
{#if bid.player === result.winner}
{#if result.paid !== undefined}
<span class="payment">{`Paid ◈ ${result.paid}`}</span>
{:else if pendingPayment?.index === item.index}
<span class="payment">{`Due ◈ ${pendingPayment.due}`}</span>
{/if}
{/if}
</span>
</li>
{/each}
</ul>
@ -124,6 +151,17 @@
min-width: 0;
overflow-wrap: anywhere;
}
.bid-value {
display: flex;
flex-direction: column;
align-items: flex-end;
white-space: nowrap;
}
.payment {
color: var(--text-mid);
font-size: 10.5px;
font-weight: 500;
}
.auction-result strong {
white-space: nowrap;
font-variant-numeric: tabular-nums;

View file

@ -215,6 +215,7 @@ export class ViewerStore {
preferences = $state<Record<string, unknown>>({});
settings = $state<Record<string, unknown> | null>(null);
logLines = $state<string[]>([]);
private logEntries: GameState["log"] = [];
seenLog = $state(0);
lastMoveAt = $state<number>(0);
chat = new ChatController();
@ -311,8 +312,9 @@ export class ViewerStore {
setState(state: GameState): void {
this.liveState = state;
this.logEntries = [...state.log];
this.seenLog = state.log.length;
this.logLines = describeLog(state);
this.logLines = describeLog(state, this.playerIndex);
if (!this.replay.active) {
this.cancel();
this.lastMoveAt = Date.now();
@ -321,6 +323,14 @@ export class ViewerStore {
this.commands.replaceLog([...this.logLines]);
}
setPlayer(index?: number): void {
this.playerIndex = index;
if (this.liveState) {
this.logLines = this.logEntries.map((entry) => describeLogEntry(this.liveState!, entry, index));
this.commands.replaceLog([...this.logLines]);
}
}
// Re-apply the staged buys on top of the (new) live state; drop them when
// they no longer apply (turn is over, or the server state moved on).
private rebuildDraft(): void {
@ -360,8 +370,9 @@ export class ViewerStore {
this.commands.fetchState();
return;
}
if (payload.start >= this.logLines.length) {
const appended = entries.map((entry) => describeLogEntry(base, entry));
if (payload.start === this.logEntries.length) {
this.logEntries = [...this.logEntries, ...entries];
const appended = entries.map((entry) => describeLogEntry(base, entry, this.playerIndex));
this.logLines = [...this.logLines, ...appended];
this.seenLog = base.log.length;
this.commands.replaceLog([...this.logLines]);

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "Rabat ◈ {p0}",
"Bid submitted": "Bud afgivet",
"Auction details": "Auktionsdetaljer",
"Revealed bids": "Afslørede bud"
"Revealed bids": "Afslørede bud",
"Paid ◈ {p0}": "Betalt ◈ {p0}",
"Due ◈ {p0}": "At betale ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "Rabatt ◈ {p0}",
"Bid submitted": "Gebot abgegeben",
"Auction details": "Auktionsdetails",
"Revealed bids": "Aufgedeckte Gebote"
"Revealed bids": "Aufgedeckte Gebote",
"Paid ◈ {p0}": "Bezahlt ◈ {p0}",
"Due ◈ {p0}": "Fällig ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "Έκπτωση ◈ {p0}",
"Bid submitted": "Η προσφορά υποβλήθηκε",
"Auction details": "Λεπτομέρειες δημοπρασίας",
"Revealed bids": "Αποκαλυμμένες προσφορές"
"Revealed bids": "Αποκαλυμμένες προσφορές",
"Paid ◈ {p0}": "Πληρώθηκαν ◈ {p0}",
"Due ◈ {p0}": "Προς πληρωμή ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "Discount ◈ {p0}",
"Bid submitted": "Bid submitted",
"Auction details": "Auction details",
"Revealed bids": "Revealed bids"
"Revealed bids": "Revealed bids",
"Paid ◈ {p0}": "Paid ◈ {p0}",
"Due ◈ {p0}": "Due ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "تخفیف ◈ {p0}",
"Bid submitted": "پیشنهاد ثبت شد",
"Auction details": "جزئیات حراج",
"Revealed bids": "پیشنهادهای آشکارشده"
"Revealed bids": "پیشنهادهای آشکارشده",
"Paid ◈ {p0}": "پرداخت‌شده ◈ {p0}",
"Due ◈ {p0}": "مبلغ قابل پرداخت ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "Réduction ◈ {p0}",
"Bid submitted": "Enchère envoyée",
"Auction details": "Détails de l’enchère",
"Revealed bids": "Enchères révélées"
"Revealed bids": "Enchères révélées",
"Paid ◈ {p0}": "Payé ◈ {p0}",
"Due ◈ {p0}": "À payer ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "छूट ◈ {p0}",
"Bid submitted": "बोली भेजी गई",
"Auction details": "नीलामी का विवरण",
"Revealed bids": "प्रकट की गई बोलियाँ"
"Revealed bids": "प्रकट की गई बोलियाँ",
"Paid ◈ {p0}": "भुगतान ◈ {p0}",
"Due ◈ {p0}": "देय ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "Sconto ◈ {p0}",
"Bid submitted": "Offerta inviata",
"Auction details": "Dettagli dell’asta",
"Revealed bids": "Offerte rivelate"
"Revealed bids": "Offerte rivelate",
"Paid ◈ {p0}": "Pagato ◈ {p0}",
"Due ◈ {p0}": "Da pagare ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "할인 ◈ {p0}",
"Bid submitted": "입찰 제출 완료",
"Auction details": "경매 안내",
"Revealed bids": "공개된 입찰"
"Revealed bids": "공개된 입찰",
"Paid ◈ {p0}": "지불 ◈ {p0}",
"Due ◈ {p0}": "지불할 금액 ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "Korting ◈ {p0}",
"Bid submitted": "Bod ingediend",
"Auction details": "Veilingdetails",
"Revealed bids": "Onthulde biedingen"
"Revealed bids": "Onthulde biedingen",
"Paid ◈ {p0}": "Betaald ◈ {p0}",
"Due ◈ {p0}": "Te betalen ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "Zniżka ◈ {p0}",
"Bid submitted": "Oferta wysłana",
"Auction details": "Szczegóły aukcji",
"Revealed bids": "Ujawnione oferty"
"Revealed bids": "Ujawnione oferty",
"Paid ◈ {p0}": "Zapłacono ◈ {p0}",
"Due ◈ {p0}": "Do zapłaty ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "Desconto ◈ {p0}",
"Bid submitted": "Lance enviado",
"Auction details": "Detalhes do leilão",
"Revealed bids": "Lances revelados"
"Revealed bids": "Lances revelados",
"Paid ◈ {p0}": "Pago ◈ {p0}",
"Due ◈ {p0}": "A pagar ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "Reducere ◈ {p0}",
"Bid submitted": "Ofertă trimisă",
"Auction details": "Detaliile licitației",
"Revealed bids": "Oferte dezvăluite"
"Revealed bids": "Oferte dezvăluite",
"Paid ◈ {p0}": "Plătit ◈ {p0}",
"Due ◈ {p0}": "De plătit ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "Скидка ◈ {p0}",
"Bid submitted": "Ставка отправлена",
"Auction details": "Подробности аукциона",
"Revealed bids": "Раскрытые ставки"
"Revealed bids": "Раскрытые ставки",
"Paid ◈ {p0}": "Уплачено ◈ {p0}",
"Due ◈ {p0}": "К оплате ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "Giảm giá ◈ {p0}",
"Bid submitted": "Đã gửi giá đấu",
"Auction details": "Chi tiết đấu giá",
"Revealed bids": "Giá đấu đã công bố"
"Revealed bids": "Giá đấu đã công bố",
"Paid ◈ {p0}": "Đã trả ◈ {p0}",
"Due ◈ {p0}": "Cần trả ◈ {p0}"
}

View file

@ -1196,5 +1196,7 @@
"Discount ◈ {p0}": "折扣 ◈ {p0}",
"Bid submitted": "已提交出價",
"Auction details": "拍賣詳情",
"Revealed bids": "已揭曉的出價"
"Revealed bids": "已揭曉的出價",
"Paid ◈ {p0}": "已支付 ◈ {p0}",
"Due ◈ {p0}": "應付 ◈ {p0}"
}

View file

@ -35,7 +35,7 @@ registerViewer<GameState, Move>(
await tick();
},
onPlayer({ index }) {
store.playerIndex = index;
store.setPlayer(index);
},
onAvatars(avatars) {
store.avatars = avatars;

View file

@ -125,10 +125,12 @@ try {
assert.equal(await frame.evaluate(() => settingsChanges.length), 0, "swiping does not change settings");
await pageScrollsFrom(frame.locator(".market .ucard").first(), "market card");
await pageScrollsFrom(frame.locator(".factory-buttons button:not(:disabled) svg").first(), "resource icon");
const logLength = await frame.locator(".feed .entry").count();
await frame.evaluate(() => emitter.emit("player", { index: 1 }));
await pageScrollsFrom(frame.locator(".market .ucard:disabled").first(), "disabled market card");
await pageScrollsFrom(frame.locator(".pcard:disabled").first(), "disabled hand card");
await frame.evaluate(() => emitter.emit("player", { index: 0 }));
assert.equal(await frame.locator(".feed .entry").count(), logLength, "player changes preserve appended events");
for (const name of ["Chat messages", "Recent events"]) {
const feed = frame.getByRole("region", { name, exact: true });
await center(feed);
@ -177,11 +179,8 @@ try {
assert.ok((await page.evaluate(() => scrollY)) > beforeBottom + 30, `${name}: bottom edge releases to page`);
}
await frame.evaluate(() => emitter.emit("replay:start"));
const marks = frame.locator(".marks");
await center(marks);
await swipe(marks, 0, -85);
assert.ok((await marks.evaluate((el) => el.scrollLeft)) > 30, "replay timeline still scrolls horizontally");
await pageScrollsFrom(marks, "replay timeline vertical gesture");
assert.equal(await frame.locator(".replaybar").count(), 0, "the BGS host supplies replay navigation");
await frame.evaluate(() => emitter.emit("replay:to", 1));
await frame.evaluate(() => emitter.emit("replay:end"));
await frame.locator(".factory-buttons button:not(:disabled)").last().tap();
assert.equal(await frame.locator(".factory-buttons").count(), 0, "a tap still opens a purchase");