From b29415a0d73be9479ea32ffaf1b1e9f683b43716 Mon Sep 17 00:00:00 2001 From: Dane Johnson Date: Wed, 15 Feb 2023 15:05:20 -0600 Subject: [PATCH] Start timing work --- venture/app.py | 13 +++++++++++++ venture/game.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/venture/app.py b/venture/app.py index 200429e..2f7ab13 100644 --- a/venture/app.py +++ b/venture/app.py @@ -33,6 +33,14 @@ def on_join_contestant(data): 'signature': signature}, to=session.room) +@socketio.on('buzz') +def on_buzz(): + contestant = session.game[request.sid] + if contestant.locked: + return + emit('contestant-buzzed', {'sid': request.sid}, to=session.room) + + # Host @socketio.on('host-join') def on_join_host(data): @@ -65,6 +73,11 @@ def on_activate_clue(data): emit('active-clue', match, to=session.room) +@socketio.on('start-clue-clock') +def on_start_clue_clock(): + emit('clue-clock-on', to=session.room) + + def main(): socketio.run(app, host='0.0.0.0', debug=True) diff --git a/venture/game.py b/venture/game.py index b4f7048..a7de2bf 100644 --- a/venture/game.py +++ b/venture/game.py @@ -8,7 +8,7 @@ MAX_CATEGORIES = 28100 class Game: def __init__(self, code): self.code = code - self.locked = True + self.locked = False self.players = {} self.categories = {}