1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add proxy_to_pthread option to platform=web

Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
This commit is contained in:
Adam Scott
2023-07-20 09:42:03 -04:00
parent c2b916751d
commit 78c2a08fae
20 changed files with 420 additions and 39 deletions

View File

@@ -144,6 +144,7 @@ const GodotWebSocket = {
},
},
godot_js_websocket_create__proxy: 'sync',
godot_js_websocket_create__sig: 'iiiiiiii',
godot_js_websocket_create: function (p_ref, p_url, p_proto, p_on_open, p_on_message, p_on_error, p_on_close) {
const on_open = GodotRuntime.get_func(p_on_open).bind(null, p_ref);
@@ -166,6 +167,7 @@ const GodotWebSocket = {
return GodotWebSocket.create(socket, on_open, on_message, on_error, on_close);
},
godot_js_websocket_send__proxy: 'sync',
godot_js_websocket_send__sig: 'iiiii',
godot_js_websocket_send: function (p_id, p_buf, p_buf_len, p_raw) {
const bytes_array = new Uint8Array(p_buf_len);
@@ -180,11 +182,13 @@ const GodotWebSocket = {
return GodotWebSocket.send(p_id, out);
},
godot_js_websocket_buffered_amount__proxy: 'sync',
godot_js_websocket_buffered_amount__sig: 'ii',
godot_js_websocket_buffered_amount: function (p_id) {
return GodotWebSocket.bufferedAmount(p_id);
},
godot_js_websocket_close__proxy: 'sync',
godot_js_websocket_close__sig: 'viii',
godot_js_websocket_close: function (p_id, p_code, p_reason) {
const code = p_code;
@@ -192,6 +196,7 @@ const GodotWebSocket = {
GodotWebSocket.close(p_id, code, reason);
},
godot_js_websocket_destroy__proxy: 'sync',
godot_js_websocket_destroy__sig: 'vi',
godot_js_websocket_destroy: function (p_id) {
GodotWebSocket.destroy(p_id);