Merge branch '5-server-make-disconneted-client-invisible' into 'master'
hide on disconnection Closes #5 See merge request sgay/traque!6
This commit is contained in:
commit
fa9f4f9f28
1 changed files with 6 additions and 0 deletions
|
@ -86,6 +86,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){
|
||||||
|
|
Loading…
Reference in a new issue