cjstewart88/TubalrDJ — pull request #2 by ledbettj (2013-01-12 18:59:01+00:00)
Title: Socket Server improvements/changes.

Again, a lot of rework since I'm still trying to figure out node and socket.io.

This implementation is compatible with the current client side code. Here's what's changed:

* instead of using `socket.get` and `socket.set` to keep track of client usernames, we store them in our own hash, along with what DJ they're listening to (if any).
* this allows us to check if they were listening in the `disconnect` event, so we can send out a `PART` notification. This means that join/part/listener count should now be working OK.
* users who connect and attempt to register as a username that is already taken (e.g., if you try to listen to your own DJ stream, or if you are not signed in) will be assigned a name like `cody#2` or `guest#13`.