Difference between revisions of "IS ISI"

From LFS Manual
Jump to navigationJump to search
m
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
  
The InSim Initialsation packet. This packet is sent to LFS to initialise the InSim system upon first connecting. It contains various options and flags.
+
The '''I'''n'''S'''im '''I'''nitialsation packet. This packet is sent to LFS to initialise the InSim system upon first connecting.
  
 
<big><pre>struct IS_ISI // InSim Init - packet to initialise the InSim system
 
<big><pre>struct IS_ISI // InSim Init - packet to initialise the InSim system
Line 13: Line 13:
 
word Flags; // Bit flags for options (see below)
 
word Flags; // Bit flags for options (see below)
  
byte Sp0; // 0
+
byte InSimVer; // The INSIM_VERSION used by your program
 
byte Prefix; // Special host message prefix character
 
byte Prefix; // Special host message prefix character
 
word Interval; // Time in ms between NLP or MCI (0 = none)
 
word Interval; // Time in ms between NLP or MCI (0 = none)
Line 21: Line 21:
 
};</pre></big>
 
};</pre></big>
  
== Packet Detail ==
+
== Packet Details ==
  
 
=== Size ===
 
=== Size ===
  
The packet size, always 44 bytes.
+
The packet size, always 44 bytes. Note: The actual byte value is 11, as all packets have a size multiplier of 4.
  
 
=== Type ===
 
=== Type ===
Line 33: Line 33:
 
=== ReqI ===
 
=== ReqI ===
  
If set to non-zero (any byte between 1 and 255) LFS will respond with an [[IS_VER]] version packet. The value set here is returned in the IS_VER packet's ReqI.
+
If set to non-zero (any byte between 1 and 255), LFS will reply with an [[IS_VER]] version packet containing the same ReqI value.
  
=== UDPPort===
+
=== UDPPort ===
  
 
Specifies the UDP port to use for packets sent by LFS. If connected using UDP all packets are sent on this port. If connected in TCP, only [[IS_NLP]] and [[IS_MCI]] will be sent using it. If set to 0 (zero) all packets are sent using the main UDP or TCP connection.
 
Specifies the UDP port to use for packets sent by LFS. If connected using UDP all packets are sent on this port. If connected in TCP, only [[IS_NLP]] and [[IS_MCI]] will be sent using it. If set to 0 (zero) all packets are sent using the main UDP or TCP connection.
Line 46: Line 46:
 
* ISF_RES_1: Spare
 
* ISF_RES_1: Spare
 
* ISF_LOCAL: Prevents buttons sent by a local InSim program conflicting with those sent by a host. The user can swap between local and host buttons with the command SHIFT+B.
 
* ISF_LOCAL: Prevents buttons sent by a local InSim program conflicting with those sent by a host. The user can swap between local and host buttons with the command SHIFT+B.
* ISF_MSO_COLS: Keep colour codes (^3, ^7 etc..) in MSO packets, which will otherwise be omitted.
+
* ISF_MSO_COLS: Keep colour codes (^3, ^7, etc.) in [[IS_MSO]] packets, which will otherwise be stripped.
* ISF_NLP: If set [[IS_NLP]] packets will be sent at the interval specified (see below).
+
* ISF_NLP: If set, [[IS_NLP]] packets will be sent at the interval specified (see below).
* ISF_MCI: If set [[IS_MCI]] packets will be sent at the interval specified (see below).
+
* ISF_MCI: If set, [[IS_MCI]] packets will be sent at the interval specified (see below).
 +
* ISF_CON: If set, [[IS_CON]] packets can be received.
 +
* ISF_OBH: If set, [[IS_OBH]] packets can be received.
 +
* ISF_OBH: If set, [[IS_HLV]] packets can be received.
 +
* ISF_AXM_LOAD: If set, [[IS_AXM]] packets will be received when a layout is loaded.
 +
* ISF_AXM_EDIT: If set, [[IS_AXM]] packets will be received when layout objects are modified.
 +
* ISF_REQ_JOIN: If set, players can only join a race if an [[IS_JRR] packet is sent in response to their join request.
  
 
=== Prefix ===
 
=== Prefix ===
  
A special host prefix character, such as '!' or '$'. When set any chat message typed which begins with the prefix will be sent as an [[IS_MSO]] message with the UserType MSO_PREFIX and will not appear in the game chat.
+
A special host prefix character, such as '!' or '$'. When set, any chat message typed which begins with the prefix will be sent as an [[IS_MSO]] message with the UserType MSO_PREFIX and will not appear in the game chat.
  
 
=== Interval ===
 
=== Interval ===
  
The interval in milliseconds between [[IS_NLP]] and [[IS_MCI]] updates. This can be any value between 50ms and 8000ms.
+
The interval in milliseconds between [[IS_NLP]] and [[IS_MCI]] updates. This can be any value between 10ms and 8000ms.
  
 
=== Admin ===
 
=== Admin ===
  
The LFS game admin password. This is the same admin password entered on the host creation screen, and can also be found in the games cfg.txt file on the line Game Admin. Note: this is not a secure password.
+
The LFS game admin password. This is the same admin password entered on the host creation screen, and can also be found in the game's cfg.txt file on the line Game Admin. Note: this is not a secure password.
  
 
=== IName ===
 
=== IName ===
  
A short name for your program, up to 15 characters in length. Can contain colour codes.
+
A short name for your program, up to 15 characters in length (the last byte must be 0, so only 15 characters are available). Can contain colour codes.
  
 
== Error Messages ==
 
== Error Messages ==
  
There are several error messages when can appear when attempting to initialise InSim.
+
There are several error messages which can appear when attempting to initialise InSim.
  
 
* did not receive InSimInit packet: Appears if a connection is made with LFS but no IS_ISI packet is received within a certain timeout.
 
* did not receive InSimInit packet: Appears if a connection is made with LFS but no IS_ISI packet is received within a certain timeout.
 
* password does not match your multiplayer admin password: Simply means that the Admin password you've supplied is incorrect.
 
* password does not match your multiplayer admin password: Simply means that the Admin password you've supplied is incorrect.
* first byte in packet does not match size: A common error message seen when trying to connect using an old version of InSim, which used a different format for the packet header. Make sure that the packet definitions you are using are from the most up to date version of InSim, which is version 4 at the time of writing.
+
* first byte in packet does not represent size: A common error message seen when trying to connect using an old version of InSim, which used a different format for the packet header. Make sure that the packet definitions you are using are from the most up-to-date version of InSim, which is version 10 at the time of writing.
 +
* first packet has unexpected size - should be ISI: This error can be cause by the previous one, or if you send any packet before sending an IS_ISI to initialise the connection.
  
 
[[Category:InSim packets]]
 
[[Category:InSim packets]]

Revision as of 15:13, 9 February 2026

Introduction

The InSim Initialsation packet. This packet is sent to LFS to initialise the InSim system upon first connecting.

struct IS_ISI // InSim Init - packet to initialise the InSim system
{
	byte	Size;		// 44
	byte	Type;		// ISP_ISI
	byte	ReqI;		// If non-zero LFS will send an IS_VER packet
	byte	Zero;		// 0

	word	UDPPort;	// Port for UDP replies from LFS (0 to 65535)
	word	Flags;		// Bit flags for options (see below)

	byte	InSimVer;	// The INSIM_VERSION used by your program
	byte	Prefix;		// Special host message prefix character
	word	Interval;	// Time in ms between NLP or MCI (0 = none)

	char	Admin[16];	// Admin password (if set in LFS)
	char	IName[16];	// A short name for your program
};

Packet Details

Size

The packet size, always 44 bytes. Note: The actual byte value is 11, as all packets have a size multiplier of 4.

Type

The packet type from the ISP_ enumeration, always ISP_ISI.

ReqI

If set to non-zero (any byte between 1 and 255), LFS will reply with an IS_VER version packet containing the same ReqI value.

UDPPort

Specifies the UDP port to use for packets sent by LFS. If connected using UDP all packets are sent on this port. If connected in TCP, only IS_NLP and IS_MCI will be sent using it. If set to 0 (zero) all packets are sent using the main UDP or TCP connection.

Flags

Specifies various bit flags.

  • ISF_RES_0: Spare
  • ISF_RES_1: Spare
  • ISF_LOCAL: Prevents buttons sent by a local InSim program conflicting with those sent by a host. The user can swap between local and host buttons with the command SHIFT+B.
  • ISF_MSO_COLS: Keep colour codes (^3, ^7, etc.) in IS_MSO packets, which will otherwise be stripped.
  • ISF_NLP: If set, IS_NLP packets will be sent at the interval specified (see below).
  • ISF_MCI: If set, IS_MCI packets will be sent at the interval specified (see below).
  • ISF_CON: If set, IS_CON packets can be received.
  • ISF_OBH: If set, IS_OBH packets can be received.
  • ISF_OBH: If set, IS_HLV packets can be received.
  • ISF_AXM_LOAD: If set, IS_AXM packets will be received when a layout is loaded.
  • ISF_AXM_EDIT: If set, IS_AXM packets will be received when layout objects are modified.
  • ISF_REQ_JOIN: If set, players can only join a race if an [[IS_JRR] packet is sent in response to their join request.

Prefix

A special host prefix character, such as '!' or '$'. When set, any chat message typed which begins with the prefix will be sent as an IS_MSO message with the UserType MSO_PREFIX and will not appear in the game chat.

Interval

The interval in milliseconds between IS_NLP and IS_MCI updates. This can be any value between 10ms and 8000ms.

Admin

The LFS game admin password. This is the same admin password entered on the host creation screen, and can also be found in the game's cfg.txt file on the line Game Admin. Note: this is not a secure password.

IName

A short name for your program, up to 15 characters in length (the last byte must be 0, so only 15 characters are available). Can contain colour codes.

Error Messages

There are several error messages which can appear when attempting to initialise InSim.

  • did not receive InSimInit packet: Appears if a connection is made with LFS but no IS_ISI packet is received within a certain timeout.
  • password does not match your multiplayer admin password: Simply means that the Admin password you've supplied is incorrect.
  • first byte in packet does not represent size: A common error message seen when trying to connect using an old version of InSim, which used a different format for the packet header. Make sure that the packet definitions you are using are from the most up-to-date version of InSim, which is version 10 at the time of writing.
  • first packet has unexpected size - should be ISI: This error can be cause by the previous one, or if you send any packet before sending an IS_ISI to initialise the connection.