custom-module: expose send and receive shorthands, expose client's address in app event handlers
This commit is contained in:
parent
9dadbf725f
commit
e7ec5208e1
4 changed files with 40 additions and 10 deletions
|
|
@ -51,10 +51,12 @@ var bindCallbacks = function(callbacks) {
|
|||
|
||||
ipc.on('connection', function(client) {
|
||||
|
||||
var clientInfos = {address: client.address, id: client.id}
|
||||
|
||||
for (let name in callbacks) {
|
||||
client.on(name, (data)=>{
|
||||
if (osc.customModule) {
|
||||
osc.customModuleEventEmitter.emit(name, data, client.id)
|
||||
osc.customModuleEventEmitter.emit(name, data, clientInfos)
|
||||
}
|
||||
callbacks[name](data, client.id)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue