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.
Syntax
Section titled “Syntax”await KcdMp.ready()Returns
Section titled “Returns”Promise<void> - settles once the game has taken it
Example
Section titled “Example”// <html data-kcdmp-manual-ready> - nothing reaches the page until it says it is readyasync function start() { await loadTranslations(); KcdMp.onMessage(handleMessage); await KcdMp.ready();}start();See also
Section titled “See also”KcdMp.onMessage · KcdMp.onServer · the The page group of the index
