Allow leaving queue to not break other user's games
This commit is contained in:
9
app.py
9
app.py
@@ -289,7 +289,14 @@ async def quick_match(request: Request):
|
|||||||
return JSONResponse({"room_id": quick_map[qid]})
|
return JSONResponse({"room_id": quick_map[qid]})
|
||||||
else:
|
else:
|
||||||
return JSONResponse({}) # Client handles empty as continue to wait
|
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:
|
else:
|
||||||
qid = str(uuid.uuid4())
|
qid = str(uuid.uuid4())
|
||||||
quick_queue.append(qid)
|
quick_queue.append(qid)
|
||||||
|
|||||||
Reference in New Issue
Block a user