IS TINY
Introduction
The TINY packet is a general purpose packet comprised of 4 bytes. The packet is designed to prevent repeating a common structure which would be the same for many packets. Its defining feature is the SubT or sub-type, which can have many different meanings based on the TINY_ enumeration.
struct IS_TINY // General purpose 4 byte packet
{
byte Size; // 4
byte Type; // ISP_TINY
byte ReqI; // 0 unless it is an info request or a reply to an info request
byte SubT; // subtype, from TINY_ enumeration (e.g. TINY_RACE_END)
};
Packet Details
Size
The size of the packet, always 4 bytes.
Type
The packet type from the ISP_ enumeration, always ISP_TINY.
ReqI
ReqI must be set to non-zero when sending a request for information to LFS, and in turn the replying packet will contain the same value set in its ReqI. For packets sent by LFS without a request, ReqI is zero.
SubT
The packet's sub-type, which is a value from the TINY_ enumeration.
- TINY_NONE: The InSim keep alive packet (see below)
- TINY_VER: Request for an IS_VER version packet
- TINY_CLOSE: Send to close the InSim connection
- TINY_PING: Ping the system to test the connection
- TINY_REPLY: Sent in reply to a TINY_PING
- TINY_VTC: Send to cancel the current vote/Sent when the current vote is cancelled
- TINY_SCP: Request an IS_SCP camera position packet
- TINY_SST: Request an IS_STA state packet
- TINY_GTM: Request the current race time in ms. An IS_SMALL with a SubT of SMALL_RTP is sent.
- TINY_MPE: Sent when leaving or closing a multiplayer host
- TINY_ISM: Request for an IS_ISM packet to be sent
- TINY_REN: Sent when the race ends (return to the race setup screen)
- TINY_CLR: Sent when all players are cleared from the race
- TINY_NCN: Request IS_NCN packets for all connections
- TINY_NPL: Request IS_NPL packets for all players
- TINY_RES: Request IS_RES packets for all results
- TINY_NLP: Request an IS_NLP packet
- TINY_MCI: Request an IS_MCI packet
- TINY_REO: Request an IS_REO packet
- TINY_RST: Request an IS_RST packet
- TINY_AXI: Request an IS_AXI packet
- TINY_AXC: Sent when the current autocross layout is cleared
- TINY_RIP: Request an IS_RIP packet
- TINY_NCI: Request IS_NCI packets for all connections (host only)
- TINY_ALC: Request an IS_ALC packet
- TINY_AXM: Request IS_AXM packets for the entire layout
- TINY_SLC: Request IS_SLC packets for all connections
- TINY_MAL: Request an IS_MAL packet
- TINY_PLH: Request an IS_PLH packet
- TINY_IPB: Request an IS_IPB packet
- TINY_LCL: Request an IS_SMALL packet with SubT SMALL_LCL for the local car's lights
Keep Alive
If LFS does not receive at least one packet every 70 seconds, it closes the connection with your program. The game will send a 'keep-alive' packet every 30 seconds, to which you should reply to ensure the connection is kept alive, even when no other packets are being sent or received. The keep alive packet is an IS_TINY with a SubT of TINY_NONE. Whenever a TINY_NONE is received, you should reply with the same packet in order to inform LFS that your program is still alive.