Skip to content

Instantly share code, notes, and snippets.

@lastlegion
Created July 4, 2013 08:17
Show Gist options
  • Save lastlegion/5925862 to your computer and use it in GitHub Desktop.
Save lastlegion/5925862 to your computer and use it in GitHub Desktop.
Handling socket events in wordelta
setEventHandlers = function( ) {
io.sockets.on("connection", onSocketConnection);
}
onSocketConnection = function(client){
players++;
client.on("new player", onNewPlayer);
client.on("add word", onAddWord);
client.on("disconnect", onDisconnect);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment