hide on disconnection

This commit is contained in:
catvayor 2022-09-09 17:37:30 +02:00
parent ae58a69b02
commit a7606f1c74

View file

@ -84,6 +84,12 @@ io.sockets.on('connection', function(socket){
for(i in equipes) for(i in equipes)
equipes[i].emit('setName', {"id": socket.id, "name": d.name}); 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}); socket.emit('yourId', {"id": socket.id});
for(i in equipes){ for(i in equipes){