Allow leaving queue to not break other user's games

This commit is contained in:
0880
2026-01-21 14:01:23 +03:30
parent ce5b660350
commit d4a7b41d70

9
app.py
View File

@@ -289,7 +289,14 @@ async def quick_match(request: Request):
return JSONResponse({"room_id": quick_map[qid]})
else:
return JSONResponse({}) # Client handles empty as continue to wait
elif (
data
and len(data) == 2
and "queue_id" in data
and data["queue_id"] in quick_queue
and "leave" in data
):
quick_queue.remove(data["queue_id"])
else:
qid = str(uuid.uuid4())
quick_queue.append(qid)