KcdMp.mock.message
Fires the page’s message handlers as if a client script or the game mode had sent a message.
Runs the handlers registered with KcdMp.onMessage with data, untouched.
Syntax
Section titled “Syntax”KcdMp.mock.message(data)| Parameter | Type | |
|---|---|---|
data |
unknown |
the message |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”KcdMp.onMessage((data) => showNotice(data.text));KcdMp.mock.message({ text: "The gate is open." });See also
Section titled “See also”KcdMp.onMessage · KcdMp.mock.emit · the Mock mode group of the index
