IS STA

From LFS Manual
Revision as of 21:50, 13 February 2026 by Flame CZE (talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to navigationJump to search
IS_STA
Sent when the game state changes
Overview
Size 28
Type ISP_STA (5)
Usage instruction
Previous packet
IS_SMALL
Next packet
IS_SCH

The STAte packet contains information about the current game state and is sent any time the information included in the packet changes. To request for an IS_STA packet to be sent, send an IS_TINY with a SubT of TINY_STA.

Packet details

IS_STA packet properties
Type Name Description
byte Size 28
byte Type ISP_STA
byte ReqI ReqI if replying to a request packet
byte Zero
float ReplaySpeed 4-byte float - 1.0 is normal speed
word Flags ISS state flags (see below)
byte InGameCam Which type of camera is selected (see below)
byte ViewPLID Unique ID of viewed player (0 = none)
byte NumP Number of players in race
byte NumConns Number of connections including host
byte NumFinished Number finished or qualified
byte RaceInProg 0 - no race / 1 - race / 2 - qualifying
byte QualMins
byte RaceLaps see "RaceLaps" near the top of this document
byte Spare2
byte Spare3
char Track[6] short name for track e.g. FE2R
byte Weather 0,1,2...
byte Wind 0=off 1=weak 2=strong

Size

The size of the packet, always 28.

Type

The packet type from the ISP_ enumeration, always ISP_STA.

ReqI

Zero if sent directly by LFS, otherwise equal to the ReqI provided in the request for the IS_STA packet.

Replay Speed

The current replay speed as a floating point number, with 1.0 as normal speed. Only set when playing back a replay.

Flags

The ISS_ bit flags.

  • ISS_GAME: In game or playing MPR (multiplayer replay)
  • ISS_REPLAY: In SPR (singleplayer replay)
  • ISS_PAUSED: Game is paused
  • ISS_SHIFTU: In SHIFT+U mode
  • ISS_DIALOG: In a dialog
  • ISS_SHIFTU_FOLLOW: Following a car
  • ISS_SHIFTU_NO_OPT: In SHIFT+U mode but buttons hidden
  • ISS_SHOW_2D: 2D on-screen display visible
  • ISS_FRONT_END: On game entry screen
  • ISS_MULTI: In multiplayer mode
  • ISS_MPSPEEDUP: Multiplayer speedup option active
  • ISS_WINDOWED: LFS running in windowed mode (SHIFT+F4)
  • ISS_SOUND_MUTE: Sound is turned off
  • ISS_VIEW_OVERRIDE: Override user view
  • ISS_VISIBLE: InSim buttons are currently visible
  • ISS_TEXT_ENTRY: In a text entry dialog

InGameCam

Which type of in-game camera is being used, from the VIEW_ enumeration.

  • VIEW_FOLLOW: Chase camera (arcade) view
  • VIEW_HELI: Helicopter view
  • VIEW_CAM: Track-side (TV) camera view
  • VIEW_DRIVER: Cockpit view
  • VIEW_CUSTOM: Custom view
  • VIEW_ANOTHER: Viewing another car

ViewPLID

Unique player ID (PLID) of the car currently being viewed (0 = none).

NumP

Number of players currently in the race.

NumConns

Number of players currently connected to the server, including the host.

NumFinished

Number of players currently finished the race or qualifying session.

RaceInProg

Whether the race is currently in progress.

  • 0: No race
  • 1: Race
  • 2: Qualifying

QualMins

Number of minutes for the qualifying session, if set.

RaceLaps

The number of laps in the race. This value has various meanings depending on its range.

  • 0: Practice session
  • 1-99: Number of laps
  • 100-190: 100 to 1000 laps (laps = (rl - 100) * 10 + 100)
  • 191-238: 1 to 48 hours (hours = rl - 190)

Here is an example of determining the laps and/or hours:

int getLaps(int raceLaps)
{
    if (raceLaps >= 1 && raceLaps <= 99)
    {
        return raceLaps;
    }
    else if (raceLaps >= 100 && raceLaps <= 190)
    {
        return (raceLaps - 100) * 10 + 100;
    }
    return 0;
}

int getHours(int raceLaps)
{
    if (raceLaps >= 191 && raceLaps <= 238)
    {
        return raceLaps - 190;
    }
    return 0;
}

ServerStatus

The status of the connection to the server.

  • 0: Unknown
  • 1: Success
  • > 1: Fail

Track

The short name for the track, e.g. BL1R or FE3.

Weather

The weather settings in game.

  • 0: Bright or clear
  • 1: Overcast
  • 2: Cloudy, sunset or dusk

Wind

The wind settings in game.

  • 0: None
  • 1: Low
  • 2: High


Initialisation IS_ISI
Version Information IS_VER
General Purpose IS_TINY · IS_SMALL · IS_TTC
State Reporting and Requests IS_STA · IS_SFP · IS_ISM
Text Messages and Key Presses IS_SCH · IS_MSO · IS_III · IS_MST · IS_MTC · IS_MSX · IS_MSL
Voting IS_VTN
Race Tracking IS_RST · IS_REO
Autocross IS_AXI · IS_AXO · IS_UCO · IS_OCO · IS_AXM
Connection Tracking IS_NCN · IS_CNL · IS_CPR · IS_ACR · IS_NCI · IS_SLC · IS_CIM
Car Tracking IS_NPL · IS_PLP · IS_PLL · IS_LAP · IS_SPX · IS_PIT · IS_PSF · IS_PLA · IS_PEN · IS_TOC · IS_FLG · IS_PFL · IS_FIN · IS_RES · IS_NLP · IS_MCI · IS_CRS · IS_CON · IS_OBH · IS_HLV · IS_CSC
Camera Control IS_SCC · IS_CPP
Replay Control IS_RIP
Screenshots IS_SSH
InSim Buttons IS_BFN · IS_BTN · IS_BTC · IS_BTT
AI Control IS_AIC · IS_AII
Other packets IS_MOD · IS_CCH · IS_PLC · IS_HCP · IS_JRR · IS_MAL · IS_PLH · IS_IPB