IS ISI

From LFS Manual
Jump to navigationJump to search

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.

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	Sp0;		// 0
	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 Detail

Size

The packet size, always 44 bytes.

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 respond with an IS_VER version packet. The value set here is returned in the IS_VER packet's ReqI.

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 MSO packets, which will otherwise be omitted.
  • 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).

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 50ms 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 games 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. Can contain colour codes.

Error Messages

There are several error messages when 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 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.