fix spectate without password

This commit is contained in:
Alberto Xamin 2021-01-29 20:50:37 +01:00
parent c28e9b2429
commit c126006198
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2

View File

@ -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)