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 });