Add users to game room when they create a game.
This commit is contained in:
parent
d49b214762
commit
e3d9bc7e13
1 changed files with 3 additions and 0 deletions
|
|
@ -25,6 +25,9 @@ export const HostGame = (socket: Socket, data: HostGame) => {
|
|||
game_code = generate_game_code();
|
||||
}
|
||||
|
||||
// Add the user to the game's room
|
||||
socket.join(game_code);
|
||||
|
||||
let game = new Game(game_code, data.username)
|
||||
|
||||
active_games[game_code] = game;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue