IS UCO
Introduction
The User Control Object packet is sent by LFS when a car interacts with an InSim circle or checkpoint.
| Type | Name | Description |
|---|---|---|
| byte | Size | 28 |
| byte | Type | ISP_UCO |
| byte | ReqI | 0 |
| byte | PLID | player's unique id |
| byte | Sp0 | |
| byte | UCOAction | action (UCO_x) |
| byte | Sp2 | |
| byte | Sp3 | |
| unsigned | Time | ms since start (as in SMALL_RTP) |
| CarContOBJ | C | |
| ObjectInfo | Info | Info about the checkpoint or circle (see below) |
Packet Details
Size
The size of the packet is always 28 bytes.
Type
The packet type from the ISP_ enumeration, always ISP_UCO.
ReqI
ReqI is equal to zero.
PLID
The unique player ID of the car that triggered the packet.
UCOAction
A value from the UCO_ enumeration:
- UCO_CIRCLE_ENTER: Entered a circle
- UCO_CIRCLE_LEAVE: Left a circle
- UCO_CP_FWD: Crossed a checkpoint in forward direction
- UCO_CP_REV: Crossed a checkpoint in reverse direction
Time
The timestamp of the event, in ms from the start of the session (as in SMALL_RTP).
C
A CarContOBJ struct containing information about the car.
Info
An ObjectInfo struct containing information about the circle or checkpoint.
An InSim checkpoint is identified by index 252. The checkpoint type is stored in the Flags bits 0 and 1:
- 00 = finish line
- 01 = 1st checkpoint
- 10 = 2nd checkpoint
- 11 = 3rd checkpoint
There is no specific way to uniquely identify multiple checkpoints of the same type, other than checking their coordinates.
An InSim circle is identified by index 253. The circle index (seen in the layout editor) is stored in the Heading byte.