diff --git a/chat.js b/chat.js index b1f5aec..59b86f8 100644 --- a/chat.js +++ b/chat.js @@ -44,7 +44,7 @@ io.on('connection', function (socket) { socket.iid = randint(9999999); socket.name = 'anonymous#' + ('0000' + randint(0,9999)).slice(-4); socket.color = randomColor(); - list[socket.iid] = socket; + list['u'+socket.iid] = socket; console.log(socket.name + ' connected'); socket.emit('chat message', { color: '#fff', @@ -61,7 +61,7 @@ io.on('connection', function (socket) { text: '' + escapeHtml(socket.name) + ' connected.' }); socket.on('disconnect', function () { - delete list[socket.iid]; + delete list['u'+socket.iid]; console.log(socket.name + ' disconnected'); io.emit('chat message', { color: '#fff',