module.exports = function Server(expressInstance, sessionStore) {
	var parseCookie = require('connect').utils.parseCookie;
	var io = require('socket.io').listen(expressInstance);

	io.configure(function () {
		io.set('log level', 0);
	});

	io.set('authorization', function(handshakeData, ack) {
		var cookies = parseCookie(handshakeData.headers.cookie);
		sessionStore.get(cookies['connect.sid'], function(err, sessionData) {
			handshakeData.session = sessionData || {};
			handshakeData.sid = cookies['connect.sid']|| null;
			ack(err, err ? false : true);
		});
	});

	io.sockets.on('connection', function(client) {
    client.emit('woo', 'Hello!');

		client.on('disconnect', function() { console.log('disconnect'); });

    client.on('scoreSubmit', function(scoreData) {
      console.log('Score submitted: ' + scoreData.score);
    });
	});

	io.sockets.on('error', function(){ console.log(arguments); });

	return io;
};

@@ -59,16 +59,82 @@
 tore) %7B%0A
+var redis = require('redis'), redisClient = redis.createClient();%0A
 %09var par
@@ -846,42 +846,70 @@
     
-console.log('Score submitted: ' + 
+// TODO - identify player%0A      redisClient.zadd('HIGHSCORES',
 scor
@@ -919,16 +919,30 @@
 ta.score
+, 'playername'
 );%0A    %7D

Store high scores to redis set