Skip to content

Instantly share code, notes, and snippets.

jack: function(req, res) {
if (req.isSocket && req.body.hasOwnProperty('gameId') && req.body.hasOwnProperty('pNum') && req.body.hasOwnProperty('thiefId') && req.body.hasOwnProperty('victimId') && req.body.hasOwnProperty('jackId') && req.body.hasOwnProperty('targetId')) {
Game.findOne(req.body.gameId).populate('players').populate('deck').populate('scrap').exec(function(error, game) {
if (error || !game) {
console.log("Game " + req.body.gameId + " not found for jack");
res.send(404);
} else {
Player.find([req.body.thiefId, req.body.victimId]).populate('hand').populate('points').populate('runes').exec(function(erro, players) {
if (erro || !players[0] || !players[1]) {