Add Manager Skip button on quiz

This commit is contained in:
Ralex91
2024-02-08 19:37:15 +01:00
parent 8a9b8df7d2
commit 324316bc38
4 changed files with 25 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
import { GAME_STATE_INIT } from "../quizz.config.js"
import { startRound } from "../utils/round.js"
import generateRoomId from "../utils/generateRoomId.js"
import { cooldown, sleep } from "../utils/cooldown.js"
import { abortCooldown, cooldown, sleep } from "../utils/cooldown.js"
import deepClone from "../utils/deepClone.js"
const Manager = {
@@ -77,6 +77,18 @@ const Manager = {
startRound(game, io, socket)
},
abortQuiz: (game, io, socket) => {
if (!game.started) {
return
}
if (socket.id !== game.manager) {
return
}
abortCooldown(game, io, game.room)
},
showLoaderboard: (game, io, socket) => {
if (!game.questions[game.currentQuestion + 1]) {
socket.emit("game:status", {