P14d: guest display names for players

- Players set a display name in the session panel ("Your name"); it persists
  (sessionStore.guestName) and is sent via a new `setName` message on join + edit.
- Server stores the name per connection and uses it in the roster + chat; the roster
  entry now also carries the player's character, so the GM sees "Alice · Lia".
- Realtime e2e: a player names themselves and the GM's roster/share update to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 17:28:32 +02:00
parent 4e13a5bdf4
commit d6eda054bf
8 changed files with 60 additions and 9 deletions
+7
View File
@@ -158,6 +158,13 @@ describe('RoomHub', () => {
expect(lastOf(player, 'error')?.code).toBe('forbidden');
});
it('lets a player set a display name shown in the roster', () => {
const hub = new RoomHub();
const { gm, player } = hostAndJoin(hub);
hub.setName(player, 'Alice');
expect(lastOf(gm, 'roster')!.players.find((p) => p.name === 'Alice')).toBeTruthy();
});
it('routes chat: table to all, whisper to the target only', () => {
const hub = new RoomHub();
const gm = fake(); hub.host(gm);