feedback3 WE: spectator seats in the browser — 观战 in the lobby, the 观战席 strip in the room (host removes, 入座), watch-only match screen; docs (community report #26)

This commit is contained in:
sganggs committed 2026-10-04 17:39:30 +08:00
1 parent 42766172d1
commit 976475efff
21 files changed
+352 -30

No files matched your search

+7 -4
View File
@@ -422,11 +422,14 @@ export class Lobby {
if (room.hostId !== session.playerId) return fail(ERR.NOT_HOST);
if (!room.spectatorOf(playerId)) return fail(ERR.BAD_TARGET, 'not a spectator of this room');
const target = this.registry.byId(playerId);
if (target && target.roomCode === room.code) {
if (target.connected) sendSession(target, { t: 'room.closed', reason: 'kicked' });
else target.notice = 'kicked';
}
const wasHere = !!target && target.roomCode === room.code;
const replay = this.replayFor(room, playerId);
this.removeMember(room, playerId);
if (wasHere) {
// like room.kick: now, or on the next resume (with the result replay, as after the grace timeout)
if (target.connected) sendSession(target, { t: 'room.closed', reason: 'kicked' });
else { target.notice = 'kicked'; target.pendingResult = replay; }
}
return OK;
}