diff --git a/traque.js b/traque.js index 4337589..685ce00 100644 --- a/traque.js +++ b/traque.js @@ -86,6 +86,12 @@ io.sockets.on('connection', function(socket){ for(i in equipes) equipes[i].emit('setName', {"id": socket.id, "name": d.name}); }); + socket.on("disconnect", function(_){ + socket.shown = false; + socket.color = -1; + for(i in equipes) + equipes[i].emit('changeColor', {"id": socket.id, "color": -1}); + }); socket.emit('yourId', {"id": socket.id}); for(i in equipes){