Make guessing phase while hearing
All checks were successful
Publish Docker image / Push Docker image to Docker Hub (push) Successful in 1m55s
All checks were successful
Publish Docker image / Push Docker image to Docker Hub (push) Successful in 1m55s
This commit is contained in:
@ -55,18 +55,22 @@ module.exports = (io) => (socket) => {
|
||||
const roles = gameController.getRoles(roomId);
|
||||
const selectedSong = gameController.getSelectedSong(roomId);
|
||||
const timeLeft = gameController.getTimeRemaining(roomId);
|
||||
const songOptions = gameController.getSongOptions(roomId);
|
||||
|
||||
io.to(roomId).emit('roles-assigned', roles);
|
||||
|
||||
Object.entries(roles).forEach(([userId, role]) => {
|
||||
if (role === 'composer') {
|
||||
io.to(userId).emit('song-selected', selectedSong);
|
||||
} else {
|
||||
io.to(userId).emit('song-options', { songOptions });
|
||||
}
|
||||
});
|
||||
|
||||
io.to(roomId).emit('round-started', {
|
||||
round: gameController.getRoundResults(roomId).round,
|
||||
timeRemaining: timeLeft
|
||||
timeRemaining: timeLeft,
|
||||
phase: 'composing'
|
||||
});
|
||||
|
||||
startPhaseTimer(roomId);
|
||||
@ -84,7 +88,8 @@ module.exports = (io) => (socket) => {
|
||||
|
||||
io.to(roomId).emit('phase-changed', {
|
||||
phase: 'guessing',
|
||||
timeRemaining: timeLeft
|
||||
timeRemaining: timeLeft,
|
||||
message: 'Time to submit your final answer!'
|
||||
});
|
||||
|
||||
Object.entries(roles).forEach(([userId, role]) => {
|
||||
|
Reference in New Issue
Block a user