From 996f62c4e43818bf3b574d86ad19f994d727f60c Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 7 Mar 2021 19:37:24 +0100 Subject: multiple simultaneous games :tada: --- pages/game.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pages') diff --git a/pages/game.tsx b/pages/game.tsx index f401bfa..660156d 100644 --- a/pages/game.tsx +++ b/pages/game.tsx @@ -64,12 +64,14 @@ class VoerGame extends Component { winPositions: Array>; outcome: number; board: Array; + saidHello: boolean; } = { userID: "", turn: true, winPositions: [], outcome: -1, board: [], + saidHello: false, }; board = [...Array(this.width * this.height)].map(() => 0); @@ -83,6 +85,7 @@ class VoerGame extends Component { } render() { + this.props.active && this.io.emit("registerGameListener", { game_id: this.props.gameID }); return
{ margin: "0 auto" }}> this.move(m % this.width + 1)} active={this.props.active == true && this.state.outcome == -1}/> - +
} -- cgit v1.2.3