mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 15:57:50 +01:00
On create or join, now retrieves initial game state form server and prints it in the console
This commit is contained in:
@@ -83,16 +83,16 @@ function createGame() {
|
||||
code += charPool[getRandomInt(61)]
|
||||
}
|
||||
console.log(code);
|
||||
let id = socket.id
|
||||
const game = new Game(
|
||||
code,
|
||||
gameSize,
|
||||
deck,
|
||||
document.getElementById("time").value,
|
||||
[document.getElementById("name").value]
|
||||
{ [socket.id]: document.getElementById("name").value }
|
||||
);
|
||||
|
||||
socket.emit('newGame', game);
|
||||
sessionStorage.setItem('accessCode', code);
|
||||
sessionStorage.setItem('code', code);
|
||||
window.location.replace('/' + code);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user