-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
makes majority of the entrylist fields optional (#278)
* makes majority of the entrylist fields optional valid entrylist entries can be quite small, e.g. ``` { "drivers": [ { "playerID": "...." } ], "isServerAdmin": 1 } ``` the above valid entrylist entry is from a simgrid entrylist where all admins are added to the entrylist even though they've not signed up for the race. currently if these entrylists were imported as-is either via the GUI or API the result would end up as: ``` { "drivers": [ { "firstName": "", "lastName": "", "shortName": "", "driverCategory": 0, "playerID": "...", "nationality": 0 } ], "raceNumber": 0, "forcedCarModel": 0, "overrideDriverInfo": 0, "isServerAdmin": 1, "customCar": "", "overrideCarModelForCustomCar": 0, "ballastKg": 0, "restrictor": 0, "defaultGridPosition": 0 } ``` The main obvious problem here is '0' for the ForcedCarModel is a porsche car, whilst in reality the entrylist from simgrid isn't forcing a car model, similar issues exist for some of the other settings which are not defaulting to `-1` and instead defaulting to `0`. The ideal scenario is for the entrylist to be exactly the same once imported via accweb, however due to the checkboxes this is not really possible (checkboxes are either unchecked or checked via the GUI). You could import via the API and get: ``` { "drivers": [ { "playerID": "...." } ], "isServerAdmin": 1 } ``` However if you import via the GUI you will get: ``` { "drivers": [ { "playerID": "..." } ], "overrideDriverInfo": 0, "isServerAdmin": 1, "overrideCarModelForCustomCar": 0 } ``` To be consistent I've instead opted to not set `omitempty` on `OverrideDriverInfo` and `OverrideCarModelForCustomCar` which will keep the API and GUI consistent with each other to make future debugging/understanding easier. I don't foresee any issues with importing a simgrid entrylist and having `overrideDriverInfo` and `overrideCarModelForCustomCar` added by accweb unless ACC defaults in the future changes (very unlikely). * save config json without empty fields --------- Co-authored-by: Pedro Faria <[email protected]>
- Loading branch information
1 parent
40ca7d2
commit 014eb8e
Showing
7 changed files
with
123 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,91 @@ | ||
const nationalities = { | ||
"0": {id: 0, country: "Other"}, | ||
"49": {id: 49, country: "Andorra"}, | ||
"14": {id: 14, country: "Argentina"}, | ||
"28": {id: 28, country: "Armenia"}, | ||
"41": {id: 41, country: "Australia"}, | ||
"9": {id: 9, country: "Austria"}, | ||
"50": {id: 50, country: "Azerbaijan"}, | ||
"79": {id: 79, country: "Bahrain"}, | ||
"7": {id: 7, country: "Belgium"}, | ||
"17": {id: 17, country: "Brazil"}, | ||
"51": {id: 51, country: "Bulgaria"}, | ||
"34": {id: 34, country: "Canada"}, | ||
"82": {id: 82, country: "Chile"}, | ||
"35": {id: 35, country: "China"}, | ||
"81": {id: 81, country: "Chinese Taipei"}, | ||
"47": {id: 47, country: "Colombia"}, | ||
"33": {id: 33, country: "Croatia"}, | ||
"52": {id: 52, country: "Cuba"}, | ||
"53": {id: 53, country: "Czech Republic"}, | ||
"32": {id: 32, country: "Denmark"}, | ||
"86": {id: 86, country: "England"}, | ||
"54": {id: 54, country: "Estonia"}, | ||
"31": {id: 31, country: "Finland"}, | ||
"3": {id: 3, country: "France"}, | ||
"55": {id: 55, country: "Georgia"}, | ||
"2": {id: 2, country: "Germany"}, | ||
"5": {id: 5, country: "Great Britain"}, | ||
"22": {id: 22, country: "Greece"}, | ||
"46": {id: 46, country: "Hong Kong"}, | ||
"6": {id: 6, country: "Hungary"}, | ||
"56": {id: 56, country: "India"}, | ||
"38": {id: 38, country: "Indonesia"}, | ||
"78": {id: 78, country: "Iran"}, | ||
"16": {id: 16, country: "Ireland"}, | ||
"57": {id: 57, country: "Israel"}, | ||
"1": {id: 1, country: "Italy"}, | ||
"58": {id: 58, country: "Jamaica"}, | ||
"48": {id: 48, country: "Japan"}, | ||
"45": {id: 45, country: "Kuwait"}, | ||
"59": {id: 59, country: "Latvia"}, | ||
"27": {id: 27, country: "Lebanon"}, | ||
"60": {id: 60, country: "Lithuania"}, | ||
"44": {id: 44, country: "Luxembourg"}, | ||
"61": {id: 61, country: "Macao"}, | ||
"84": {id: 84, country: "Madagascar"}, | ||
"62": {id: 62, country: "Malaysia"}, | ||
"85": {id: 85, country: "Malta"}, | ||
"29": {id: 29, country: "Mexico"}, | ||
"15": {id: 15, country: "Monaco"}, | ||
"88": {id: 88, country: "Morocco"}, | ||
"63": {id: 63, country: "Nepal"}, | ||
"12": {id: 12, country: "Netherlands"}, | ||
"64": {id: 64, country: "New Caledonia"}, | ||
"40": {id: 40, country: "New Zealand"}, | ||
"65": {id: 65, country: "Nigeria"}, | ||
"66": {id: 66, country: "Northern Ireland"}, | ||
"24": {id: 24, country: "Norway"}, | ||
"21": {id: 21, country: "Oman"}, | ||
"67": {id: 67, country: "Papua New Guinea"}, | ||
"68": {id: 68, country: "Philippines"}, | ||
"13": {id: 13, country: "Poland"}, | ||
"36": {id: 36, country: "Portugal"}, | ||
"19": {id: 19, country: "Puerto Rico"}, | ||
"69": {id: 69, country: "Qatar"}, | ||
"70": {id: 70, country: "Romania"}, | ||
"10": {id: 10, country: "Russia"}, | ||
"42": {id: 42, country: "San Marino"}, | ||
"23": {id: 23, country: "Saudi Arabia"}, | ||
"71": {id: 71, country: "Scotland"}, | ||
"72": {id: 72, country: "Serbia"}, | ||
"37": {id: 37, country: "Singapore"}, | ||
"20": {id: 20, country: "Slovakia"}, | ||
"73": {id: 73, country: "Slovenia"}, | ||
"18": {id: 18, country: "South Africa"}, | ||
"26": {id: 26, country: "South Korea"}, | ||
"4": {id: 4, country: "Spain"}, | ||
"30": {id: 30, country: "Sweden"}, | ||
"8": {id: 8, country: "Switzerland"}, | ||
"74": {id: 74, country: "Taiwan"}, | ||
"11": {id: 11, country: "Thailand"}, | ||
"25": {id: 25, country: "Turkey"}, | ||
"75": {id: 75, country: "Ukraine"}, | ||
"43": {id: 43, country: "United Arab Emirates"}, | ||
"83": {id: 83, country: "Uruguay"}, | ||
"39": {id: 39, country: "USA"}, | ||
"76": {id: 76, country: "Venezuela"}, | ||
"77": {id: 77, country: "Wales"}, | ||
"80": {id: 80, country: "Zimbabwe"} | ||
"0": { id: 0, country: "-- Other --" }, | ||
"49": { id: 49, country: "Andorra" }, | ||
"14": { id: 14, country: "Argentina" }, | ||
"28": { id: 28, country: "Armenia" }, | ||
"41": { id: 41, country: "Australia" }, | ||
"9": { id: 9, country: "Austria" }, | ||
"50": { id: 50, country: "Azerbaijan" }, | ||
"79": { id: 79, country: "Bahrain" }, | ||
"7": { id: 7, country: "Belgium" }, | ||
"17": { id: 17, country: "Brazil" }, | ||
"51": { id: 51, country: "Bulgaria" }, | ||
"34": { id: 34, country: "Canada" }, | ||
"82": { id: 82, country: "Chile" }, | ||
"35": { id: 35, country: "China" }, | ||
"81": { id: 81, country: "Chinese Taipei" }, | ||
"47": { id: 47, country: "Colombia" }, | ||
"33": { id: 33, country: "Croatia" }, | ||
"52": { id: 52, country: "Cuba" }, | ||
"53": { id: 53, country: "Czech Republic" }, | ||
"32": { id: 32, country: "Denmark" }, | ||
"86": { id: 86, country: "England" }, | ||
"54": { id: 54, country: "Estonia" }, | ||
"31": { id: 31, country: "Finland" }, | ||
"3": { id: 3, country: "France" }, | ||
"55": { id: 55, country: "Georgia" }, | ||
"2": { id: 2, country: "Germany" }, | ||
"5": { id: 5, country: "Great Britain" }, | ||
"22": { id: 22, country: "Greece" }, | ||
"46": { id: 46, country: "Hong Kong" }, | ||
"6": { id: 6, country: "Hungary" }, | ||
"56": { id: 56, country: "India" }, | ||
"38": { id: 38, country: "Indonesia" }, | ||
"78": { id: 78, country: "Iran" }, | ||
"16": { id: 16, country: "Ireland" }, | ||
"57": { id: 57, country: "Israel" }, | ||
"1": { id: 1, country: "Italy" }, | ||
"58": { id: 58, country: "Jamaica" }, | ||
"48": { id: 48, country: "Japan" }, | ||
"45": { id: 45, country: "Kuwait" }, | ||
"59": { id: 59, country: "Latvia" }, | ||
"27": { id: 27, country: "Lebanon" }, | ||
"60": { id: 60, country: "Lithuania" }, | ||
"44": { id: 44, country: "Luxembourg" }, | ||
"61": { id: 61, country: "Macao" }, | ||
"84": { id: 84, country: "Madagascar" }, | ||
"62": { id: 62, country: "Malaysia" }, | ||
"85": { id: 85, country: "Malta" }, | ||
"29": { id: 29, country: "Mexico" }, | ||
"15": { id: 15, country: "Monaco" }, | ||
"88": { id: 88, country: "Morocco" }, | ||
"63": { id: 63, country: "Nepal" }, | ||
"12": { id: 12, country: "Netherlands" }, | ||
"64": { id: 64, country: "New Caledonia" }, | ||
"40": { id: 40, country: "New Zealand" }, | ||
"65": { id: 65, country: "Nigeria" }, | ||
"66": { id: 66, country: "Northern Ireland" }, | ||
"24": { id: 24, country: "Norway" }, | ||
"21": { id: 21, country: "Oman" }, | ||
"67": { id: 67, country: "Papua New Guinea" }, | ||
"68": { id: 68, country: "Philippines" }, | ||
"13": { id: 13, country: "Poland" }, | ||
"36": { id: 36, country: "Portugal" }, | ||
"19": { id: 19, country: "Puerto Rico" }, | ||
"69": { id: 69, country: "Qatar" }, | ||
"70": { id: 70, country: "Romania" }, | ||
"10": { id: 10, country: "Russia" }, | ||
"42": { id: 42, country: "San Marino" }, | ||
"23": { id: 23, country: "Saudi Arabia" }, | ||
"71": { id: 71, country: "Scotland" }, | ||
"72": { id: 72, country: "Serbia" }, | ||
"37": { id: 37, country: "Singapore" }, | ||
"20": { id: 20, country: "Slovakia" }, | ||
"73": { id: 73, country: "Slovenia" }, | ||
"18": { id: 18, country: "South Africa" }, | ||
"26": { id: 26, country: "South Korea" }, | ||
"4": { id: 4, country: "Spain" }, | ||
"30": { id: 30, country: "Sweden" }, | ||
"8": { id: 8, country: "Switzerland" }, | ||
"74": { id: 74, country: "Taiwan" }, | ||
"11": { id: 11, country: "Thailand" }, | ||
"25": { id: 25, country: "Turkey" }, | ||
"75": { id: 75, country: "Ukraine" }, | ||
"43": { id: 43, country: "United Arab Emirates" }, | ||
"83": { id: 83, country: "Uruguay" }, | ||
"39": { id: 39, country: "USA" }, | ||
"76": { id: 76, country: "Venezuela" }, | ||
"77": { id: 77, country: "Wales" }, | ||
"80": { id: 80, country: "Zimbabwe" } | ||
} | ||
export default nationalities; |