node-insim
Version:
An InSim library for NodeJS with TypeScript support
53 lines (52 loc) • 1.44 kB
JavaScript
import { __decorate } from "tslib";
import { byte, stringNull } from '../decorators';
import { Packet } from './base';
import { PacketType } from './enums';
/**
* Version request
*
* It is advisable to request version information as soon as you have connected, to
* avoid problems when connecting to a host with a later or earlier version. You will
* be sent a version packet on connection if you set ReqI in the {@link IS_ISI} packet.
*/
export class IS_VER extends Packet {
constructor() {
super(...arguments);
this.Size = 20;
this.Type = PacketType.ISP_VER;
/** ReqI as received in the request packet */
this.ReqI = 0;
this.Zero = 0;
/** LFS version, e.g. 0.3G */
this.Version = '';
/** Product: DEMO / S1 / S2 / S3 */
this.Product = '';
/** InSim version */
this.InSimVer = 0;
this.Spare = 0;
}
}
__decorate([
byte()
], IS_VER.prototype, "Size", void 0);
__decorate([
byte()
], IS_VER.prototype, "Type", void 0);
__decorate([
byte()
], IS_VER.prototype, "ReqI", void 0);
__decorate([
byte()
], IS_VER.prototype, "Zero", void 0);
__decorate([
stringNull(8)
], IS_VER.prototype, "Version", void 0);
__decorate([
stringNull(6)
], IS_VER.prototype, "Product", void 0);
__decorate([
byte()
], IS_VER.prototype, "InSimVer", void 0);
__decorate([
byte()
], IS_VER.prototype, "Spare", void 0);