Two tabs of the same browser share localStorage, so both got the same persisted playerId and stepped on each other: matchmaking's waiting queue is keyed by playerId and dedupes a second queue:join as a no-op, so two tabs searching never both count as waiting; and re-identifying with the same playerId hijacks the ws registry's socket binding, tearing down the first tab's connection (surfacing as room:join replying 'room already has two players' once its creator's socket is dead). Move playerId/name from localStorage to sessionStorage: still stable across reloads within a tab (reconnect-by-refresh keeps the same identity), but each new tab gets a fresh UUID, so two tabs of one browser behave like two separate players. Not IP-related; no such restriction existed. |
||
|---|---|---|
| .. | ||
| src | ||
| .env.example | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||
| vite.config.ts | ||