]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Merge branch 'master' into zykure/wip
authorJan Behrens <zykure@web.de>
Wed, 8 Jan 2014 18:08:05 +0000 (19:08 +0100)
committerJan Behrens <zykure@web.de>
Wed, 8 Jan 2014 18:08:05 +0000 (19:08 +0100)
Conflicts:
xonstat/__init__.py
xonstat/views/player.py

1  2 
xonstat/__init__.py
xonstat/views/player.py

Simple merge
index 38fced4969237c3d1109a73cb7308c729f336bbd,19ec08165039cd55790f70f51dc757b8284ceb09..75e9ff8b5651759747dd69f74979e929d88160d9
@@@ -788,11 -789,13 +789,17 @@@ def player_damage_json(request)
  
  
  def player_hashkey_info_data(request):
 -    (hashkey, status) = verify_request(request)
+     # hashkey = request.matchdict['hashkey']
+     # the incoming hashkey is double quoted, and WSGI unquotes once...
+     # hashkey = unquote(hashkey)
+     # if using request verification to obtain the hashkey
 +    (idfp, status) = verify_request(request)
 +    log.debug("d0_blind_id verification: idfp={0} status={1}\n".format(idfp, status))
 +
 +    log.debug("\n----- BEGIN REQUEST BODY -----\n" + request.body +
 +            "----- END REQUEST BODY -----\n\n")
  
      # if config is to *not* verify requests and we get nothing back, this
      # query will return nothing and we'll 404.
          player = DBSession.query(Player).\
                  filter(Player.player_id == Hashkey.player_id).\
                  filter(Player.active_ind == True).\
 -                filter(Hashkey.hashkey == hashkey).one()
 +                filter(Hashkey.hashkey == idfp).one()
  
-         games_played   = get_games_played(player.player_id)
-         overall_stats  = get_overall_stats(player.player_id)
-         fav_maps       = get_fav_maps(player.player_id)
-         elos           = get_elos(player.player_id)
-         ranks          = get_ranks(player.player_id)
+         games_played      = get_games_played(player.player_id)
+         overall_stats     = get_overall_stats(player.player_id)
+         fav_maps          = get_fav_maps(player.player_id)
+         elos              = get_elos(player.player_id)
+         ranks             = get_ranks(player.player_id)
+         most_recent_game  = get_recent_games(player.player_id, 1)[0]
  
      except Exception as e:
          raise pyramid.httpexceptions.HTTPNotFound
@@@ -909,12 -919,10 +923,18 @@@ def player_elo_info_data(request)
      """
      Provides elo information on a specific player. Raw data is returned.
      """
 +    (idfp, status) = verify_request(request)
 +    log.debug("d0_blind_id verification: idfp={0} status={1}\n".format(idfp, status))
 +
      hashkey = request.matchdict['hashkey']
++<<<<<<< HEAD
 +    log.debug("\n----- BEGIN REQUEST BODY -----\n" + request.body +
 +            "----- END REQUEST BODY -----\n\n")
++=======
+     # the incoming hashkey is double quoted, and WSGI unquotes once...
+     hashkey = unquote(hashkey)
++>>>>>>> master
  
      try:
          player = DBSession.query(Player).\