Fix /player.
This commit is contained in:
parent
85c7add252
commit
cf05499e43
10
server.py
10
server.py
|
@ -36,12 +36,14 @@ def player(db):
|
||||||
player = get_player(db)
|
player = get_player(db)
|
||||||
if player is False:
|
if player is False:
|
||||||
return jsonify(errors._401), 401
|
return jsonify(errors._401), 401
|
||||||
|
noq = len(player.get_quests(None))
|
||||||
|
nosq = len(player.get_side_quests(None))
|
||||||
return jsonify({
|
return jsonify({
|
||||||
"xp": player.get_points(),
|
"xp": player.get_points(),
|
||||||
"quests_completed": len(player.get_quests()),
|
"quests_completed": noq - len(player.get_quests()),
|
||||||
"total_quests": len(player.get_quests(None)),
|
"total_quests": noq,
|
||||||
"side_quests_completed": len(player.get_side_quests()),
|
"side_quests_completed": nosq - len(player.get_side_quests()),
|
||||||
"total_side_quests": len(player.get_side_quests(None)),
|
"total_side_quests": nosq,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue