Skip to content

KcdMp.ready

Tells the game the page is loaded and listening.

Until it is called the game keeps everything addressed to the page - messages, events, feeds - and hands it over in order once it is (up to 256 messages or 1 MB per frame; past that the oldest are dropped). The page’s script calls it by itself when the document has loaded; a page that has more to set up first says so in its <html> tag with the attribute data-kcdmp-manual-ready and calls KcdMp.ready() when it is ready. The game mode’s OnPlayerWebReady and the client scripts’ OnWebFrameReady run at that moment.

A page that loads anew - the frame is made again, the interface changed - calls it again, and the queue and the feeds start over for the new document.

await KcdMp.ready()

Promise<void> - settles once the game has taken it

// <html data-kcdmp-manual-ready> - nothing reaches the page until it says it is ready
async function start() {
await loadTranslations();
KcdMp.onMessage(handleMessage);
await KcdMp.ready();
}
start();

KcdMp.onMessage · KcdMp.onServer · the The page group of the index