EmperorCookie / accapi

Assetto Corsa Competizione UDP broadcast API wrapper
Apache License 2.0
24 stars 8 forks source link

Missing nationalities #10

Closed ptoews closed 3 years ago

ptoews commented 3 years ago

I encountered a nationality number that's not listed in the respective enum, however I have no clue which nationality it refers to. The number is 78. I would suggest that the nationality enum is accessed with a fallback default value since more nationalities might appear in the future, e.g. instead of https://github.com/EmperorCookie/accapi/blob/6cdfcb9c974b9d5422d4ce0f1122d3009a73b7c6/src/accapi/structs.py#L174

nationality = args.pop(0)
self.nationality = NATIONALITY.get(nationality, f"Unknown ({nationality})")

Edit: Forgot to mention that this caused a KeyError that shut everything down

EmperorCookie commented 3 years ago

Will fix but will also accept PR if you get to it before me.