mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
add multiworld size limit to rolling endpoint
This commit is contained in:
@@ -59,6 +59,10 @@ def generate_api():
|
|||||||
if json_data:
|
if json_data:
|
||||||
# example: options = {"player1weights" : {<weightsdata>}}
|
# example: options = {"player1weights" : {<weightsdata>}}
|
||||||
options = json_data["weights"]
|
options = json_data["weights"]
|
||||||
|
if len(options) > app.config["MAX_ROLL"]:
|
||||||
|
return {"text": "Max size of multiworld exceeded",
|
||||||
|
"detail": app.config["MAX_ROLL"]}, 409
|
||||||
|
|
||||||
race = bool(json_data["race"])
|
race = bool(json_data["race"])
|
||||||
results, gen_options = roll_yamls(options)
|
results, gen_options = roll_yamls(options)
|
||||||
if any(type(result) == str for result in results.values()):
|
if any(type(result) == str for result in results.values()):
|
||||||
|
Reference in New Issue
Block a user