WebHost: fix /api/get_rooms and /api/get_seeds
This commit is contained in:
parent
684bb736bc
commit
1990b893e5
|
@ -65,7 +65,6 @@ def generate_api():
|
||||||
return {"text": "Uncaught Exception:" + str(e)}, 500
|
return {"text": "Uncaught Exception:" + str(e)}, 500
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@api_endpoints.route('/status/<suuid:seed>')
|
@api_endpoints.route('/status/<suuid:seed>')
|
||||||
def wait_seed_api(seed: UUID):
|
def wait_seed_api(seed: UUID):
|
||||||
seed_id = seed
|
seed_id = seed
|
||||||
|
|
|
@ -16,7 +16,6 @@ def get_rooms():
|
||||||
"last_port": room.last_port,
|
"last_port": room.last_port,
|
||||||
"timeout": room.timeout,
|
"timeout": room.timeout,
|
||||||
"tracker": room.tracker,
|
"tracker": room.tracker,
|
||||||
"players": room.seed.multidata["names"] if room.seed.multidata else [["Singleplayer"]],
|
|
||||||
})
|
})
|
||||||
return jsonify(response)
|
return jsonify(response)
|
||||||
|
|
||||||
|
@ -28,6 +27,6 @@ def get_seeds():
|
||||||
response.append({
|
response.append({
|
||||||
"seed_id": seed.id,
|
"seed_id": seed.id,
|
||||||
"creation_time": seed.creation_time,
|
"creation_time": seed.creation_time,
|
||||||
"players": seed.multidata["names"] if seed.multidata else [["Singleplayer"]],
|
"players": [(slot.player_name, slot.game) for slot in seed.slots],
|
||||||
})
|
})
|
||||||
return jsonify(response)
|
return jsonify(response)
|
Loading…
Reference in New Issue