From d5d93a126a0872a258f22577cba2731696791068 Mon Sep 17 00:00:00 2001 From: clerie Date: Tue, 3 Apr 2018 12:50:22 +0200 Subject: [PATCH] Repaired emit broadcaster --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 9e64581..f0503b4 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,7 @@ app.use(express.static(__dirname + '/public')); function onConnection(socket){ socket.on('input', function(data) { + console.log(data); var command = data.split(" "); if (command.lenght() == 4) { if (command[0] == "PX") { @@ -16,7 +17,7 @@ function onConnection(socket){ var y = parseInt(command[2]); if (!isNaN(x) && !isNaN(y)) { var color = command[3] - socket.broadcast.emit('draw', {type: 'pixel', x: x, y: y, color: color}})); + socket.broadcast.emit('draw', {type: 'pixel', x: x, y: y, color: color}); } } }