This file contains hidden or 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
| // New connection | |
| io.of('/game').sockets.on('connection', function(socket) { | |
| // Login using the token sent to us from the client | |
| socket.on('login', function(token) { | |
| // New player requires a new player object | |
| var player = new Player(token); | |
| // We can only perform other options once the login has completed | |
| player.login(function(player) { | |
| // Remember the player on the socket |