OPX//77
opx_infinitychat

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.

Sideboth
Requiresnone
Optionaldowned (box hides and refuses to open while down)
Contractchat v1 — server, client
Configconfig/chat.lua (shared)
Datanone

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.

KeyDefaultEffect
enabledtruefalse switches the module off. Typed commands then have no way in.
ANCHOR'top-center'bottom-left, bottom-center, top-left or top-center; anything else reads as bottom-left.
OFFSET48Pixels from the anchored edge on a 1080-high surface.
WIDTH620Box width on a 1920-wide surface.
HISTORY60Lines kept; older ones drop off.
FADE_MS12000How long a line stays visible while the box is closed. 0 never fades.
MAX_LENGTH240Longest message, in characters (1–2000).
RATE_MS800Minimum ms between two messages from one player (0–60000). A faster one is not sent, and the sender reads chat.tooFast ("That message was not sent: wait a moment between two."), at most once per 2 s burst.
STAFF_PERMISSION'command.opx.admin'ACL right that lets a connection with no loaded character send a line, so staff can still be reached from the character screen.
READY_MS5000Minimum ms between two completion lists for one player (0–600000).
NOTIFYtrueRefused commands as toasts; false writes a red line in the box instead.
KEYS{ OPEN = 'T' }Default key to open the box; players rebind it in the pause menu. false registers none.

Refusal codes

CodeMeaning
chat.invalidMessageAddMessage (or the server Send/Broadcast) got no usable text.
chat.invalidKindServer Send/Broadcast: kind is not a line kind.
chat.noPlayerServer Send: nobody is connected under that id.
chat.invalidScopeServer Broadcast: a bad bucket, radius or origin.
chat.noViewThat half of the page has not reported ready yet.
chat.invalidCommandA suggestion with no command name.
chat.notLoadedA 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.

On this page