From: Ant Zucaro Date: Sun, 1 Sep 2013 21:40:18 +0000 (-0400) Subject: Pull various things from params. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8a0cfb47ee3f03476ba0301ebcfe7b41a1e67e08;p=xonotic%2Fxonstat.git Pull various things from params. --- diff --git a/xonstat/views/player.py b/xonstat/views/player.py index 421eb7a..ce43fdf 100644 --- a/xonstat/views/player.py +++ b/xonstat/views/player.py @@ -1036,12 +1036,29 @@ def player_captimes(request): def player_captimes_json(request): return player_captimes_data(request) + def player_nvd3_damage(request): player_id = int(request.matchdict['id']) if player_id <= 2: player_id = -1; - return {} + game_type_cd = None + if request.params.has_key("game_type"): + game_type_cd = request.params["game_type"] + + limit = 20 + if request.params.has_key("limit"): + limit = int(request.params["limit"]) + + if limit < 0: + limit = 20 + if limit > 50: + limit = 50 + + return { "player_id": player_id, + "game_type_cd": game_type_cd, + "limit": limit, + } def player_damage_data_v2(request): player_id = request.matchdict["id"]