node-insim
Version:
An InSim library for NodeJS with TypeScript support
53 lines (52 loc) • 1.57 kB
JavaScript
import { __decorate } from "tslib";
import { byte, stringNull } from '../decorators';
import { SendablePacket } from './base';
import { PacketType } from './enums';
/**
* Relay select - packet to select a host, so relay starts sending you data.
*/
export class IR_SEL extends SendablePacket {
constructor(data) {
super();
this.SIZE_MULTIPLIER = 1;
this.Size = 68;
this.Type = PacketType.IRP_SEL;
/** If non-zero Relay will reply with an {@link IS_VER} packet */
this.ReqI = 0;
this.Zero = 0;
/** Hostname to receive data from - may be colour code stripped */
this.HName = '';
/** Admin password (to gain admin access to host) */
this.Admin = '';
/** Spectator password (if host requires it) */
this.Spec = '';
this.initialize(data);
}
}
__decorate([
byte()
], IR_SEL.prototype, "Size", void 0);
__decorate([
byte()
], IR_SEL.prototype, "Type", void 0);
__decorate([
byte()
], IR_SEL.prototype, "ReqI", void 0);
__decorate([
byte()
], IR_SEL.prototype, "Zero", void 0);
__decorate([
stringNull(32)
], IR_SEL.prototype, "HName", void 0);
__decorate([
stringNull(16)
], IR_SEL.prototype, "Admin", void 0);
__decorate([
stringNull(16)
], IR_SEL.prototype, "Spec", void 0);
export var IR_SEL_ReqI;
(function (IR_SEL_ReqI) {
IR_SEL_ReqI[IR_SEL_ReqI["ZERO"] = 0] = "ZERO";
/** Send back an {@link IS_VER} packet */
IR_SEL_ReqI[IR_SEL_ReqI["SEND_VERSION"] = 1] = "SEND_VERSION";
})(IR_SEL_ReqI || (IR_SEL_ReqI = {}));