Skip to content

Instantly share code, notes, and snippets.

@thejh
Created February 12, 2012 22:27
Show Gist options
  • Save thejh/1811209 to your computer and use it in GitHub Desktop.
Save thejh/1811209 to your computer and use it in GitHub Desktop.
// wrong
var playerRooms = function(id){
client.hget("player_" + user.id, "total", function(err, rep){
if (parseInt(resp) >= max_rooms && max_rooms > 0) {
return false;
} else {
return true;
}
});
};
// should work
var playerRooms = function(id, cb){
client.hget("player_" + user.id, "total", function(err, rep){
cb( ! (parseInt(resp) >= max_rooms && max_rooms > 0) )
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment