• Welcome to Kart Racing Pro Official Forum. Please login or sign up.
 
March 29, 2024, 12:47:02 AM

News:

Kart Racing Pro release13e available! :)


UDP Proxy

Started by PiBoSo, July 18, 2018, 05:55:42 PM

Previous topic - Next topic

PiBoSo

July 18, 2018, 05:55:42 PM Last Edit: April 09, 2019, 03:10:35 PM by PiBoSo
Starting with Release6, Kart Racing Pro integrates a plugin that allows to receive UDP data from the simulated kart in realtime.

To enable it and set the parameters, edit the file "proxy_udp.ini" in the Kart Racing Pro installation folder:
[params]
enable = 1
port = 30000
ip = 127.0.0.1:30001
delay = 1

port: outbound port
ip: inbound address and, optional, port ( if missing, the outbound port is used )
delay: hundredths of second between packets

The packet format:
"data": null-terminated string
"state": integer. 0: software running; 1: on-track, simulation paused; 2: on-track, simulation running
"time": integer, milliseconds.
The rest of the packet follows the "SPluginsKartData_t" structure of the plugins interface: http://www.kartracing-pro.com/downloads/krp_example.c

In the proxy_udp.ini file, add the line
info = 1
to enable the streaming of the event, session, lap and split data.

Data format of the event packet, sent every second:
"evnt": null-terminated string
The rest of the packet follows the "SPluginsEventData_t" structure of the plugins interface.

Data format of the session packet, sent every second:
"sesn": null-terminated string
The rest of the packet follows the "SPluginsKartSession_t" structure of the plugins interface.

Data format of the lap packet, sent five times a second:
"lap ": null-terminated string
The rest of the packet follows the "SPluginsKartLap_t" structure of the plugins interface.

Data format of the split packet, sent five times a second:
"splt": null-terminated string
"split": integer. 0: the latest line crossed is the start / finish one; 1: the latest line crossed is a split one
The rest of the packet follows the "SPluginsKartSplit_t" structure of the plugins interface.

PiBoSo


First post updated to add information about the extra packets that it is possible to enable starting with Release8.