pl["leaver_status"] = p["leaver_status"] if pl["leaver_status"] >= 2: abandons += 1 # players = [player, hero, level, k, d, a, lh, dn, xpm, gpm, [items]] new_player = Player(pl["account_id"], pl["assists"], pl["deaths"], pl["denies"], pl["gold"], pl["gold_per_min"], pl["gold_spent"], pl["hero_damage"], pl["hero_healing"], pl["hero_id"], pl["item_0"], pl["item_1"], pl["item_2"], pl["item_3"], pl["item_4"], pl["item_5"], pl["kills"], pl["last_hits"], pl["leaver_status"], pl["level"], pl["player_slot"], pl["tower_damage"], pl["xp_per_min"], pl["win"]) new_player.points = calculateHeroPoints(new_player, duration=match["duration"]) new_match.players.extend([new_player]) new_match.is_significant_p = True valid_modes = [0, 1, 2, 3, 4, 5, 12, 16] # 0 is valid for legacy reasons if new_match.game_mode not in valid_modes: new_match.is_significant_p = False if new_match.human_players < 10: new_match.is_significant_p = False if abandons > 0: new_match.is_significant_p = False
import sys import pdb import os players = session.query(Player).all() #players = session.query(Player).filter(Player.account_id == 32775483).order_by(Player.match_id.desc()).all() for i, p in enumerate(players): if i % (len(players)/20) == 0: print i+1, "/", len(players) if p.match is None: continue p.points = calculateHeroPoints(p) # old code to update win/loss # # 0, 1, 2, 3, 4 are Radiant # # 128, 129, 130, 131, 132 are Dire # if p.player_slot < 128: # Radiant # if p.match.radiant_win == True: # p.win = True # else: # p.win = False # else: # dire # if p.match.radiant_win == False: # p.win = True # else: # p.win = False
abandons += 1 # players = [player, hero, level, k, d, a, lh, dn, xpm, gpm, [items]] new_player = Player(pl["account_id"], pl["assists"], pl["deaths"], pl["denies"], pl["gold"], pl["gold_per_min"], pl["gold_spent"], pl["hero_damage"], pl["hero_healing"], pl["hero_id"], pl["item_0"], pl["item_1"], pl["item_2"], pl["item_3"], pl["item_4"], pl["item_5"], pl["kills"], pl["last_hits"], pl["leaver_status"], pl["level"], pl["player_slot"], pl["tower_damage"], pl["xp_per_min"], pl["win"]) new_player.points = calculateHeroPoints(new_player, duration=match["duration"]) new_match.players.extend([new_player]) new_match.is_significant_p = True valid_modes = [0, 1, 2, 3, 4, 5, 12, 16] # 0 is valid for legacy reasons if new_match.game_mode not in valid_modes: new_match.is_significant_p = False if new_match.human_players < 10: new_match.is_significant_p = False
import sys import pdb import os players = session.query(Player).all() #players = session.query(Player).filter(Player.account_id == 32775483).order_by(Player.match_id.desc()).all() for i, p in enumerate(players): if i % (len(players) / 20) == 0: print i + 1, "/", len(players) if p.match is None: continue p.points = calculateHeroPoints(p) # old code to update win/loss # # 0, 1, 2, 3, 4 are Radiant # # 128, 129, 130, 131, 132 are Dire # if p.player_slot < 128: # Radiant # if p.match.radiant_win == True: # p.win = True # else: # p.win = False # else: # dire # if p.match.radiant_win == False: # p.win = True # else: # p.win = False