node-insim
Version:
An InSim library for NodeJS with TypeScript support
63 lines (62 loc) • 1.89 kB
TypeScript
import { Packet } from './base';
import type { StateFlags, Wind } from './enums';
import { PacketType, ViewIdentifier } from './enums';
/**
* STAte
*
* LFS will send an {@link IS_STA} any time the info in it changes.
*
* To request an IS_STA at any time, send an {@link IS_TINY}
* with {@link IS_TINY.SubT} of {@link TinyType.TINY_SST}.
*/
export declare class IS_STA extends Packet {
readonly Size = 28;
readonly Type = PacketType.ISP_STA;
/** ReqI if replying to a request packet */
ReqI: number;
readonly Zero = 0;
/** 4-byte float - 1.0 is normal speed */
ReplaySpeed: number;
/** ISS state flags */
Flags: StateFlags | 0;
/** Which type of camera is selected (which is still selected
* even if LFS is actually in SHIFT+U mode) */
InGameCam: ViewIdentifier;
/** Unique ID of viewed player (0 = none) */
ViewPLID: number;
/** Number of players in race */
NumP: number;
/** Number of connections including host */
NumConns: number;
/** Number finished or qualified */
NumFinished: number;
/** 0 = no race / 1 = race / 2 = qualifying */
RaceInProg: RaceState;
/** Qualifying length in minutes */
QualMins: number;
/**
* RaceLaps (rl): (various meanings depending on range)
*
* 0 : practice
* 1-99 : number of laps... laps = rl
* 100-190 : 100 to 1000 laps... laps = (rl - 100) * 10 + 100
* 191-238 : 1 to 48 hours... hours = rl - 190
*/
RaceLaps: number;
private readonly Sp2;
/** 0 = unknown / 1 = success / > 1 = fail */
ServerStatus: ServerStatus | number;
/** Short name for track e.g. FE2R */
Track: string;
Weather: number;
Wind: Wind;
}
export declare enum RaceState {
NO_RACE = 0,
RACE = 1,
QUALIFYING = 2
}
export declare enum ServerStatus {
UNKNOWN = 0,
SUCCESS = 1
}