Created
November 15, 2011 20:40
-
-
Save alexciarlillo/1368272 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 io.sockets.on('connection', function(socket) { | |
114 var user = new User(socket); | |
115 | |
116 socket.on('set-nick', function(nick, response) { | |
117 user.setNick(nick, response); | |
118 }); | |
119 | |
120 socket.on('join-platform', function(data, response) { | |
121 user.joinPlatform(platforms, data, response); | |
122 | |
123 }); | |
124 | |
125 socket.on('message', function(data) { | |
126 data.platforms = platforms; | |
127 user.sendMessage(data); | |
128 }); | |
129 | |
130 socket.on('disconnect', function() { | |
131 data = {platforms:platforms}; | |
132 user.leaveAll(data); | |
133 }); | |
134 }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment