config.add_route("nvd3_damage", "/player/{id:\d+}/nvd3-damage")
config.add_view(player_nvd3_damage, route_name="nvd3_damage", renderer="nvd3_damage.mako")
- config.add_route("player_damage_data_v2", "/player/{id:\d+}/damage-v2")
- config.add_view(player_damage_data_v2, route_name="player_damage_data_v2", renderer="jsonp")
+ config.add_route("player_weaponstats_data_json", "/player/{id:\d+}/weaponstats.json")
+ config.add_view(player_weaponstats_data_json, route_name="player_weaponstats_data_json", renderer="jsonp")
# GAME ROUTES
config.add_route("game_info", "/game/{id:\d+}")
from xonstat.views.player import player_elo_info_text, player_elo_info_json
from xonstat.views.player import player_hashkey_info_text, player_hashkey_info_json
from xonstat.views.player import player_captimes, player_captimes_json
-from xonstat.views.player import player_nvd3_damage, player_damage_data_v2
+from xonstat.views.player import player_nvd3_damage, player_weaponstats_data_json
from xonstat.views.game import game_info, rank_index
from xonstat.views.game import game_info_json, rank_index_json
"limit": limit,
}
-def player_damage_data_v2(request):
+def player_weaponstats_data_json(request):
player_id = request.matchdict["id"]
if player_id <= 2:
player_id = -1;
game_id=game_id, weapon_cd=weapon_cd))
- weapon_stats_raw = sorted(weapon_stats_raw, key=lambda x: x.game_id)
- games = sorted(games_to_weapons.keys())
- weapon_stats = [ws.to_dict() for ws in weapon_stats_raw]
-
- log.debug(games_to_weapons)
- log.debug(weapons_used)
- log.debug(games)
+ weapon_stats_raw = sorted(weapon_stats_raw, key = lambda x: x.game_id)
+ games = sorted(games_to_weapons.keys())
+ weapon_stats = [ws.to_dict() for ws in weapon_stats_raw]
return {
"weapon_stats": weapon_stats,