UNPKG

node-insim

Version:

An InSim library for NodeJS with TypeScript support

56 lines (55 loc) 1.72 kB
import { Packet } from './base'; import { PacketType } from './enums'; import { CarContOBJ, ObjectInfo } from './structs'; /** * User Control Object * * Reports crossing an InSim checkpoint / entering an InSim circle (from layout). */ export declare class IS_UCO extends Packet { readonly Size = 28; readonly Type = PacketType.ISP_UCO; readonly ReqI = 0; /** Player's unique id */ PLID: number; private readonly Sp0; /** Entering/leaving a circle or crossing a checkpoint */ UCOAction: UCOAction; private readonly Sp2; private readonly Sp3; /** Hundredths of a second since start (as in {@link SMALL_RTP}) */ Time: number; /** Car contact object */ C: CarContOBJ; /** * Info about the checkpoint or circle * * Identifying an InSim checkpoint: * * Index is 252. Checkpoint index (seen in the layout editor) is stored in Flags * bits 0 and 1. * * - 00 = finish line * - 01 = 1st checkpoint * - 10 = 2nd checkpoint * - 11 = 3rd checkpoint * * Note that the checkpoint index has no meaning in LFS and is provided only for your convenience. * If you use many InSim checkpoints you may need to identify them with the X and Y values. * * Identifying an InSim circle: * * Index is 253. The circle index (seen in the layout editor) is stored in the Heading byte. */ Info: ObjectInfo; } export declare enum UCOAction { /** Etered a circle */ UCO_CIRCLE_ENTER = 0, /** Left a circle */ UCO_CIRCLE_LEAVE = 1, /** Crossed a checkpoint in forward direction */ UCO_CP_FWD = 2, /** Crossed a checkpoint in reverse direction */ UCO_CP_REV = 3 }