mirror of
https://github.com/bdnugget/rs-sdk.git
synced 2026-11-07 09:07:30 +00:00
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:
1 parent
33aa0a1424
commit
c5edbc278a
1 file changed
+9
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user