def server_map(event, ip, port, timestamp): curmap = Stats.getServerMap(ip, port) players = Stats.getPlayers(ip, port) for cur in players: players[cur].savePlayer(ip, port, curmap) Stats.setServerMap(ip, port, event.map)
def player_attacked(event,ip,port,timestamp): attacker = Stats.getPlayer(event.attacker_steamid,ip,port) attacker.checkName(event.attacker_name) curWeapon = attacker.getWeapon(event.weapon) curWeapon.damage += event.damage
def player_killed(event,ip,port,timestamp): attacker = Stats.getPlayer(event.attacker_steamid,ip,port) victim = Stats.getPlayer(event.victim_steamid,ip,port) attacker.checkName(event.attacker_name) victim.checkName(event.victim_name) attacker.kills += 1 victim.deaths += 1 curWeapon = attacker.getWeapon(event.weapon) curWeapon.kills += 1 vs = attacker.getVictim(victim.steamid) vs.kills += 1 if event.headshot == 1: curWeapon.headshots += 1 vs.headshots += 1
def player_weaponstats(event,ip,port,timestamp): player = Stats.getPlayer(event.steamid,ip,port) player.checkName(event.name) curWeapon = player.getWeapon(event.weapon) curWeapon.kills += event.kills curWeapon.headshots += event.headshots curWeapon.damage += event.damage curWeapon.tks += event.tks
def player_triggered(event, ip, port, timestamp): player = Stats.getPlayer(event.steamid, ip, port) curevent = player.getEvent(event.event) curevent.trigger_count += 1
def player_joinedteam(event, ip, port, timestamp): player = Stats.getPlayer(event.steamid, ip, port) player.getTeam(event.newteam).join_count += 1
def player_connect(event,ip,port,timestamp): player = Stats.getPlayer(event.steamid,ip,port) player.checkName(event.name) player.ip = event.ip player.lastconnect = time.time()
def player_suicide(event,ip,port,timestamp): player = Stats.getPlayer(event.steamid,ip,port) player.checkName(event.name) player.suicides += 1