Guest User

Untitled

a guest
Jun 24th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. def add_results(self, rteams_r, players_r):
  2. scoring = Scoring()
  3. scoring.calculate(rteams_r, players_r)
  4.  
  5. # add the kills/deaths to the players
  6. for player_id in scoring.player_kd.keys():
  7. self.sql.query("UPDATE players SET kills=?, deaths=? WHERE uniqueid=?", (scoring.player_kd[player_id][0], scoring.player_kd[player_yd][1], player_id))
  8. self.sql.commit()
  9.  
  10. # add the scores to their teams
  11. for player_id in scoring.player_updates.keys(): # loop through each player
  12. self.sql.query("SELECT teamid FROM tpmap WHERE playerid=?", (player_id))
  13. for team_id in self.sql.cursor: # loop through each player, adjust score
  14. self.sql.query("UPDATE teams SET score=score+? WHERE uniqueid=?", (scoring.player_updates[player_id], team_id)
  15. self.sql.commit()
Add Comment
Please, Sign In to add comment