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:
parent
5d3284c7b0
commit
bd7f56100e
4 changed files with 28 additions and 3 deletions
|
|
@ -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)
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue