From c07fff97a8edccf51f8498daecf2a0f988e34fab Mon Sep 17 00:00:00 2001 From: Ignacio Date: Sat, 7 Sep 2024 12:02:09 +0200 Subject: [PATCH 1/4] fix crash when installing parts, when drivers has no stats, no firing staff through contract modal --- back/scripts/car_analysis.py | 7 +++--- back/scripts/transfer_driver.py | 44 +++++++++++++++++++++++++-------- front/js/performance.js | 1 - front/js/transfers.js | 2 +- 4 files changed, 39 insertions(+), 15 deletions(-) diff --git a/back/scripts/car_analysis.py b/back/scripts/car_analysis.py index df6a6c51..0798d5b3 100644 --- a/back/scripts/car_analysis.py +++ b/back/scripts/car_analysis.py @@ -385,7 +385,7 @@ def fit_loadouts_dict(self, loadouts_dict, team_id): design_2 = loadouts_dict[part][1] fitted_design_1 = self.cursor.execute(f"SELECT DesignID, ItemID FROM Parts_CarLoadout WHERE TeamID = {team_id} AND PartType = {part} AND LoadoutID = 1").fetchone() if design_1 is not None: - if fitted_design_1[0] is not None: + if fitted_design_1[0] is not None and fitted_design_1[1] is not None: self.cursor.execute(f"UPDATE Parts_Items SET AssociatedCar = NULL WHERE ItemID = {fitted_design_1[1]}") fitted_design_1 = fitted_design_1[0] @@ -396,10 +396,11 @@ def fit_loadouts_dict(self, loadouts_dict, team_id): else: item_1 = items_1[0][0] self.add_part_to_loadout(design_1, int(part), team_id, 1, item_1) - + print(design_2) if design_2 is not None: fitted_design_2 = self.cursor.execute(f"SELECT DesignID, ItemID FROM Parts_CarLoadout WHERE TeamID = {team_id} AND PartType = {part} AND LoadoutID = 2").fetchone() - if fitted_design_2[0] is not None: + print(fitted_design_2) + if fitted_design_2[0] is not None and fitted_design_2[1] is not None: self.cursor.execute(f"UPDATE Parts_Items SET AssociatedCar = NULL WHERE ItemID = {fitted_design_2[1]}") fitted_design_2 = fitted_design_2[0] if fitted_design_2 != design_2: diff --git a/back/scripts/transfer_driver.py b/back/scripts/transfer_driver.py index 8a03d84b..96a10a1d 100644 --- a/back/scripts/transfer_driver.py +++ b/back/scripts/transfer_driver.py @@ -69,7 +69,7 @@ def hire_driver(self, type, driverID, teamID, position, salary=None, starting_bo day = self.cursor.execute("SELECT Day FROM Player_State").fetchone()[0] year = self.cursor.execute("SELECT CurrentSeason FROM Player_State").fetchone()[0] - + staff_type = self.fetch_type_staff(driverID) isRetired = self.cursor.execute(f"SELECT Retired FROM Staff_GameData WHERE StaffID = {driverID}").fetchone() if isRetired[0] == 1: @@ -78,7 +78,7 @@ def hire_driver(self, type, driverID, teamID, position, salary=None, starting_bo self.cursor.execute(f"INSERT INTO Staff_Contracts VALUES ({driverID}, 0, 1, {day}, 1, {teamID}, {position}, 1, '[OPINION_STRING_NEUTRAL]', {day}, {year_end}, 1, '[OPINION_STRING_NEUTRAL]', {salary}, 1, '[OPINION_STRING_NEUTRAL]', {starting_bonus}, 1, '[OPINION_STRING_NEUTRAL]', {race_bonus}, 1, '[OPINION_STRING_NEUTRAL]', {race_bonus_pos}, 1, '[OPINION_STRING_NEUTRAL]', 0, 1, '[OPINION_STRING_NEUTRAL]')") elif year_iteration == "24": self.cursor.execute(f"INSERT INTO Staff_Contracts VALUES ({driverID}, 0, {teamID}, {position}, {day}, {year_end}, {salary}, {starting_bonus}, {race_bonus}, {race_bonus_pos}, 0.5, 0)") - if int(position) < 3: + if int(position) < 3 and staff_type == 0: self.cursor.execute(f"UPDATE Staff_DriverData SET AssignedCarNumber = {position} WHERE StaffID = {driverID}") is_driving_in_f2_f3 = self.cursor.execute(f"SELECT TeamID FROM Staff_Contracts WHERE StaffID = {driverID} AND ContractType = 0 AND (TeamID > 10 AND TeamID < 32)").fetchone() if is_driving_in_f2_f3 is not None: @@ -89,8 +89,8 @@ def hire_driver(self, type, driverID, teamID, position, salary=None, starting_bo position_in_standings = self.cursor.execute(f"SELECT MAX(Position) FROM Races_DriverStandings WHERE SeasonID = {year} AND RaceFormula = 1").fetchone() points_driver_in_standings = self.cursor.execute(f"SELECT Points FROM Races_DriverStandings WHERE DriverID = {driverID} AND SeasonID = {year} AND RaceFormula = 1").fetchone() - type = self.fetch_type_staff(driverID) - if int(type) == 0: + + if int(staff_type) == 0: if points_driver_in_standings is None: points_driver_in_standings = (0,) self.cursor.execute(f"INSERT INTO Races_DriverStandings VALUES ({year}, {driverID}, {points_driver_in_standings[0]}, {position_in_standings[0] + 1}, 0, 0, 1)") @@ -115,6 +115,7 @@ def hire_driver(self, type, driverID, teamID, position, salary=None, starting_bo self.rearrange_driver_engineer_pairings(teamID) + self.fix_driver_standings() self.conn.commit() self.conn.close() @@ -159,6 +160,7 @@ def get_params_auto_contract(self, driverID, teamID, position, year_iteration=" driver_birth_date = self.cursor.execute(f"SELECT DOB_ISO FROM Staff_BasicData WHERE StaffID = {driverID}").fetchone() + print(driver_birth_date) yob = driver_birth_date[0].split("-")[0] if(year[0] - int(yob) > 34 and type == "driver"): year_end = str(random.randint(1, 2) + year[0]) @@ -230,9 +232,11 @@ def swap_drivers(self, driver_1_id, driver_2_id): team_1_id = self.cursor.execute(f"SELECT TeamID FROM Staff_Contracts WHERE StaffID = {driver_1_id}").fetchone() team_2_id = self.cursor.execute(f"SELECT TeamID FROM Staff_Contracts WHERE StaffID = {driver_2_id}").fetchone() year = self.cursor.execute("SELECT CurrentSeason FROM Player_State").fetchone() + type_1 = self.fetch_type_staff(driver_1_id) + type_2 = self.fetch_type_staff(driver_2_id) + is_staff = type_1 == 1 or type_2 == 1 - if(position_1[0] < 3 and position_2[0] < 3): - #no reserve drivers + if(position_1[0] < 3 and position_2[0] < 3) and not is_staff: self.cursor.execute(f"UPDATE Staff_Contracts SET TeamID = {team_2_id[0]}, PosInTeam = {position_2[0]} WHERE ContractType = 0 AND StaffID = {driver_1_id}") self.cursor.execute(f"UPDATE Staff_Contracts SET TeamID = {team_1_id[0]}, PosInTeam = {position_1[0]} WHERE ContractType = 0 AND StaffID = {driver_2_id}") self.cursor.execute(f"UPDATE Staff_DriverData SET AssignedCarNumber = {position_2[0]} WHERE StaffID = {driver_1_id}") @@ -241,8 +245,7 @@ def swap_drivers(self, driver_1_id, driver_2_id): self.rearrange_driver_engineer_pairings(team_1_id[0]) self.rearrange_driver_engineer_pairings(team_2_id[0]) - elif position_1[0] >= 3 and position_2[0] >= 3: - # both reserves + elif (position_1[0] >= 3 and position_2[0] >= 3) or is_staff: self.cursor.execute(f"UPDATE Staff_Contracts SET TeamID = {team_2_id[0]} WHERE ContractType = 0 AND StaffID = {driver_1_id}") self.cursor.execute(f"UPDATE Staff_Contracts SET TeamID = {team_1_id[0]} WHERE ContractType = 0 AND StaffID = {driver_2_id}") @@ -253,6 +256,7 @@ def swap_drivers(self, driver_1_id, driver_2_id): self.cursor.execute(f"DELETE FROM Staff_Contracts WHERE StaffID = {driver_1_id} AND ContractType = 0 AND TeamID = {is_driving_in_f2[0]}") type = self.fetch_type_staff(driver_1_id) + print(f"TYPE: {type}") if int(type) == 0: was_in_f2 = self.cursor.execute(f"SELECT Points FROM Races_DriverStandings WHERE DriverID = {driver_1_id} AND SeasonID = {year[0]} AND RaceFormula = 2").fetchone() was_in_f3 = self.cursor.execute(f"SELECT Points FROM Races_DriverStandings WHERE DriverID = {driver_1_id} AND SeasonID = {year[0]} AND RaceFormula = 3").fetchone() @@ -288,6 +292,7 @@ def swap_drivers(self, driver_1_id, driver_2_id): type = self.fetch_type_staff(driver_1_id) + print(f"TYPE: {type}") if int(type) == 0: was_in_f2 = self.cursor.execute(f"SELECT Points FROM Races_DriverStandings WHERE DriverID = {driver_2_id} AND SeasonID = {year[0]} AND RaceFormula = 2").fetchone() was_in_f3 = self.cursor.execute(f"SELECT Points FROM Races_DriverStandings WHERE DriverID = {driver_2_id} AND SeasonID = {year[0]} AND RaceFormula = 3").fetchone() @@ -315,6 +320,8 @@ def swap_drivers(self, driver_1_id, driver_2_id): self.rearrange_driver_engineer_pairings(team_1_id[0]) self.rearrange_driver_engineer_pairings(team_2_id[0]) + self.fix_driver_standings() + self.conn.commit() self.conn.close() @@ -370,6 +377,7 @@ def unretire(self, driverID): def get_tier(self, driverID): driver_stats = self.cursor.execute(f"SELECT Val FROM Staff_PerformanceStats WHERE StaffID = {driverID}").fetchall() + print(driver_stats) type = "driver" if len(driver_stats) == 9: cornering = float(driver_stats[0][0]) @@ -382,12 +390,14 @@ def get_tier(self, driverID): reactions = float(driver_stats[7][0]) accuracy = float(driver_stats[8][0]) rating = (cornering + braking*0.75 + reactions*0.5 +control*0.75 + smoothness*0.5 + accuracy*0.75 + adaptability*0.25 + overtaking*0.25+ defence*0.25)/5 - else: + elif len(driver_stats) > 0: type = "staff" rating = 0 for i in range(len(driver_stats)): rating += float(driver_stats[i][0]) rating = rating/len(driver_stats) + else: + rating = 0 if(rating >= 89): tier = 1 elif(rating >= 85): tier = 2 @@ -415,4 +425,18 @@ def get_driver_id(self, name): # print(name, driver_id) - return driver_id \ No newline at end of file + return driver_id + + + def fix_driver_standings(self): + year = self.cursor.execute("SELECT CurrentSeason FROM Player_State").fetchone() + drivers_in_standings = self.cursor.execute(f"SELECT DriverID FROM Races_DriverStandings WHERE SeasonID = {year[0]} AND RaceFormula = 1").fetchall() + print(drivers_in_standings) + for driver in drivers_in_standings: + driver_id = driver[0] + is_driver = self.cursor.execute(f"SELECT StaffType FROM Staff_GameData WHERE StaffID = {driver_id}").fetchone() + print(driver_id, is_driver) + if is_driver[0] != 0: + self.cursor.execute(f"DELETE FROM Races_DriverStandings WHERE DriverID = {driver_id} AND SeasonID = {year[0]} AND RaceFormula = 1") + + diff --git a/front/js/performance.js b/front/js/performance.js index cc4168e0..804d3380 100644 --- a/front/js/performance.js +++ b/front/js/performance.js @@ -158,7 +158,6 @@ function order_by(criterion) { let bar = car.querySelector(".performance-bar-progress"); bar.style.width = bar.dataset[criterion] + "%"; let number = car.querySelector(".performance-number") - console.log(car.querySelector(".car-missing-parts")) let value = car.querySelector(".car-missing-parts .value") value.innerText = parseFloat(bar.dataset[criterion]).toFixed(2) + " %"; number.innerText = index + 1 diff --git a/front/js/transfers.js b/front/js/transfers.js index fe6908d6..ca92545f 100644 --- a/front/js/transfers.js +++ b/front/js/transfers.js @@ -831,7 +831,7 @@ function manageDrivers(...divs) { */ document.getElementById("confirmButton").addEventListener('click', function () { if (modalType === "hire") { - if (((f2_teams.includes(originalTeamId) | f3_teams.includes(originalTeamId)) && !destinationParent.classList.contains("affiliates-space") ) | originalParent.className === "driver-space" | originalParent.classList.contains("affiliates-space")) { + if (((f2_teams.includes(originalTeamId) | f3_teams.includes(originalTeamId)) && !destinationParent.classList.contains("affiliates-space") ) | originalParent.className === "driver-space" | originalParent.classList.contains("affiliates-space") | originalParent.className === "staff-space") { signDriver("fireandhire") } signDriver("regular") From 4b282048cfbf6449a6ccd50a3112b8ead213eb9b Mon Sep 17 00:00:00 2001 From: Ignacio Date: Sat, 7 Sep 2024 13:05:01 +0200 Subject: [PATCH 2/4] fix not numbersa vailabel --- back/scripts/car_analysis.py | 3 --- back/scripts/transfer_driver.py | 20 ++++++++++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/back/scripts/car_analysis.py b/back/scripts/car_analysis.py index 0798d5b3..bb681e80 100644 --- a/back/scripts/car_analysis.py +++ b/back/scripts/car_analysis.py @@ -379,7 +379,6 @@ def update_items_for_design_dict(self, design_dict, team_id): self.conn.commit() def fit_loadouts_dict(self, loadouts_dict, team_id): - print(loadouts_dict) for part in loadouts_dict: design_1 = loadouts_dict[part][0] design_2 = loadouts_dict[part][1] @@ -396,10 +395,8 @@ def fit_loadouts_dict(self, loadouts_dict, team_id): else: item_1 = items_1[0][0] self.add_part_to_loadout(design_1, int(part), team_id, 1, item_1) - print(design_2) if design_2 is not None: fitted_design_2 = self.cursor.execute(f"SELECT DesignID, ItemID FROM Parts_CarLoadout WHERE TeamID = {team_id} AND PartType = {part} AND LoadoutID = 2").fetchone() - print(fitted_design_2) if fitted_design_2[0] is not None and fitted_design_2[1] is not None: self.cursor.execute(f"UPDATE Parts_Items SET AssociatedCar = NULL WHERE ItemID = {fitted_design_2[1]}") fitted_design_2 = fitted_design_2[0] diff --git a/back/scripts/transfer_driver.py b/back/scripts/transfer_driver.py index 96a10a1d..57f487a5 100644 --- a/back/scripts/transfer_driver.py +++ b/back/scripts/transfer_driver.py @@ -108,7 +108,9 @@ def hire_driver(self, type, driverID, teamID, position, salary=None, starting_bo #gives new numbers to newcommers in f1 driver_has_number = self.cursor.execute(f"SELECT Number FROM Staff_DriverNumbers WHERE CurrentHolder = {driverID}").fetchone() if driver_has_number is None: + self.free_numbers_not_f1() free_numbers = self.cursor.execute("SELECT Number FROM Staff_DriverNumbers WHERE CurrentHolder IS NULL AND Number != 0").fetchall() + print(free_numbers) rand_index = random.randrange(len(free_numbers)) new_num = free_numbers[rand_index] self.cursor.execute(f"UPDATE Staff_DriverNumbers SET CurrentHolder = {driverID} WHERE Number = {new_num[0]}") @@ -120,6 +122,18 @@ def hire_driver(self, type, driverID, teamID, position, salary=None, starting_bo self.conn.commit() self.conn.close() + def free_numbers_not_f1(self): + numbers = self.cursor.execute("SELECT CurrentHolder, Number FROM Staff_DriverNumbers WHERE Number != 0 AND CurrentHolder IS NOT NULL").fetchall() + for driver, number in numbers: + print(driver, number) + team_id = self.cursor.execute(f"SELECT MIN(TeamID) FROM Staff_Contracts WHERE StaffID = {driver} AND ContractType = 0").fetchone() + if team_id[0] is not None: + if team_id[0] > 10 and team_id[0] < 32: + self.cursor.execute(f"UPDATE Staff_DriverNumbers SET CurrentHolder = NULL WHERE Number = {number}") + + self.conn.commit() + + def fetch_type_staff(self, driverID): type = self.cursor.execute(f"SELECT StaffType FROM Staff_GameData WHERE StaffID = {driverID}").fetchone() return type[0] @@ -160,7 +174,6 @@ def get_params_auto_contract(self, driverID, teamID, position, year_iteration=" driver_birth_date = self.cursor.execute(f"SELECT DOB_ISO FROM Staff_BasicData WHERE StaffID = {driverID}").fetchone() - print(driver_birth_date) yob = driver_birth_date[0].split("-")[0] if(year[0] - int(yob) > 34 and type == "driver"): year_end = str(random.randint(1, 2) + year[0]) @@ -256,7 +269,6 @@ def swap_drivers(self, driver_1_id, driver_2_id): self.cursor.execute(f"DELETE FROM Staff_Contracts WHERE StaffID = {driver_1_id} AND ContractType = 0 AND TeamID = {is_driving_in_f2[0]}") type = self.fetch_type_staff(driver_1_id) - print(f"TYPE: {type}") if int(type) == 0: was_in_f2 = self.cursor.execute(f"SELECT Points FROM Races_DriverStandings WHERE DriverID = {driver_1_id} AND SeasonID = {year[0]} AND RaceFormula = 2").fetchone() was_in_f3 = self.cursor.execute(f"SELECT Points FROM Races_DriverStandings WHERE DriverID = {driver_1_id} AND SeasonID = {year[0]} AND RaceFormula = 3").fetchone() @@ -292,7 +304,6 @@ def swap_drivers(self, driver_1_id, driver_2_id): type = self.fetch_type_staff(driver_1_id) - print(f"TYPE: {type}") if int(type) == 0: was_in_f2 = self.cursor.execute(f"SELECT Points FROM Races_DriverStandings WHERE DriverID = {driver_2_id} AND SeasonID = {year[0]} AND RaceFormula = 2").fetchone() was_in_f3 = self.cursor.execute(f"SELECT Points FROM Races_DriverStandings WHERE DriverID = {driver_2_id} AND SeasonID = {year[0]} AND RaceFormula = 3").fetchone() @@ -377,7 +388,6 @@ def unretire(self, driverID): def get_tier(self, driverID): driver_stats = self.cursor.execute(f"SELECT Val FROM Staff_PerformanceStats WHERE StaffID = {driverID}").fetchall() - print(driver_stats) type = "driver" if len(driver_stats) == 9: cornering = float(driver_stats[0][0]) @@ -431,11 +441,9 @@ def get_driver_id(self, name): def fix_driver_standings(self): year = self.cursor.execute("SELECT CurrentSeason FROM Player_State").fetchone() drivers_in_standings = self.cursor.execute(f"SELECT DriverID FROM Races_DriverStandings WHERE SeasonID = {year[0]} AND RaceFormula = 1").fetchall() - print(drivers_in_standings) for driver in drivers_in_standings: driver_id = driver[0] is_driver = self.cursor.execute(f"SELECT StaffType FROM Staff_GameData WHERE StaffID = {driver_id}").fetchone() - print(driver_id, is_driver) if is_driver[0] != 0: self.cursor.execute(f"DELETE FROM Races_DriverStandings WHERE DriverID = {driver_id} AND SeasonID = {year[0]} AND RaceFormula = 1") From 04e9c6e953516dec096ca8a11e5c549b9d393641 Mon Sep 17 00:00:00 2001 From: Ignacio Date: Sat, 7 Sep 2024 14:50:36 +0200 Subject: [PATCH 3/4] fix enumbers --- back/scripts/transfer_driver.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/back/scripts/transfer_driver.py b/back/scripts/transfer_driver.py index 57f487a5..5dfc9b6a 100644 --- a/back/scripts/transfer_driver.py +++ b/back/scripts/transfer_driver.py @@ -110,7 +110,6 @@ def hire_driver(self, type, driverID, teamID, position, salary=None, starting_bo if driver_has_number is None: self.free_numbers_not_f1() free_numbers = self.cursor.execute("SELECT Number FROM Staff_DriverNumbers WHERE CurrentHolder IS NULL AND Number != 0").fetchall() - print(free_numbers) rand_index = random.randrange(len(free_numbers)) new_num = free_numbers[rand_index] self.cursor.execute(f"UPDATE Staff_DriverNumbers SET CurrentHolder = {driverID} WHERE Number = {new_num[0]}") @@ -125,7 +124,6 @@ def hire_driver(self, type, driverID, teamID, position, salary=None, starting_bo def free_numbers_not_f1(self): numbers = self.cursor.execute("SELECT CurrentHolder, Number FROM Staff_DriverNumbers WHERE Number != 0 AND CurrentHolder IS NOT NULL").fetchall() for driver, number in numbers: - print(driver, number) team_id = self.cursor.execute(f"SELECT MIN(TeamID) FROM Staff_Contracts WHERE StaffID = {driver} AND ContractType = 0").fetchone() if team_id[0] is not None: if team_id[0] > 10 and team_id[0] < 32: From d5fa9a6bc1395c2c7e58f990501a84ed3bdc59ee Mon Sep 17 00:00:00 2001 From: Ignacio Date: Sat, 7 Sep 2024 14:52:17 +0200 Subject: [PATCH 4/4] prints and version --- back/commands/commandFactory.py | 1 - back/commands/partRequest.py | 1 - back/scripts/transfer_driver.py | 7 ------- launcher/version.conf | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 4 insertions(+), 13 deletions(-) diff --git a/back/commands/commandFactory.py b/back/commands/commandFactory.py index 8512d52d..761d50b6 100644 --- a/back/commands/commandFactory.py +++ b/back/commands/commandFactory.py @@ -43,7 +43,6 @@ def __init__(self): def create_command(self, message, client): command_type = message["command"] - # print(message) #for debugging if command_type in self.command_dict: return self.command_dict[command_type](message, client) else: diff --git a/back/commands/partRequest.py b/back/commands/partRequest.py index 029b6fbe..cd1cb4d8 100644 --- a/back/commands/partRequest.py +++ b/back/commands/partRequest.py @@ -8,7 +8,6 @@ def __init__(self, message, client): super().__init__(message, client) async def execute(self): - print(self.message) car_analysis = CarAnalysisUtils(self.client) part_values = ["Part values fetched", car_analysis.get_unitvalue_from_one_part(self.message['designID'])] data_json_part_values = json.dumps(part_values) diff --git a/back/scripts/transfer_driver.py b/back/scripts/transfer_driver.py index 5dfc9b6a..179f5f87 100644 --- a/back/scripts/transfer_driver.py +++ b/back/scripts/transfer_driver.py @@ -99,10 +99,8 @@ def hire_driver(self, type, driverID, teamID, position, salary=None, starting_bo was_in_f3 = self.cursor.execute(f"SELECT Points FROM Races_DriverStandings WHERE DriverID = {driverID} AND SeasonID = {year} AND RaceFormula = 3").fetchone() if was_in_f2 is not None: - # print("was in f2") self.cursor.execute(f"DELETE FROM Races_DriverStandings WHERE DriverID = {driverID} AND SeasonID = {year} AND RaceFormula = 2") if was_in_f3 is not None: - # print("was in f3") self.cursor.execute(f"DELETE FROM Races_DriverStandings WHERE DriverID = {driverID} AND SeasonID = {year} AND RaceFormula = 3") #gives new numbers to newcommers in f1 @@ -272,10 +270,8 @@ def swap_drivers(self, driver_1_id, driver_2_id): was_in_f3 = self.cursor.execute(f"SELECT Points FROM Races_DriverStandings WHERE DriverID = {driver_1_id} AND SeasonID = {year[0]} AND RaceFormula = 3").fetchone() if was_in_f2 is not None: - # print("was in f2") self.cursor.execute(f"DELETE FROM Races_DriverStandings WHERE DriverID = {driver_1_id} AND SeasonID = {year[0]} AND RaceFormula = 2") if was_in_f3 is not None: - # print("was in f3") self.cursor.execute(f"DELETE FROM Races_DriverStandings WHERE DriverID = {driver_1_id} AND SeasonID = {year[0]} AND RaceFormula = 3") position_1in_standings = self.cursor.execute(f"SELECT MAX(Position) FROM Races_DriverStandings WHERE RaceFormula = 1 AND SeasonID = {year[0]}").fetchone() @@ -307,10 +303,8 @@ def swap_drivers(self, driver_1_id, driver_2_id): was_in_f3 = self.cursor.execute(f"SELECT Points FROM Races_DriverStandings WHERE DriverID = {driver_2_id} AND SeasonID = {year[0]} AND RaceFormula = 3").fetchone() if was_in_f2 is not None: - # print("was in f2") self.cursor.execute(f"DELETE FROM Races_DriverStandings WHERE DriverID = {driver_2_id} AND SeasonID = {year[0]} AND RaceFormula = 2") if was_in_f3 is not None: - # print("was in f3") self.cursor.execute(f"DELETE FROM Races_DriverStandings WHERE DriverID = {driver_2_id} AND SeasonID = {year[0]} AND RaceFormula = 3") #checks if the driver was in the standings and if it wasn't it updates the standings @@ -431,7 +425,6 @@ def get_driver_id(self, name): else: driver_id = self.cursor.execute(f"SELECT StaffID FROM Staff_BasicData WHERE LastName = '[StaffName_Surname_{driver}]'").fetchone() - # print(name, driver_id) return driver_id diff --git a/launcher/version.conf b/launcher/version.conf index 58594069..530cdd91 100644 --- a/launcher/version.conf +++ b/launcher/version.conf @@ -1 +1 @@ -2.2.3 +2.2.4 diff --git a/package-lock.json b/package-lock.json index 2b8fe80d..582f8264 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "Database Editor F1 Manager", - "version": "2.2.3", + "version": "2.2.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "Database Editor F1 Manager", - "version": "2.2.3", + "version": "2.2.4", "license": "LGPL-3.0-or-later", "dependencies": { "bootstrap": "^5.3.2", diff --git a/package.json b/package.json index 9906b9b1..2d11e498 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Database Editor F1 Manager", - "version": "2.2.3", + "version": "2.2.4", "description": "A tool that will let you edit your save file from F1 Manager games", "main": "main.js", "scripts": {