eckhchri / pcars-ds-liveview

Provides a html page for project cars dedicated server and display a map of the current race.
14 stars 1 forks source link

Track-Name to TrackID changes #108

Closed eckhchri closed 6 years ago

eckhchri commented 6 years ago

Reason: We have different name for several tracks in API (CREST1, CREST2, DS1, DS2). The crest API only provides TrackNames, but we need TrackIDs to refer to TrackRefpoint class.

1.) class Refpoints get a new field like: AlternativeName: "GP,Grand Grix, Barca GP, ..." . It includes all names for this track from all APIs. 2.) within index.html a new hash aTrackname2Trackid will created as key value store (key = trackname, value=trackid) 3.) the new hash aTrackname2Trackid should be copied to worker

4.) function GetTrackIDbyName() https://github.com/eckhchri/pcars-ds-liveview/blob/master/receive_ds_data.js#L787 uses this prepared hash instead of parsing through array with loops-> performance gains expected

eckhchri commented 6 years ago

Mojave has a different TrackID in PCARS1 and PCARS2 Possible need to add new dimension for RefPoint List:

new attribute "AvailableFor" : (PCARS1 | PCARS2| ) as CSV Extend hash aRefPointTrackname2ID[CurGameRunning][Trackname]