node-insim
Version:
An InSim library for NodeJS with TypeScript support
93 lines (92 loc) • 4.2 kB
TypeScript
import { SendablePacket } from './base';
import { PacketType } from './enums';
/**
* General purpose 4 byte packet
*/
export declare class IS_TINY extends SendablePacket {
readonly Size = 4;
readonly Type = PacketType.ISP_TINY;
/** 0 unless it is an info request or a reply to an info request */
ReqI: number;
/** Subtype */
SubT: TinyType;
constructor(data?: IS_TINY_Data);
}
export declare enum TinyType {
/** Keep alive - maintain connection */
TINY_NONE = 0,
/** Info request: get version */
TINY_VER = 1,
/** Instruction: close insim */
TINY_CLOSE = 2,
/** Ping request: external program requesting a reply */
TINY_PING = 3,
/** Ping reply: reply to a ping request */
TINY_REPLY = 4,
/** Both ways: game vote cancel (info or request) */
TINY_VTC = 5,
/** Info request: send camera position */
TINY_SCP = 6,
/** Info request: send state info */
TINY_SST = 7,
/** Info request: get time in milliseconds (i.e. {@link SMALL_RTP}) */
TINY_GTM = 8,
/** Info: multi player end */
TINY_MPE = 9,
/** Info request: get multiplayer info (i.e. {@link IS_ISM}) */
TINY_ISM = 10,
/** Info: race end (return to race setup screen) */
TINY_REN = 11,
/** Info: all players cleared from race */
TINY_CLR = 12,
/** Info request: get {@link IS_NCN} for all connections */
TINY_NCN = 13,
/** Info request: get all players */
TINY_NPL = 14,
/** Info request: get all results */
TINY_RES = 15,
/** Info request: send an {@link IS_NLP} */
TINY_NLP = 16,
/** Info request: send an {@link IS_MCI} */
TINY_MCI = 17,
/** Info request: send an {@link IS_REO} */
TINY_REO = 18,
/** Info request: send an {@link IS_RST} */
TINY_RST = 19,
/** Info request: send an {@link IS_AXI} - AutoX Info */
TINY_AXI = 20,
/** Info: autocross cleared */
TINY_AXC = 21,
/** Info request: send an {@link IS_RIP} - Replay Information Packet */
TINY_RIP = 22,
/** Info request: get {@link IS_NCI} for all guests (on host only) */
TINY_NCI = 23,
/** Info request: send a {@link SMALL_ALC} (allowed cars) */
TINY_ALC = 24,
/** Info request: send {@link IS_AXM} packets for the entire layout */
TINY_AXM = 25,
/** Info request: send {@link IS_SLC} packets for all connections */
TINY_SLC = 26,
/** Info request: send {@link IS_MAL} listing the currently allowed mods */
TINY_MAL = 27,
/** Info request: send {@link IS_PLH} listing player handicaps */
TINY_PLH = 28,
/** Info request: send {@link IS_IPB} listing the IP bans */
TINY_IPB = 29,
/** Info request: send a {@link SMALL_LCL} for local car's lights */
TINY_LCL = 30
}
export type IS_TINY_Data = {
/** Info request ID */
ReqI: number;
/** Info request subtype */
SubT: InfoRequestTinyType;
} | {
ReqI?: never;
/** Sendable subtype */
SubT: Exclude<SendableTinyType, InfoRequestTinyType>;
};
export declare const SENDABLE_TINY_TYPES: readonly [TinyType.TINY_NONE, TinyType.TINY_VER, TinyType.TINY_CLOSE, TinyType.TINY_PING, TinyType.TINY_VTC, TinyType.TINY_SCP, TinyType.TINY_SST, TinyType.TINY_GTM, TinyType.TINY_ISM, TinyType.TINY_NCN, TinyType.TINY_NPL, TinyType.TINY_RES, TinyType.TINY_NLP, TinyType.TINY_MCI, TinyType.TINY_REO, TinyType.TINY_RST, TinyType.TINY_AXI, TinyType.TINY_RIP, TinyType.TINY_NCI, TinyType.TINY_ALC, TinyType.TINY_AXM, TinyType.TINY_SLC, TinyType.TINY_MAL, TinyType.TINY_PLH, TinyType.TINY_IPB, TinyType.TINY_LCL];
export declare const INFO_REQUEST_TINY_TYPES: readonly [TinyType.TINY_VER, TinyType.TINY_PING, TinyType.TINY_SCP, TinyType.TINY_SST, TinyType.TINY_GTM, TinyType.TINY_ISM, TinyType.TINY_NCN, TinyType.TINY_NPL, TinyType.TINY_RES, TinyType.TINY_NLP, TinyType.TINY_MCI, TinyType.TINY_REO, TinyType.TINY_RST, TinyType.TINY_AXI, TinyType.TINY_RIP, TinyType.TINY_NCI, TinyType.TINY_ALC, TinyType.TINY_AXM, TinyType.TINY_SLC, TinyType.TINY_MAL, TinyType.TINY_PLH, TinyType.TINY_IPB, TinyType.TINY_LCL];
export type SendableTinyType = (typeof SENDABLE_TINY_TYPES)[number];
export type InfoRequestTinyType = (typeof INFO_REQUEST_TINY_TYPES)[number];