From 6356960672b2597335e159d3ca593d1e63a85128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laure=CE=B7t?= Date: Mon, 1 Nov 2021 00:55:59 +0100 Subject: [PATCH] fix: removed useless logging feat: emulator now ask for input every frame --- src/emulator.py | 2 ++ src/server.py | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/emulator.py b/src/emulator.py index 805e056..4e61934 100644 --- a/src/emulator.py +++ b/src/emulator.py @@ -55,6 +55,8 @@ async def main(): key = KEYMAP[action] core.set_keys(key) logging.debug(f"pressing: {key}") + elif action == "null": + pass else: logging.error(f"unsupported action: {data}") diff --git a/src/server.py b/src/server.py index fe4de09..c794a4c 100644 --- a/src/server.py +++ b/src/server.py @@ -55,7 +55,6 @@ def clear_votes(): VOTES[key] = 0 for user in USERS: user.has_voted = False - logging.info(f"votes cleared: {VOTES}") def next_move(): @@ -92,15 +91,11 @@ async def handler(websocket, path): VOTES[action] += 1 user.last_message = time.time() user.has_voted = True - logging.debug(f"key received: {action} ({VOTES[action]}), from {user}") else: logging.error(f"unsupported action: {data}") if "admin" in data: admin = data["admin"] - - print(admin) - if admin == "save": await EMULATOR.send('{"admin":"save"}') elif admin == "load": @@ -115,7 +110,6 @@ async def handler(websocket, path): if EMULATOR and websocket == EMULATOR: move = next_move() await EMULATOR.send(f'{{"action":"{move}"}}') - logging.info(f"vote sent: {move}") clear_votes() else: logging.error(f"user is not EMULATOR: {user}")