Esempio n. 1
0
def overall_player_stats(c, player):
  row = query_row(c, '''SELECT name, games_played, games_won,
                                 total_score, best_xl, best_score,
                                 first_game_start, last_game_end
                          FROM players
                         WHERE name = %s''', player)
  return fixup_player_stats(c, list(row))
Esempio n. 2
0
def overall_player_stats(c, player):
    row = query_row(
        c, '''SELECT name, games_played, games_won,
                                 total_score, best_xl, best_score,
                                 first_game_start, last_game_end
                          FROM players
                         WHERE name = %s''', player)
    return fixup_player_stats(c, list(row))
Esempio n. 3
0
def overall_player_stats(c, player):
    row = query_row(
        c, '''SELECT name, games_played, games_won,
                                 total_score, best_xl, best_score,
                                 first_game_start, last_game_end
                          FROM players
                         WHERE name = %s''', player)
    if row is None:
        raise crawl_utils.ScoringException(
            "Non-existent player '%s': interrupt during bulk import?" % player)
    else:
        return fixup_player_stats(c, list(row))
Esempio n. 4
0
def worst_xl_rune_find(c):
  row = query_row(c, '''SELECT xl, rune_time FROM low_xl_rune_finds
                        ORDER BY xl DESC, rune_time DESC LIMIT 1''')
  return (row[0], row[1])
Esempio n. 5
0
def canonicalize_player_name(c, player):
  row = query_row(c, '''SELECT name FROM players WHERE name = %s''',
                  player)
  if row:
    return row[0]
  return None
Esempio n. 6
0
def find_streak_breaker(c, sid):
  return row_to_xdict(
    query_row(c, game_select_from('streak_breakers') + " WHERE streak_id = %s",
              sid))
Esempio n. 7
0
def player_last_game(c, player):
  return (row_to_xdict(
      query_row(c, 'SELECT ' + scload.LOG_DB_SCOLUMNS
                + ''' FROM player_last_games WHERE name = %s''',
                player)))
Esempio n. 8
0
def player_best_game(c, player):
  return (row_to_xdict(
      query_row(c, 'SELECT ' + scload.LOG_DB_SCOLUMNS
                + ''' FROM player_best_games WHERE name = %s
                     ORDER BY sc DESC LIMIT 1''',
                player)))
Esempio n. 9
0
def canonicalize_player_name(c, player):
    row = query_row(c, '''SELECT name FROM players WHERE name = %s''', player)
    if row:
        return row[0]
    return None
Esempio n. 10
0
def find_streak_breaker(c, sid):
    return row_to_xdict(
        query_row(
            c,
            game_select_from('streak_breakers') + " WHERE streak_id = %s",
            sid))
Esempio n. 11
0
def player_last_game(c, player):
    return (row_to_xdict(
        query_row(
            c, 'SELECT ' + scload.LOG_DB_SCOLUMNS +
            ''' FROM player_last_games WHERE name = %s''', player)))
Esempio n. 12
0
def player_best_game(c, player):
    return (row_to_xdict(
        query_row(
            c, 'SELECT ' + scload.LOG_DB_SCOLUMNS +
            ''' FROM player_best_games WHERE name = %s
                     ORDER BY sc DESC LIMIT 1''', player)))
Esempio n. 13
0
def worst_xl_rune_find(c):
    row = query_row(
        c, '''SELECT xl, rune_time FROM low_xl_rune_finds
                        ORDER BY xl DESC, rune_time DESC LIMIT 1''')
    return (row[0], row[1])