public void saveStats(GameState gameState) {
		queryLock.lock();
		try {
			for (Player player: gameState.players) {
				if (player.username.equals("guest")) continue;
				String command = "UPDATE players " +
					"SET total_games = total_games + 1," +
					"num_kills = num_kills + ?," +
					"num_deaths = num_deaths + ?," +
					"num_shots = num_shots + ?," +
					"num_hits = num_hits + ?," +
					"wins = wins + ?, " +
					"brains_destroyed = brains_destroyed + ? " +
					"WHERE name = ?";
				
				PreparedStatement stmt = connection.prepareStatement(command);
				stmt.setInt(1, player.numKills);
				stmt.setInt(2, player.numDeaths);
				stmt.setInt(3, player.numShots);
				stmt.setInt(4, player.numHits);
				int won = (gameState.winningTeam == player.team.num)? 1 : 0;
				stmt.setInt(5, won);
				int destroyedBrain = (player.destroyedBrain)? 1 : 0;
				stmt.setInt(6, destroyedBrain);
				stmt.setString(7, player.username);
				stmt.executeUpdate();				
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		queryLock.unlock();
	}