headless: sync other clients before sending osc
This commit is contained in:
parent
6d35679719
commit
d2791758f7
1 changed files with 7 additions and 5 deletions
|
|
@ -39,15 +39,17 @@ module.exports = function(settings) {
|
|||
socket.on('*', function(e){
|
||||
var name = e.data[0],
|
||||
data = e.data[1]
|
||||
if (callbacks[name]) callbacks[name](data,socket.id)
|
||||
if ((name=='sendOsc' && data.sync!==false) || name=='syncOsc') {
|
||||
// synchronize all other connected clients
|
||||
socket.broadcast.emit('receiveOsc',data)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if (callbacks[name]) callbacks[name](data,socket.id)
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue