From ee18ab397ded07830141d0f11ccde2ed67449b62 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 14 Jan 2022 20:36:30 +0100 Subject: Remove games from the environment when they end --- draughts/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/draughts/app.js b/draughts/app.js index b5a9fa5..5a4bab7 100644 --- a/draughts/app.js +++ b/draughts/app.js @@ -80,7 +80,9 @@ wss.on("connection", ws => { } }, ws) game.move(msg.body) - game.nextTurn() + + if (!game.nextTurn()) + env.removeGame(game) break } }) -- cgit v1.2.3