Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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])
Ejemplo 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
Ejemplo 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))
Ejemplo 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)))
Ejemplo 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)))
Ejemplo 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
Ejemplo 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))
Ejemplo 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)))
Ejemplo 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)))
Ejemplo 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])