This commit is contained in:
Chayapak 2023-08-19 10:43:53 +07:00
parent b13456c9c8
commit a3ab6e672f

View file

@ -10,6 +10,8 @@ const io = new Server(3069)
io.on('connection', (socket) => { io.on('connection', (socket) => {
let worker let worker
let isFirst = true
function reset () { function reset () {
worker = new Worker(path.join(__dirname, 'vm.js')) worker = new Worker(path.join(__dirname, 'vm.js'))
@ -25,6 +27,11 @@ io.on('connection', (socket) => {
break break
} }
}) })
// ohio
if (!isFirst) {
worker.postMessage({ type: 'setFunctions', jsonArray })
} else isFirst = false
} }
reset() reset()