node-insim
Version:
An InSim library for NodeJS with TypeScript support
99 lines (98 loc) • 3.35 kB
JavaScript
import { __decorate } from "tslib";
import { byte, string, stringNull, word } from '../decorators';
import { SendablePacket } from './base';
import { PacketType } from './enums';
/**
* InSim Init - packet to initialise the InSim system
*/
export class IS_ISI extends SendablePacket {
constructor(data) {
super();
this.Size = 44;
this.Type = PacketType.ISP_ISI;
/** If non-zero LFS will send an {@link IS_VER} packet */
this.ReqI = 0;
this.Zero = 0;
/** Port for UDP replies from LFS (0 to 65535) */
this.UDPPort = 0;
/** Bit flags for options */
this.Flags = 0;
/** The INSIM_VERSION used by your program */
this.InSimVer = 0;
/** Special host message prefix character */
this.Prefix = '';
/** Time in ms between {@link IS_NLP} or {@link IS_MCI} (0 = none) */
this.Interval = 0;
/** Admin password (if set in LFS) */
this.Admin = '';
/** A short name for your program */
this.IName = '';
this.initialize(data);
}
}
__decorate([
byte()
], IS_ISI.prototype, "Size", void 0);
__decorate([
byte()
], IS_ISI.prototype, "Type", void 0);
__decorate([
byte()
], IS_ISI.prototype, "ReqI", void 0);
__decorate([
byte()
], IS_ISI.prototype, "Zero", void 0);
__decorate([
word()
], IS_ISI.prototype, "UDPPort", void 0);
__decorate([
word()
], IS_ISI.prototype, "Flags", void 0);
__decorate([
byte()
], IS_ISI.prototype, "InSimVer", void 0);
__decorate([
string(1)
], IS_ISI.prototype, "Prefix", void 0);
__decorate([
word()
], IS_ISI.prototype, "Interval", void 0);
__decorate([
stringNull(16)
], IS_ISI.prototype, "Admin", void 0);
__decorate([
stringNull(16)
], IS_ISI.prototype, "IName", void 0);
export var IS_ISI_ReqI;
(function (IS_ISI_ReqI) {
IS_ISI_ReqI[IS_ISI_ReqI["ZERO"] = 0] = "ZERO";
/** Send back an {@link IS_VER} packet */
IS_ISI_ReqI[IS_ISI_ReqI["SEND_VERSION"] = 1] = "SEND_VERSION";
})(IS_ISI_ReqI || (IS_ISI_ReqI = {}));
export var InSimFlags;
(function (InSimFlags) {
/** Spare */
InSimFlags[InSimFlags["ISF_RES_0"] = 1] = "ISF_RES_0";
/** Spare */
InSimFlags[InSimFlags["ISF_RES_1"] = 2] = "ISF_RES_1";
/** Guest or single player */
InSimFlags[InSimFlags["ISF_LOCAL"] = 4] = "ISF_LOCAL";
/** Keep colours in {@link IS_MSO} text */
InSimFlags[InSimFlags["ISF_MSO_COLS"] = 8] = "ISF_MSO_COLS";
/** Receive {@link IS_NLP} packets */
InSimFlags[InSimFlags["ISF_NLP"] = 16] = "ISF_NLP";
/** Receive {@link IS_MCI} packets */
InSimFlags[InSimFlags["ISF_MCI"] = 32] = "ISF_MCI";
/** Receive {@link IS_CON} packets */
InSimFlags[InSimFlags["ISF_CON"] = 64] = "ISF_CON";
/** Receive {@link IS_OBH} packets */
InSimFlags[InSimFlags["ISF_OBH"] = 128] = "ISF_OBH";
/** Receive {@link IS_HLV} packets */
InSimFlags[InSimFlags["ISF_HLV"] = 256] = "ISF_HLV";
/** Receive {@link IS_AXM} when loading a layout */
InSimFlags[InSimFlags["ISF_AXM_LOAD"] = 512] = "ISF_AXM_LOAD";
/** Receive {@link IS_AXM} when changing objects */
InSimFlags[InSimFlags["ISF_AXM_EDIT"] = 1024] = "ISF_AXM_EDIT";
/** Process join requests */
InSimFlags[InSimFlags["ISF_REQ_JOIN"] = 2048] = "ISF_REQ_JOIN";
})(InSimFlags || (InSimFlags = {}));