I have a simulator game that outputs Live Timing results via a UDP String. In Node JS I spun up a UDP client to receive data from the game. I’m getting what I need from the game but I’m having a hard time parsing the data so that I can use to update a webpage in real time. The string comes in as a big string with smaller strings separated by n.
This race had one racer in it, me. This is what is received by the Node JS Client.
MSG
0
EVENT
RACE
LiveResults Test
Forest Raceway
1256.0
OPEN
ENTRY
123
Racer Name
KTM 250 SX-F 2023
OEM 250 SX-F '23
MX2 OEM
FF011000010134CF9F
SESSION
RACE2
INPROGRESS
L 2
WEATHER
CLEAR
0.0
BESTLAP
906
82443
82443
1
36201
60607
15.2
LASTLAP
906
82443
82443
1
36201
60607
15.2
I’ve tried using RegEx and using split to try and extract the data I need. I just can’t seem to go get it to work. What would be the most efficient way to do this? There will be about 30 racers per server so I’m assuming there will be 30 racers under the ENTRY section each racer contains 6 lines. (Race #, Racer Name, Bike, Bike Model, Class and GUID)
I want to be able to extract all details about the racer and their LASTLAP time.