From a3ab6e672f68adbad90feb759185303112425dfe Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sat, 19 Aug 2023 10:43:53 +0700 Subject: [PATCH] can --- index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.js b/index.js index d203fc7..4fb5edd 100644 --- a/index.js +++ b/index.js @@ -10,6 +10,8 @@ const io = new Server(3069) io.on('connection', (socket) => { let worker + let isFirst = true + function reset () { worker = new Worker(path.join(__dirname, 'vm.js')) @@ -25,6 +27,11 @@ io.on('connection', (socket) => { break } }) + + // ohio + if (!isFirst) { + worker.postMessage({ type: 'setFunctions', jsonArray }) + } else isFirst = false } reset()