From: Raphaƫl Jakse Date: Sun, 12 Apr 2020 18:14:36 +0000 (+0200) Subject: Stop sending all player information to everyone on many actions X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=2a59a9173196422aa23e868c7d0b3a5a1e5f4507;p=trivabble.git Stop sending all player information to everyone on many actions --- diff --git a/trivabble-server.js b/trivabble-server.js index 4171a1e..7bbabc9 100644 --- a/trivabble-server.js +++ b/trivabble-server.js @@ -442,22 +442,20 @@ function countTiles(rack) { return count; } -function joinGame(gameNumber, playerName) { +function joinGame(gameNumber) { if (!gameNumber) { gameNumber = newGameId(); } const game = games[gameNumber] || (games[gameNumber] = new Game()); - game.playerJoined(playerName); - return {gameNumber, game}; } function handleCommand(cmd, gameNumber, playerName, response) { let game; - ({gameNumber, game} = joinGame(gameNumber, playerName)); + ({gameNumber, game} = joinGame(gameNumber)); game.lastUpdated = new Date(); let rack = null; @@ -664,7 +662,7 @@ function handleCommand(cmd, gameNumber, playerName, response) { function handleCommands(cmds, responseAndIsES) { if (!cmds.cmds || !cmds.cmds.length) { - const {gameNumber, game} = joinGame(cmds.gameNumber, cmds.playerName); + const {gameNumber, game} = joinGame(cmds.gameNumber); writeResponse(responseAndIsES, JSON.stringify({