order_by(PlayerGameStat.rank).\
order_by(PlayerGameStat.score).all()
- return {'games':games,
+ return {'games':games,
'pgstats':pgstats}
return _game_index_data(request)
+def game_index_json(request):
+ """
+ Provides a list of current games, with the associated game stats.
+ These games are ordered by game_id, with the most current ones first.
+ Paginated. JSON.
+ """
+ return [{'status':'not implemented'}]
+
+
def _game_info_data(request):
game_id = request.matchdict['id']
+
+ if request.params.has_key('show_elo'):
+ show_elo = True
+ else:
+ show_elo = False
+
try:
notfound = False
order_by(PlayerGameStat.score).\
all()
+ captimes = []
+ if game.game_type_cd == 'ctf':
+ for pgstat in pgstats:
+ if pgstat.fastest_cap is not None:
+ captimes.append(pgstat)
+
+ captimes = sorted(captimes, key=lambda x:x.fastest_cap)
+
pwstats = {}
for (pwstat, pgstat, weapon) in DBSession.query(PlayerWeaponStat, PlayerGameStat, Weapon).\
filter(PlayerWeaponStat.game_id == game_id).\
map = None
pgstats = None
pwstats = None
+ captimes = None
+ show_elo = False
raise inst
return {'game':game,
'map':map,
'pgstats':pgstats,
'pwstats':pwstats,
+ 'captimes':captimes,
+ 'show_elo':show_elo,
}
return _game_info_data(request)
+def game_info_json(request):
+ """
+ List the game stats (scoreboard) for a particular game. Paginated. JSON.
+ """
+ return [{'status':'not implemented'}]
+
+
def _rank_index_data(request):
if request.params.has_key('page'):
current_page = request.params['page']
Provide a list of gametype ranks, paginated.
"""
return _rank_index_data(request)
+
+
+def rank_index_json(request):
+ """
+ Provide a list of gametype ranks, paginated. JSON.
+ """
+ return [{'status':'not implemented'}]