Showing
1 changed file
with
1 additions
and
2 deletions
| ... | @@ -85,7 +85,6 @@ app.use(router) // router 정의 | ... | @@ -85,7 +85,6 @@ app.use(router) // router 정의 |
| 85 | 85 | ||
| 86 | // Socket.io | 86 | // Socket.io |
| 87 | 87 | ||
| 88 | - | ||
| 89 | var chatnamespace = io.of('/chatnamespace') | 88 | var chatnamespace = io.of('/chatnamespace') |
| 90 | 89 | ||
| 91 | io.sockets.on('connection', function(socket) { | 90 | io.sockets.on('connection', function(socket) { |
| ... | @@ -127,7 +126,7 @@ io.sockets.on('connection', function(socket) { | ... | @@ -127,7 +126,7 @@ io.sockets.on('connection', function(socket) { |
| 127 | /* 접속 종료 */ | 126 | /* 접속 종료 */ |
| 128 | socket.on('disconnect', function() { | 127 | socket.on('disconnect', function() { |
| 129 | if(socket.name != undefined){ | 128 | if(socket.name != undefined){ |
| 130 | - console.log(logString+socket.name + ' 님이 나가셨습니다.') | 129 | + console.log(logString+socket.name + ' 님이 나가셨습니다.('+ip+')') |
| 131 | /* 나가는 사람을 제외한 나머지 유저에게 메시지 전송 */ | 130 | /* 나가는 사람을 제외한 나머지 유저에게 메시지 전송 */ |
| 132 | socket.broadcast.emit('update', {type: 'disconnect', name: 'SERVER', message: socket.name + '님이 나가셨습니다.'}); | 131 | socket.broadcast.emit('update', {type: 'disconnect', name: 'SERVER', message: socket.name + '님이 나가셨습니다.'}); |
| 133 | } | 132 | } | ... | ... |
-
Please register or login to post a comment