prototype-server-vision: status bar shows identity (player A/B, gm) derived from hello.tokens

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-01 23:25:57 +01:00
co-authored by Claude Haiku 5.5
parent ef19d362c6
commit 304e56d6e6
+3 -1
View File
@@ -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 });