players: ps, | players: ps, | ||||
index: i | index: i | ||||
}); | }); | ||||
p.on("close", function() { | |||||
players.forEach(function(p, i) { | |||||
p.send("gameover", { | |||||
msg: "Opponent quit." | |||||
}); | |||||
}); | |||||
}); | |||||
}); | }); | ||||
} | } | ||||
"author": "Martin Dørum Nygaard", | "author": "Martin Dørum Nygaard", | ||||
"license": "GPL-2.0", | "license": "GPL-2.0", | ||||
"dependencies": { | "dependencies": { | ||||
"socksugar": "^0.2.0" | |||||
"socksugar": "^0.3.1" | |||||
} | } | ||||
} | } |
stale: false | stale: false | ||||
} | } | ||||
if (args[2] === "runner") { | |||||
if (req.data.type === "runner") { | |||||
queues.runners.push(sock); | queues.runners.push(sock); | ||||
} else if (args[2] === "god") { | |||||
} else if (req.data.type === "god") { | |||||
queues.gods.push(sock); | queues.gods.push(sock); | ||||
} else { | } else { | ||||
return req.fail(); | return req.fail(); |