21 lines
587 B
Python
21 lines
587 B
Python
import struct
|
|
import time
|
|
from server.telemetry.data import TelemetryData
|
|
|
|
|
|
def get_parser():
|
|
return IRacingParser()
|
|
|
|
|
|
class IRacingParser:
|
|
"""
|
|
iRacing uses shared memory (IRSDK Memory-Mapped File), NOT UDP.
|
|
This parser is a stub - it does NOT work with UDP input.
|
|
Requires IRSDK mmap reader (not yet implemented).
|
|
"""
|
|
def game_id(self) -> str:
|
|
return "iracing"
|
|
|
|
def parse(self, data: bytes, addr: tuple) -> TelemetryData:
|
|
return TelemetryData(game_id="iracing", timestamp=time.time(), raw={"note": "iRacing uses shared memory, not UDP"})
|