From c1260061984abffea157f80d072fae31fd82de25 Mon Sep 17 00:00:00 2001 From: Alberto Xamin Date: Fri, 29 Jan 2021 20:50:37 +0100 Subject: [PATCH] fix spectate without password --- backend/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/__init__.py b/backend/__init__.py index 622ab2c..91a323e 100644 --- a/backend/__init__.py +++ b/backend/__init__.py @@ -162,9 +162,9 @@ def toggle_replace_with_bot(sid): def join_room(sid, room): room_name = room['name'] i = [g.name for g in games].index(room_name) + if games[i].password != '' and games[i].password != room['password'].upper(): + return if not games[i].started: - if games[i].password != '' and games[i].password != room['password'].upper(): - return print(f'{sid} joined a room named {room_name}') sio.leave_room(sid, 'lobby') sio.enter_room(sid, room_name)