From 304e56d6e6c57dc9fd918d8a9fea98bc179deddd Mon Sep 17 00:00:00 2001 From: Davide Cappellini Date: Sun, 1 Nov 2026 23:25:57 +0100 Subject: [PATCH] prototype-server-vision: status bar shows identity (player A/B, gm) derived from hello.tokens Co-Authored-By: Claude Haiku 5.5 --- prototype-server-vision/client/src/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prototype-server-vision/client/src/main.ts b/prototype-server-vision/client/src/main.ts index 79b8053..fb5c099 100644 --- a/prototype-server-vision/client/src/main.ts +++ b/prototype-server-vision/client/src/main.ts @@ -5,7 +5,9 @@ const R = 20; // token radius, world px const s = newState(); const bar = document.getElementById('bar')!; let conn = 'connecting'; -const status = () => (bar.textContent = `role=${s.role ?? '?'} conn=${conn} gseq=${s.gseq}${s.lastError ? ' err=' + s.lastError : ''}`); +// identity from hello.tokens: a player owns only the token whose id is their slot ("A"/"B") +const who = () => (s.role === 'player' ? `player ${s.owned[0] ?? '?'}` : s.role ?? '?'); +const status = () => (bar.textContent = `${who()} conn=${conn} gseq=${s.gseq}${s.lastError ? ' err=' + s.lastError : ''}`); const app = new Application(); await app.init({ resizeTo: window, background: 0x000000, antialias: true });