UNPKG

node-insim

Version:

An InSim library for NodeJS with TypeScript support

71 lines (70 loc) 2.25 kB
import { __decorate } from "tslib"; import { byte } from '../decorators'; import { Packet } from './base'; import { PacketType } from './enums'; /** * PENalty (given or cleared) * * On false start or wrong route / restricted area, an IS_PEN packet is sent: * * - False start: OldPen = 0 / NewPen = {@link PENALTY_30} / Reason = {@link PENR_FALSE_START} * - Wrong route: OldPen = 0 / NewPen = {@link PENALTY_45} / Reason = {@link PENR_WRONG_WAY} */ export class IS_PEN extends Packet { constructor() { super(...arguments); this.Size = 8; this.Type = PacketType.ISP_PEN; this.ReqI = 0; /** Player's unique id */ this.PLID = 0; /** Old penalty value */ this.OldPen = 0; /** New penalty value */ this.NewPen = 0; /** Penalty reason */ this.Reason = 0; this.Sp3 = 0; } } __decorate([ byte() ], IS_PEN.prototype, "Size", void 0); __decorate([ byte() ], IS_PEN.prototype, "Type", void 0); __decorate([ byte() ], IS_PEN.prototype, "ReqI", void 0); __decorate([ byte() ], IS_PEN.prototype, "PLID", void 0); __decorate([ byte() ], IS_PEN.prototype, "OldPen", void 0); __decorate([ byte() ], IS_PEN.prototype, "NewPen", void 0); __decorate([ byte() ], IS_PEN.prototype, "Reason", void 0); __decorate([ byte() ], IS_PEN.prototype, "Sp3", void 0); export var PenaltyReason; (function (PenaltyReason) { /** Unknown or cleared penalty */ PenaltyReason[PenaltyReason["PENR_UNKNOWN"] = 0] = "PENR_UNKNOWN"; /** Penalty given by admin */ PenaltyReason[PenaltyReason["PENR_ADMIN"] = 1] = "PENR_ADMIN"; /** Wrong way driving */ PenaltyReason[PenaltyReason["PENR_WRONG_WAY"] = 2] = "PENR_WRONG_WAY"; /** Starting before green light */ PenaltyReason[PenaltyReason["PENR_FALSE_START"] = 3] = "PENR_FALSE_START"; /** Speeding in pit lane */ PenaltyReason[PenaltyReason["PENR_SPEEDING"] = 4] = "PENR_SPEEDING"; /** Stop-go pit stop too short */ PenaltyReason[PenaltyReason["PENR_STOP_SHORT"] = 5] = "PENR_STOP_SHORT"; /** Compulsory stop is too late */ PenaltyReason[PenaltyReason["PENR_STOP_LATE"] = 6] = "PENR_STOP_LATE"; })(PenaltyReason || (PenaltyReason = {}));