Compare commits

..

1 Commits

Author SHA1 Message Date
5b5210d5da Check for vibrate function 2020-12-11 08:30:39 +00:00
3 changed files with 9 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
FROM node:14 FROM node:12
WORKDIR /app WORKDIR /app

View File

@@ -108,11 +108,9 @@ function reset(roomId) {
room.canBuzz = true; room.canBuzz = true;
room.participants.forEach(p => { room.participants.forEach(p => {
if (p.ws) {
p.ws.send(JSON.stringify({ p.ws.send(JSON.stringify({
type: "reset" type: "reset"
})); }));
}
}); });
} }
@@ -139,13 +137,11 @@ function updateScore(roomId, participantId, points) {
participant.score += points; participant.score += points;
if (participant.ws) {
participant.ws.send(JSON.stringify({ participant.ws.send(JSON.stringify({
type: "score", type: "score",
score: participant.score, score: participant.score,
})); }));
} }
}
room.audience.forEach(ws => { room.audience.forEach(ws => {
ws.send(JSON.stringify({ ws.send(JSON.stringify({

View File

@@ -65,7 +65,7 @@
}; };
function beep() { function beep() {
if (window.navigator.vibrate) window.navigator.vibrate(500); window.navigator.vibrate(500);
} }
function updateScore(participantId, points) { function updateScore(participantId, points) {