From 485b48a7eef97f927c193ddad0ef38c605cbe1b2 Mon Sep 17 00:00:00 2001 From: Callum Jones Date: Fri, 2 Oct 2020 14:41:31 +0100 Subject: [PATCH 01/25] look for connecting drivers in the connected drivers table to avoid losing laps --- CHANGELOG.md | 9 +++++++++ race_control.go | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1c04588d..46fdc155b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +v1.7.9 +------ + +Fixed: + +* Fixes an issue where Live Timings lap counts could reset if a driver does not cleanly disconnect from the Assetto Corsa Server. + +--- + v1.7.8 ------ diff --git a/race_control.go b/race_control.go index 2acb078d5..158842414 100644 --- a/race_control.go +++ b/race_control.go @@ -624,8 +624,13 @@ func (rc *RaceControl) OnClientConnect(client udp.SessionCarInfo) error { logrus.Debugf("Driver %s (%s) reconnected in %s (car id: %d)", driver.CarInfo.DriverName, driver.CarInfo.DriverGUID, driver.CarInfo.CarModel, client.CarID) rc.DisconnectedDrivers.Del(client.DriverGUID) } else { - driver = NewRaceControlDriver(client) - logrus.Debugf("Driver %s (%s) connected in %s (car id: %d)", driver.CarInfo.DriverName, driver.CarInfo.DriverGUID, driver.CarInfo.CarModel, client.CarID) + if connectedDriver, ok := rc.ConnectedDrivers.Get(client.DriverGUID); ok { + driver = connectedDriver + logrus.Debugf("Driver %s (%s) reconnected (but was already connected...) in %s (car id: %d)", driver.CarInfo.DriverName, driver.CarInfo.DriverGUID, driver.CarInfo.CarModel, client.CarID) + } else { + driver = NewRaceControlDriver(client) + logrus.Debugf("Driver %s (%s) connected in %s (car id: %d)", driver.CarInfo.DriverName, driver.CarInfo.DriverGUID, driver.CarInfo.CarModel, client.CarID) + } } driver.mutex.Lock() From 41acb1d5985f2487dcf30cf61aaad8aea440e710 Mon Sep 17 00:00:00 2001 From: Callum Jones Date: Mon, 19 Oct 2020 11:20:03 +0100 Subject: [PATCH 02/25] correct variable names of real penalty jump start options so that they work correctly (fixes #1021) --- CHANGELOG.md | 1 + plugin_realpenalty_config.go | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46fdc155b..f87256ae4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ v1.7.9 Fixed: * Fixes an issue where Live Timings lap counts could reset if a driver does not cleanly disconnect from the Assetto Corsa Server. +* Fixes an issue where Real Penalty config values for Jump Start would not be assigned correctly. --- diff --git a/plugin_realpenalty_config.go b/plugin_realpenalty_config.go index 2f739c004..e44767a7a 100644 --- a/plugin_realpenalty_config.go +++ b/plugin_realpenalty_config.go @@ -345,11 +345,11 @@ type RealPenaltySettingsJumpStart struct { PenaltyType0 string `ini:"PENALTY_TYPE_0" help:"Penalty type for jump start. Don't set seconds penalty! dt = drive through, sgn = stop and go n seconds, dsq = disqualification --> kick"` SpeedLimitPenalty0 int `ini:"SPEED_LIMIT_PENALTY_0" help:""` - PenaltyType1 string `ini:"PENALTY_TYPE_0" help:""` - SpeedLimitPenalty1 int `ini:"SPEED_LIMIT_PENALTY_0" help:"Penalty type for jump start. Don't set seconds penalty! dt = drive through, sgn = stop and go n seconds, dsq = disqualification --> kick"` + PenaltyType1 string `ini:"PENALTY_TYPE_1" help:""` + SpeedLimitPenalty1 int `ini:"SPEED_LIMIT_PENALTY_1" help:"Penalty type for jump start. Don't set seconds penalty! dt = drive through, sgn = stop and go n seconds, dsq = disqualification --> kick"` - PenaltyType2 string `ini:"PENALTY_TYPE_0" help:""` - SpeedLimitPenalty2 int `ini:"SPEED_LIMIT_PENALTY_0" help:"Penalty type for jump start. Don't set seconds penalty! dt = drive through, sgn = stop and go n seconds, dsq = disqualification --> kick"` + PenaltyType2 string `ini:"PENALTY_TYPE_2" help:""` + SpeedLimitPenalty2 int `ini:"SPEED_LIMIT_PENALTY_2" help:"Penalty type for jump start. Don't set seconds penalty! dt = drive through, sgn = stop and go n seconds, dsq = disqualification --> kick"` } type RealPenaltySettingsDRS struct { From dcd8956396f384d082edebb22dbfeb4c33dfce55 Mon Sep 17 00:00:00 2001 From: Callum Jones Date: Tue, 27 Oct 2020 14:54:40 +0000 Subject: [PATCH 03/25] only filter the spectator car from points calculations if the spectator car toggle is enabled --- CHANGELOG.md | 1 + championships.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f87256ae4..70e32e517 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Fixed: * Fixes an issue where Live Timings lap counts could reset if a driver does not cleanly disconnect from the Assetto Corsa Server. * Fixes an issue where Real Penalty config values for Jump Start would not be assigned correctly. +* The Spectator Car will only be filtered out from Championship Points calculations if Spectator Car is enabled in the Championship settings. --- diff --git a/championships.go b/championships.go index 39f8be04e..fb4b10e79 100644 --- a/championships.go +++ b/championships.go @@ -1043,7 +1043,7 @@ func (c *Championship) AttachClassIDToResults(results *SessionResults) { func (c *ChampionshipClass) ResultsForClass(results []*SessionResult, championship *Championship) (filtered []*SessionResult) { for _, result := range results { - if c.DriverInClass(result) && result.TotalTime > 0 && result.DriverGUID != championship.SpectatorCar.GUID { + if c.DriverInClass(result) && result.TotalTime > 0 && (!championship.SpectatorCarEnabled || result.DriverGUID != championship.SpectatorCar.GUID) { filtered = append(filtered, result) } } From 3abfaa9f5ba560f2aa62921dcdd48bb8da4885cd Mon Sep 17 00:00:00 2001 From: Callum Jones Date: Wed, 28 Oct 2020 16:52:25 +0000 Subject: [PATCH 04/25] fixes an issue where cars could be duplicated in a race setup --- CHANGELOG.md | 1 + .../typescript/src/CarSearch.ts | 6 +- migrations.go | 89 +++++++++++++++++++ 3 files changed, 95 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70e32e517..bc02f69d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Fixed: * Fixes an issue where Live Timings lap counts could reset if a driver does not cleanly disconnect from the Assetto Corsa Server. * Fixes an issue where Real Penalty config values for Jump Start would not be assigned correctly. * The Spectator Car will only be filtered out from Championship Points calculations if Spectator Car is enabled in the Championship settings. +* Fixes an issue where cars could be duplicated in race setups --- diff --git a/cmd/server-manager/typescript/src/CarSearch.ts b/cmd/server-manager/typescript/src/CarSearch.ts index 44dfc0528..72c95f244 100644 --- a/cmd/server-manager/typescript/src/CarSearch.ts +++ b/cmd/server-manager/typescript/src/CarSearch.ts @@ -51,10 +51,14 @@ export class CarSearch { } for (const car of data) { + if ($carsSelect.find("option[value='" + car.CarID + "']").length) { + continue; + } + $carsSelect.append('