mirror of
https://github.com/randyjc/Rahoot.git
synced 2026-03-13 20:15:35 +01:00
Add leaderboard & Manager some features
This commit is contained in:
@@ -17,7 +17,7 @@ const Player = {
|
||||
id: socket.id,
|
||||
points: 0,
|
||||
}
|
||||
socket.to(player.room).emit("manager:newPlayer", playerData)
|
||||
socket.to(player.room).emit("manager:newPlayer", { ...playerData })
|
||||
|
||||
game.players.push(playerData)
|
||||
|
||||
|
||||
@@ -28,6 +28,11 @@ const sleep = (sec) => new Promise((r) => setTimeout(r, sec * 1000))
|
||||
export const startRound = async (game, io, socket) => {
|
||||
const question = game.questions[game.currentQuestion]
|
||||
|
||||
io.to(game.room).emit("game:updateQuestion", {
|
||||
current: game.currentQuestion + 1,
|
||||
total: game.questions.length,
|
||||
})
|
||||
|
||||
io.to(game.room).emit("game:status", {
|
||||
name: "SHOW_QUESTION",
|
||||
data: {
|
||||
|
||||
Reference in New Issue
Block a user