Skip to content

KcdMp.mock

The controls that play the game’s part when the page runs in a browser.

Present only when KcdMp.env.mock is true. Its functions fire the page’s own handlers as the game would: KcdMp.mock.emit for the game mode’s events, KcdMp.mock.message for messages, KcdMp.mock.feed for feeds, KcdMp.mock.reply for the answers of client scripts, KcdMp.mock.key for the keys the game mode declared, and KcdMp.mock.component for the events of a component the page draws.

KcdMp.mock
if (KcdMp.env.mock) {
KcdMp.mock.feed("session", { server: "Test server", address: "127.0.0.1:7777", level: "kutnohorsko", playerId: 1, name: "Henry", rtt: 20 });
}

KcdMp.env.mock · the Mock mode group of the index