headless: update new clients when they connect (by triggering a state send without osc sends in the other clients); fixes #29

This commit is contained in:
jean-emmanuel 2016-09-29 23:45:25 +02:00
parent 5d3284c7b0
commit bd7f56100e
4 changed files with 28 additions and 3 deletions

View file

@ -39,10 +39,14 @@ module.exports = function(settings) {
var name = e.data[0],
data = e.data[1]
if (callbacks[name]) callbacks[name](data,socket.id)
if (name=='sendOsc' && data.sync!==false) {
if ((name=='sendOsc' && data.sync!==false) || name=='syncOsc') {
// synchronize all other connected clients
socket.broadcast.emit('receiveOsc',data)
}
if (name=='sessionOpened') {
// synchronize all other connected clients
socket.broadcast.emit('stateSend',data)
}
});
});
}