From accec82a6a783f37a4bcf892287cd51e228af14e Mon Sep 17 00:00:00 2001 From: jusax23 Date: Mon, 2 Oct 2023 00:47:16 +0200 Subject: [PATCH] fixes --- js/quad-ws.js | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/js/quad-ws.js b/js/quad-ws.js index 1a16988..3512ef1 100644 --- a/js/quad-ws.js +++ b/js/quad-ws.js @@ -42,8 +42,8 @@ function ws_open(ptr, len) { conn.socket.onopen = (s, e) => { conn.state = WS_CONNECTED; }; - conn.socket.onmessage = (s, e) => { - conn.received.push(new Uint8Array(e.data.arraybuffer())); + conn.socket.onmessage = (e) => { + conn.received.push(new Uint8Array(e.data.arrayBuffer())); }; conn.socket.onerror = (s, e) => { conn.state = WS_CLOSED; @@ -102,17 +102,3 @@ function register_plugin(importObject) { } miniquad_add_plugin({ register_plugin, version: "0.0.1", name: "miniquad_websocket" }); - -/* -var socket = new WebSocket("ws://127.0.0.1:7878"); - socket.onmessage = function (event) { - var received = document.getElementById("received"); - var br = document.createElement("BR"); - console.log(event.data); - }; - - function send(data) { - - socket.send(data); - } -*/ \ No newline at end of file