Skip to content
Snippets Groups Projects
Commit 4f81a10e authored by zm343's avatar zm343
Browse files

Restart code

parent 8dced98e
No related branches found
No related tags found
1 merge request!16Potential restart
......@@ -145,6 +145,15 @@ socket.addEventListener("message", (event) => {
messages.appendChild(messageElement);
updateNumberPlayers(msg.numPlayers);
} else if (msg.type === "restart") {
const messages = document.getElementById("chatOutput");
const messageElement = document.createElement("div");
messageElement.innerText = `Player ${msg.pid} is the WINNER!`;
messages.appendChild(messageElement);
setTimeout(() => {
//Redirect back to lobby after 10 seconds
window.location.href = msg.url;
}, 10000);
}
} catch (e) {
console.log(e.message);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment