IS TINY

From LFS Manual
Jump to navigationJump to search

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.

struct IS_TINY // General purpose 4 byte packet
{
	byte Size;		// always 4
	byte Type;		// always 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 Detail

Size

The size of the packet, always 4 bytes.

Type

The packet type from the ISP_ enumeration, always ISP_TINY.

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.

SubT

  • 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 system
  • TINY_PING: Ping the system to test the connection
  • TINY_REPLY: Sent in reply to a TINY_PING
  • TINY_VTC: Sent when the current vote is cancelled
  • TINY_SCP: Request a IS_SCP camera position packet
  • TINY_SST: Request for 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_MPE: Sent when leaving or closing a multiplayer host
  • TINY_ISM: Request for a IS_ISM InSim multi packet to be sent
  • TINY_REN: Sent when the race ends (go back to track selection screen)
  • TINY_CLR: Send to clear all players from the race
  • TINY_NCN: Request for all IS_NCN connection packets
  • TINY_NPL: Request for all IS_NPL player packets
  • TINY_RES: Request for all IS_RES result packets
  • TINY_NLP: Request a IS_NLP node lap packet
  • TINY_MCI: Request a IS_MCI multi-car info packet
  • TINY_REO: Request a IS_REO race reorder packet
  • TINY_RST: Request a IS_RST race start packet
  • TINY_AXI: Request a IS_AXI autocross info packet
  • TINY_AXC: Sent when the current autocross layout is cleared
  • TINY_RIP: Request a IS_RIP replay information packet

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_NONE. Whenever a TINY_NONE 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.