UNPKG

node-insim

Version:

An InSim library for NodeJS with TypeScript support

113 lines (112 loc) 3.15 kB
import { Packet } from './base'; import type { PlayerFlags, TyreCompound } from './enums'; import { PacketType } from './enums'; /** * New PLayer joining race (if PLID already exists, then leaving pits) */ export declare class IS_NPL extends Packet { readonly Size = 76; readonly Type = PacketType.ISP_NPL; /** 0 unless this is a reply to a {@link TINY_NPL} */ ReqI: number; /** Player's newly assigned unique id */ PLID: number; /** Connection's unique id */ UCID: number; /** Bit 0: female / bit 1: AI / bit 2: remote */ PType: PlayerType | 0; /** Player flags */ Flags: PlayerFlags | 0; /** Nickname */ PName: string; /** Number plate - NO ZERO AT END! */ Plate: string; /** * Car name * * The value can be one of these: * - a 3-character abbreviation of an official LFS car (e.g. XRT) * - a hexadecimal string representation of a car mod's SkinID (e.g. 5882E6) */ CName: string; /** Skin name - MAX_CAR_TEX_NAME */ SName: string; /** Rear left tyre compound */ TyreRL: TyreCompound; /** Rear right tyre compound */ TyreRR: TyreCompound; /** Front left tyre compound */ TyreFL: TyreCompound; /** Front right tyre compound */ TyreFR: TyreCompound; /** Added mass (kg) */ H_Mass: number; /** Intake restriction */ H_TRes: number; /** Driver model */ Model: number; /** Passengers byte */ Pass: PassengerFlags | 0; /** Low 4 bits: tyre width reduction (rear) */ RWAdj: number; /** Low 4 bits: tyre width reduction (front) */ FWAdj: number; private readonly Sp2; private readonly Sp3; /** Setup flags */ SetF: SetupFlags | 0; /** Number in race - ZERO if this is a join request */ NumP: number; /** * Configuration * * - UF1 / LX4 / LX6: 0 = DEFAULT / 1 = OPEN ROOF * - GTR racing cars: 0 = DEFAULT / 1 = ALTERNATE */ Config: CarConfiguration; /** /showfuel yes: fuel percent / no: 255 */ Fuel: number; } export declare enum CarConfiguration { /** Default */ DEFAULT = 0, /** * UF1 / LX4 / LX6 = open roof * GTR racing cars = alternate */ OPEN_ROOF_OR_ALTERNATE = 1 } export declare enum PassengerFlags { /** Front passenger is male */ FRONT_MALE = 1, /** Front passenger is female */ FRONT_FEMALE = 2, /** Rear-left passenger is male */ REAR_LEFT_MALE = 4, /** Rear-left passenger is female */ REAR_LEFT_FEMALE = 8, /** Rear-middle passenger is male */ REAR_MIDDLE_MALE = 16, /** Rear-middle passenger is female */ REAR_MIDDLE_FEMALE = 32, /** Rear-right passenger is male */ REAR_RIGHT_MALE = 64, /** Rear-right passenger is female */ REAR_RIGHT_FEMALE = 128 } export declare enum PlayerType { /** Female */ FEMALE = 1, /** AI */ AI = 2, /** Remote */ REMOTE = 4 } export declare enum SetupFlags { /** Symmetrical wheels */ SETF_SYMM_WHEELS = 1, /** Traction control enabled */ SETF_TC_ENABLE = 2, /** Anti-lock brakes enabled */ SETF_ABS_ENABLE = 4 }