Created
February 12, 2012 22:29
-
-
Save thejh/1811227 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
// wrong | |
two: function(callback){ | |
// See if the player can join anymore rooms | |
if (playerRooms(user.id) == false || roomExists(data.room) < 1) { | |
socket.emit('error', "You can't join this table."); | |
return false; | |
} | |
callback(null, 1); | |
}, | |
// should work | |
two: function(callback){ | |
// See if the player can join anymore rooms | |
playerRooms(user.id, function(playerRoomsResult) { | |
if (playerRoomsResult == false || roomExists(data.room) < 1) { | |
socket.emit('error', "You can't join this table."); | |
return false; // this line is still wrong | |
} | |
callback(null, 1); | |
}) | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment