fix(lite): send ::commands as CLIENT_CHEAT instead of public chat

Mirrors Client.say in the browser client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
max bittkerandClaude Opus 5.5 committed 2026-10-09 00:00:55 -04:00
1 parent 33aa0a1424
commit c5edbc278a
1 file changed
+9
+9
View File
@@ -776,6 +776,15 @@ export function say(c: LiteClient, message: string): SayOutcome {
return { ok: false, truncated: false, filtered: false, finalText: '' };
}
// Mirrors Client.say: ::commands go out as CLIENT_CHEAT, never as public chat.
if (message.startsWith('::')) {
const cheat = message.substring(2);
c.writeOpcode(ClientProt.CLIENT_CHEAT);
c.out.p1(cheat.length + 1);
c.out.pjstr(cheat);
return { ok: true, truncated: false, filtered: false, finalText: message };
}
const cap = c.getMaxMessageLength();
const truncated = message.length > cap;
const text = truncated ? message.substring(0, cap) : message;