node-insim
Version:
An InSim library for NodeJS with TypeScript support
50 lines (49 loc) • 1.77 kB
JavaScript
import { __decorate } from "tslib";
import { byte, stringNull } from '../../decorators';
import { Struct } from '../base';
/** Sub packet for {@link IR_HOS}. Contains host information */
export class HInfo extends Struct {
constructor(data) {
super();
/** Name of the host */
this.HName = '';
/** Short track name */
this.Track = '';
/** Info flags about the host */
this.Flags = 0;
/** Number of people on the host */
this.NumConns = 0;
this.initialize(data);
}
}
__decorate([
stringNull(32)
], HInfo.prototype, "HName", void 0);
__decorate([
stringNull(6)
], HInfo.prototype, "Track", void 0);
__decorate([
byte()
], HInfo.prototype, "Flags", void 0);
__decorate([
byte()
], HInfo.prototype, "NumConns", void 0);
export var HostInfoFlags;
(function (HostInfoFlags) {
/** Host requires a spectator password */
HostInfoFlags[HostInfoFlags["HOS_SPECPASS"] = 1] = "HOS_SPECPASS";
/** Bit is set if host is licensed */
HostInfoFlags[HostInfoFlags["HOS_LICENSED"] = 2] = "HOS_LICENSED";
/** Bit is set if host is S1 */
HostInfoFlags[HostInfoFlags["HOS_S1"] = 4] = "HOS_S1";
/** Bit is set if host is S2 */
HostInfoFlags[HostInfoFlags["HOS_S2"] = 8] = "HOS_S2";
/** Bit is set if host is S3 */
HostInfoFlags[HostInfoFlags["HOS_S3"] = 16] = "HOS_S3";
/** Bit is set if host is Cruise */
HostInfoFlags[HostInfoFlags["HOS_CRUISE"] = 32] = "HOS_CRUISE";
/** Indicates the first host in the list */
HostInfoFlags[HostInfoFlags["HOS_FIRST"] = 64] = "HOS_FIRST";
/** Indicates the last host in the list */
HostInfoFlags[HostInfoFlags["HOS_LAST"] = 128] = "HOS_LAST";
})(HostInfoFlags || (HostInfoFlags = {}));