chat
Last updated on
The in-game chat box, which carries player messages and is the only way a typed slash command reaches the host's command dispatcher.
The chat box: a log of recent lines at the top of the screen and an input line that opens on a key (T by default). A line without / goes to every player, signed Player #12 / Joueur #12 (the server id): never a character name, account name or account id, because the line reaches the whole city. Only a connection with a loaded character may send one (or one holding STAFF_PERMISSION); a player still on the character screen reads That message was not sent: you speak once your character is in the city. (chat.notLoaded, at most once per 2 s). The console speaks through the chat contract and is never asked. A line starting with / is split into arguments and sent to the host's command dispatcher, which checks the ACL and runs it; refusals come back as toasts. Without this module, commands can only be run from the server console. Checks no permission of its own beyond STAFF_PERMISSION, saves nothing.
| Side | both |
| Requires | none |
| Optional | downed (box hides and refuses to open while down) |
| Contract | chat v1 — server, client |
| Config | config/chat.lua (shared) |
| Data | none |
Configuration
config/chat.lua sets OPX.Config.MODULES.chat. Shared: both halves read the length and rate limits. The server reads MAX_LENGTH, RATE_MS and READY_MS once, within the bounds below; a missing or out-of-range value takes its default.
Refusal codes
| Code | Meaning |
|---|---|
chat.invalidMessage | AddMessage (or the server Send/Broadcast) got no usable text. |
chat.invalidKind | Server Send/Broadcast: kind is not a line kind. |
chat.noPlayer | Server Send: nobody is connected under that id. |
chat.invalidScope | Server Broadcast: a bad bucket, radius or origin. |
chat.noView | That half of the page has not reported ready yet. |
chat.invalidCommand | A suggestion with no command name. |
chat.notLoaded | A line from a connection with no loaded character and no STAFF_PERMISSION. |
Player-facing refusals for typed commands: chat.tooManyArgs (more than 32 arguments), chat.escapeAtEnd, chat.unterminatedQuote, chat.commandExpected, chat.commandNotSent, chat.messageNotSent; from the dispatcher: chat.command.unknown, chat.command.denied, chat.command.tooFast, chat.command.failed.