remove confusing newGame function

This commit is contained in:
Zutatensuppe 2021-04-30 01:03:43 +02:00
parent 7e0bb8357d
commit 85e9d14b02
4 changed files with 12 additions and 21 deletions

View file

@ -527,10 +527,12 @@ async function main() {
if (MODE === MODE_PLAY) {
const game = await Communication.connect(gameId, CLIENT_ID)
Game.newGame(Util.decodeGame(game))
const gameObject = Util.decodeGame(game)
Game.setGame(gameObject.id, gameObject)
} else if (MODE === MODE_REPLAY) {
const {game, log} = await Communication.connectReplay(gameId, CLIENT_ID)
Game.newGame(Util.decodeGame(game))
const gameObject = Util.decodeGame(game)
Game.setGame(gameObject.id, gameObject)
REPLAY.log = log
REPLAY.lastRealTs = Time.timestamp()
REPLAY.gameStartTs = REPLAY.log[0][REPLAY.log[0].length - 1]