Difference between revisions of "IS STA"
m |
|||
Line 162: | Line 162: | ||
* 1: Low | * 1: Low | ||
* 2: High | * 2: High | ||
+ | |||
+ | [[Category:InSim packets]] |
Latest revision as of 00:56, 2 December 2023
Introduction
The IS_STA or STAte packet contains various 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 a IS_TINY with a SubT of TINY_STA.
struct IS_STA // STAte { 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 };
Packet Detail
Size
The size of the packet, always 28.
Type
The packet type from the ISP_ enumeration, always ISP_STA.
ReqI
The ReqI as set in the request for an IS_STA to be sent.
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_SHIFTU_HIGH: In high view
- ISS_SHIFTU_FOLLOW: Following 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 windows mode (SHIFT+F4)
- ISS_SOUND_MUTE: Sound is turned off
- ISS_VIEW_OVERRIDE: Override user view
- ISS_VISIBLE: InSim buttons are currently visible
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_MAX: Undocumented
- VIEW_ANOTHER: Viewing another car
ViewPLID
Unique player ID (PLID) of the car current being viewed (0 = none).
NumP
Number of players current 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; }
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