Difference between revisions of "IS TINY"

From LFS Manual
Jump to navigationJump to search
 
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
  
The IS_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.
+
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.
  
== Packet Detail ==
+
{| class="wikitable"
 +
|+ IS_TINY packet properties
 +
|-
 +
! Type !! Name !! Description
 +
|-
 +
| 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 ===
 
=== Size ===
Line 11: Line 33:
 
=== Type ===
 
=== Type ===
  
The packet type from the ISP_ enumeration, always 3.
+
The packet type from the [[InSim_enumerations#ISP|ISP_]] enumeration, always ISP_TINY.
  
 
=== ReqI ===
 
=== ReqI ===
  
The ReqI must always be set to non-zero when sending a request to LFS for information, and in turn the replying packet will contain the same value set in its 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 ===
 
=== SubT ===
 +
 +
The packet's sub-type, which is a value from the [[InSim_enumerations#TINY|TINY_]] enumeration.
  
 
* TINY_NONE: The InSim keep alive packet (see below)
 
* TINY_NONE: The InSim keep alive packet (see below)
 
* TINY_VER: Request for an [[IS_VER]] version packet
 
* TINY_VER: Request for an [[IS_VER]] version packet
* TINY_CLOSE: Send to close the InSim system
+
* TINY_CLOSE: Send to close the InSim connection
 
* TINY_PING: Ping the system to test the connection
 
* TINY_PING: Ping the system to test the connection
 
* TINY_REPLY: Sent in reply to a TINY_PING
 
* TINY_REPLY: Sent in reply to a TINY_PING
* TINY_VTC: Sent when the current vote is cancelled
+
* TINY_VTC: Send to cancel the current vote/Sent when the current vote is cancelled
* TINY_SCP: Request a [[IS_SCP]] camera position packet
+
* TINY_SCP: Request an [[IS_CPP]] camera position packet
* TINY_SST: Request for [[IS_STA]] state packet
+
* TINY_SST: Request an [[IS_STA]] state packet
* TINY_GTH: Request the current race time in hundreds. A [[IS_SMALL]] with a SubT of SMALL_RTP is sent
+
* 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_MPE: Sent when leaving or closing a multiplayer host
* TINY_ISM: Request for a [[IS_ISM]] InSim multi packet to be sent
+
* TINY_ISM: Request for an [[IS_ISM]] packet to be sent
* TINY_REN: Sent when the race ends (go back to track selection screen)
+
* TINY_REN: Sent when the race ends (return to the race setup screen)
* TINY_CLR: Send to clear all players from the race
+
* TINY_CLR: Sent when all players are cleared from the race
* TINY_NCN: Request for all [[IS_NCN]] connection packets
+
* TINY_NCN: Request [[IS_NCN]] packets for all connections
* TINY_NPL: Request for all [[IS_NPL]] player packets
+
* TINY_NPL: Request [[IS_NPL]] packets for all players
* TINY_RES: Request for all [[IS_RES]] result packets
+
* TINY_RES: Request [[IS_RES]] packets for all results
* TINY_NLP: Request a [[IS_NLP]] node lap packet
+
* TINY_NLP: Request an [[IS_NLP]] packet
* TINY_MCI: Request a [[IS_MCI]] multi-car info packet
+
* TINY_MCI: Request an [[IS_MCI]] packet
* TINY_REO: Request a [[IS_REO]] race reorder packet
+
* TINY_REO: Request an [[IS_REO]] packet
* TINY_RST: Request a [[IS_RST]] race start packet
+
* TINY_RST: Request an [[IS_RST]] packet
* TINY_AXI: Request a [[IS_AXI]] autocross info packet
+
* TINY_AXI: Request an [[IS_AXI]] packet
 
* TINY_AXC: Sent when the current autocross layout is cleared
 
* TINY_AXC: Sent when the current autocross layout is cleared
* TINY_RIP: Request a [[IS_RIP]] replay information packet
+
* TINY_RIP: Request an [[IS_RIP]] packet
 +
* TINY_NCI: Request [[IS_NCI]] packets for all connections (host only)
 +
* TINY_ALC: Request a [[InSim_enumerations#SMALL|SMALL_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 ==
 
== Keep Alive ==
  
In order to maintain the connection with your program LFS will send a 'keep-alive' packet every 70 seconds. This packet must be replied to in order to prevent LFS from closing the connection. The keep alive packet is basically just a IS_TINY with a SubT of TINY_CLOSE. Whenever a TINY_CLOSE is received you must respond immediately with the same packet in order to inform LFS that your program is still alive. Failure to do this will cause your program to time out.
+
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.
 +
 
 +
[[Category:InSim packets]]

Latest revision as of 20:35, 10 February 2026

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.

IS_TINY packet properties
Type Name Description
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_CPP 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 a SMALL_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.