added error, if room does not exist
This commit is contained in:
parent
109e4d7a8a
commit
d466e383d4
1 changed files with 9 additions and 6 deletions
|
@ -219,12 +219,15 @@ async def handle_config(sid, data):
|
||||||
|
|
||||||
@sio.on("register-web")
|
@sio.on("register-web")
|
||||||
async def handle_register_web(sid, data):
|
async def handle_register_web(sid, data):
|
||||||
async with sio.session(sid) as session:
|
if data["room"] in clients:
|
||||||
session["room"] = data["room"]
|
async with sio.session(sid) as session:
|
||||||
sio.enter_room(sid, session["room"])
|
session["room"] = data["room"]
|
||||||
state = clients[session["room"]]
|
sio.enter_room(sid, session["room"])
|
||||||
|
state = clients[session["room"]]
|
||||||
await sio.emit("state", state.queue.to_dict(), room=sid)
|
await sio.emit("state", state.queue.to_dict(), room=sid)
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
@sio.on("register-admin")
|
@sio.on("register-admin")
|
||||||
|
|
Loading…
Add table
Reference in a new issue