This commit is contained in:
Chayapak 2023-07-03 16:34:34 +07:00
parent e2c8374431
commit 7b695c87c7

View file

@ -25,10 +25,12 @@ io.on('connection', (socket) => {
} }
} }
socket.on('setFunctions', (...args) => { socket.on('setFunctions', (jsonArray) => {
const parsed = JSON.parse(jsonArray)
functions = {} functions = {}
for (const eachFuntion of args) { for (const eachFuntion of parsed) {
functions[eachFuntion] = (...args) => socket.emit(BRIDGE_PREFIX + eachFuntion, ...args) functions[eachFuntion] = (...args) => socket.emit(BRIDGE_PREFIX + eachFuntion, ...args)
} }