node-insim
Version:
An InSim library for NodeJS with TypeScript support
72 lines (71 loc) • 2.13 kB
JavaScript
import { __decorate } from "tslib";
import { byte } from '../decorators';
import { Packet } from './base';
import { PacketType } from './enums';
/**
* ConN Leave
*/
export class IS_CNL extends Packet {
constructor() {
super(...arguments);
this.Size = 8;
this.Type = PacketType.ISP_CNL;
/** 0 */
this.ReqI = 0;
/** Unique id of the connection which left */
this.UCID = 0;
/** Leave reason (see below) */
this.Reason = 0;
/** Number of connections including host */
this.Total = 0;
this.Sp2 = 0;
this.Sp3 = 0;
}
}
__decorate([
byte()
], IS_CNL.prototype, "Size", void 0);
__decorate([
byte()
], IS_CNL.prototype, "Type", void 0);
__decorate([
byte()
], IS_CNL.prototype, "ReqI", void 0);
__decorate([
byte()
], IS_CNL.prototype, "UCID", void 0);
__decorate([
byte()
], IS_CNL.prototype, "Reason", void 0);
__decorate([
byte()
], IS_CNL.prototype, "Total", void 0);
__decorate([
byte()
], IS_CNL.prototype, "Sp2", void 0);
__decorate([
byte()
], IS_CNL.prototype, "Sp3", void 0);
export var LeaveReason;
(function (LeaveReason) {
/** None */
LeaveReason[LeaveReason["LEAVR_DISCO"] = 0] = "LEAVR_DISCO";
/** Timed out */
LeaveReason[LeaveReason["LEAVR_TIMEOUT"] = 1] = "LEAVR_TIMEOUT";
/** Lost connection */
LeaveReason[LeaveReason["LEAVR_LOSTCONN"] = 2] = "LEAVR_LOSTCONN";
/** Kicked */
LeaveReason[LeaveReason["LEAVR_KICKED"] = 3] = "LEAVR_KICKED";
/** Banned */
LeaveReason[LeaveReason["LEAVR_BANNED"] = 4] = "LEAVR_BANNED";
/** Security */
LeaveReason[LeaveReason["LEAVR_SECURITY"] = 5] = "LEAVR_SECURITY";
/** Cheat protection warning */
LeaveReason[LeaveReason["LEAVR_CPW"] = 6] = "LEAVR_CPW";
/** Out of sync with host */
LeaveReason[LeaveReason["LEAVR_OOS"] = 7] = "LEAVR_OOS";
/** Join OOS (initial sync failed) */
LeaveReason[LeaveReason["LEAVR_JOOS"] = 8] = "LEAVR_JOOS";
/** Invalid packet */
LeaveReason[LeaveReason["LEAVR_HACK"] = 9] = "LEAVR_HACK";
})(LeaveReason || (LeaveReason = {}));