示例#1
0
 def handle_suicide(self, event):
     if not self.round:
         return
     if self.verbose:
         print unicode(event)
     steam_id = event.player.steam_id.id64()
     self.players[steam_id].alive = False
     player = Player.query.filter_by(steam_id=steam_id).first()
     frag = Frag()
     frag.fragger = player.id
     frag.victim = player.id
     frag.weapon = event.weapon
     frag.headshot = False
     frag.tk = True
     self.round_frags.append(frag)
     self._check_1v()
示例#2
0
 def handle_kill(self, event):
     if not self.round:
         return
     if self.verbose:
         print unicode(event)
     steam_id = event.player.steam_id.id64()
     target_id = event.target.steam_id.id64()
     self.players[target_id].alive = False
     fragger = Player.query.filter_by(steam_id=steam_id).first()
     victim = Player.query.filter_by(steam_id=target_id).first()
     frag = Frag()
     frag.fragger = fragger.id
     frag.victim = victim.id
     frag.weapon = event.weapon
     frag.headshot = event.headshot
     if event.player.team == event.target.team:
         frag.tk = True
     self.round_frags.append(frag)
     self._check_1v()