node-insim
Version:
An InSim library for NodeJS with TypeScript support
65 lines (64 loc) • 1.62 kB
JavaScript
import { __decorate } from "tslib";
import { byte, stringNull } from '../decorators';
import { Packet } from './base';
import { PacketType } from './enums';
/**
* New ConN
*/
export class IS_NCN extends Packet {
constructor() {
super(...arguments);
this.Size = 56;
this.Type = PacketType.ISP_NCN;
/** 0 unless this is a reply to a {@link TINY_NCN} */
this.ReqI = 0;
/** New connection's unique id (0 = host) */
this.UCID = 0;
/** Username */
this.UName = '';
/** Nickname */
this.PName = '';
/** 1 if admin */
this.Admin = 0;
/** Number of connections including host */
this.Total = 0;
/** Bit 2: remote */
this.Flags = 0;
this.Sp3 = 0;
}
}
__decorate([
byte()
], IS_NCN.prototype, "Size", void 0);
__decorate([
byte()
], IS_NCN.prototype, "Type", void 0);
__decorate([
byte()
], IS_NCN.prototype, "ReqI", void 0);
__decorate([
byte()
], IS_NCN.prototype, "UCID", void 0);
__decorate([
stringNull(24)
], IS_NCN.prototype, "UName", void 0);
__decorate([
stringNull(24)
], IS_NCN.prototype, "PName", void 0);
__decorate([
byte()
], IS_NCN.prototype, "Admin", void 0);
__decorate([
byte()
], IS_NCN.prototype, "Total", void 0);
__decorate([
byte()
], IS_NCN.prototype, "Flags", void 0);
__decorate([
byte()
], IS_NCN.prototype, "Sp3", void 0);
export var ConnectionFlags;
(function (ConnectionFlags) {
/** Remote */
ConnectionFlags[ConnectionFlags["REMOTE"] = 4] = "REMOTE";
})(ConnectionFlags || (ConnectionFlags = {}));