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