
var config = {
  server_port: 5000,
  server_opts: {}
};

var server = require('http').Server();
var serverio = require('socket.io').listen(server, config.server_opts);
server.listen(config.server_port);

var players = [];

var data = require('../data/apples.json');
var red = data.red,
  green = data.green;

serverio.of('/game').on('connection', function(socket) {
  // TODO: add socket

  socket.on('disconnect', function() {
    // TODO: remove socket
  });

  socket.on('authme', function() {

  });
});

@@ -197,16 +197,38 @@
 r_port);
+%0Avar _ = require('_');
 %0A%0Avar pl
@@ -386,30 +386,8 @@
 t) %7B
-%0A  // TODO: add socket
 %0A%0A  
@@ -431,30 +431,94 @@
     
-// TODO: remove socket
+players = _.without(players, socket);%0A    console.log('Player count', players.length);
 %0A  %7D
@@ -556,16 +556,43 @@
 ion() %7B%0A
+    players.append(socket);
 %0A  %7D);%0A%7D

Add players to server on connect