% endif
+##### STATS #####
+% if game_stats:
+<h2>Overall Game Stats</h2>
+<table class="accuracy-table" border="1" cellpadding="3" align="center">
+ <tr>
+ <td>Playing Time</td><td>${game_stats['total_alivetime']}</td>
+ <td>Drops</td><td>${game_stats['total_drops']}</td>
+ </tr>
+ <tr>
+ <td>Average Rank</td><td>${game_stats['avg_rank']}</td>
+ <td>Returns</td><td>${game_stats['total_returns']}</td>
+ </tr>
+ <tr>
+ <td>Score</td><td>${game_stats['total_score']}</td>
+ <td>Carrier Kills</td><td>${game_stats['total_carrier_frags']}</td>
+ </tr>
+ <tr>
+ <td>Kills</td><td>${game_stats['total_kills']}</td>
+ <td>Collects</td><td>${game_stats['total_collects']}</td>
+ </tr>
+ <tr>
+ <td>Deaths</td><td>${game_stats['total_deaths']}</td>
+ <td>Destroys</td><td>${game_stats['total_destroys']}</td>
+ </tr>
+ <tr>
+ <td>Suicides</td><td>${game_stats['total_suicides']}</td>
+ <td>Destroys (with key)</td><td>${game_stats['total_destroys']}</td>
+ </tr>
+ <tr>
+ <td>Captures</td><td>${game_stats['total_captures']}</td>
+ <td>Pushes</td><td>${game_stats['total_pushes']}</td>
+ </tr>
+ <tr>
+ <td>Pickups</td><td>${game_stats['total_pickups']}</td>
+ <td>Pushed</td><td>${game_stats['total_pushed']}</td>
+ </tr>
+</table>
+% endif
+
##### ACCURACY #####
% if weapon_stats:
-<h2>Accuracy</h2>
+<h2>Overall Accuracy</h2>
${accuracy(weapon_stats)}
% endif
<a href="${request.route_url("player_game_index", player_id=player.player_id, page=1)}" title="Game index for ${player.nick}">More games</a> played by ${player.nick_html_colors()}...
% endif
-
+##### RECENT GAMES (v2) ####
+<table class="accuracy-table" border="1" cellpadding="3" align="center">
+<tr>
+ <td>Game Type</td>
+ <td>Map</td>
+ <td>Result</td>
+ <td>Played</td>
+</tr>
+% for (gamestat, game, server, map) in recent_games:
+<tr>
+ <td>${game.game_type_cd}</td>
+ <td>${map.name}</td>
+ <td>
+ % if gamestat.team != None and gamestat.team == game.winner:
+ Win
+ % else:
+ Loss
+ % endif
+ </td>
+ <td>${game.start_dt}</td>
+</tr>
+% endfor
filter(Game.map_id == Map.map_id).\\r
order_by(Game.game_id.desc())[0:10]\r
\r
+ game_stats = {}\r
+ (game_stats['avg_rank'], game_stats['total_kills'], \r
+ game_stats['total_deaths'], game_stats['total_suicides'], \r
+ game_stats['total_score'], game_stats['total_time'], \r
+ game_stats['total_held'], game_stats['total_captures'], \r
+ game_stats['total_pickups'],game_stats['total_drops'], \r
+ game_stats['total_returns'], game_stats['total_collects'], \r
+ game_stats['total_destroys'], game_stats['total_dhk'], \r
+ game_stats['total_pushes'], game_stats['total_pushed'], \r
+ game_stats['total_carrier_frags'], \r
+ game_stats['total_alivetime']) = DBSession.\\r
+ query("avg_rank", "total_kills", "total_deaths", \r
+ "total_suicides", "total_score", "total_time", "total_held",\r
+ "total_captures", "total_pickups", "total_drops", \r
+ "total_returns", "total_collects", "total_destroys", \r
+ "total_dhk", "total_pushes", "total_pushed", \r
+ "total_carrier_frags", "total_alivetime").\\r
+ from_statement(\r
+ "select round(avg(rank)) avg_rank, sum(kills) total_kills, "\r
+ "sum(deaths) total_deaths, sum(suicides) total_suicides, "\r
+ "sum(score) total_score, sum(time) total_time, "\r
+ "sum(held) total_held, sum(captures) total_captures, "\r
+ "sum(pickups) total_pickups, sum(drops) total_drops, "\r
+ "sum(returns) total_returns, sum(collects) total_collects, "\r
+ "sum(destroys) total_destroys, sum(destroys_holding_key) total_dhk, "\r
+ "sum(pushes) total_pushes, sum(pushed) total_pushed, "\r
+ "sum(carrier_frags) total_carrier_frags, "\r
+ "sum(alivetime) total_alivetime "\r
+ "from player_game_stats "\r
+ "where player_id=:player_id"\r
+ ).params(player_id=player_id).one()\r
+\r
+ for (key,value) in game_stats.items():\r
+ if value == None:\r
+ game_stats[key] = '-'\r
+\r
except Exception as e:\r
player = None\r
weapon_stats = None\r
+ game_stats = None\r
recent_games = None\r
+ raise e\r
return {'player':player, \r
'recent_games':recent_games,\r
- 'weapon_stats':weapon_stats}\r
+ 'weapon_stats':weapon_stats,\r
+ 'game_stats':game_stats}\r
\r
\r
def player_game_index(request):\r