node-insim
Version:
An InSim library for NodeJS with TypeScript support
77 lines (76 loc) • 3.48 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.HostInfoFlags = exports.HInfo = void 0;
var decorators_1 = require("../../decorators");
var base_1 = require("../base");
/** Sub packet for {@link IR_HOS}. Contains host information */
var HInfo = /** @class */ (function (_super) {
__extends(HInfo, _super);
function HInfo(data) {
var _this = _super.call(this) || this;
/** 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);
return _this;
}
__decorate([
(0, decorators_1.stringNull)(32)
], HInfo.prototype, "HName", void 0);
__decorate([
(0, decorators_1.stringNull)(6)
], HInfo.prototype, "Track", void 0);
__decorate([
(0, decorators_1.byte)()
], HInfo.prototype, "Flags", void 0);
__decorate([
(0, decorators_1.byte)()
], HInfo.prototype, "NumConns", void 0);
return HInfo;
}(base_1.Struct));
exports.HInfo = HInfo;
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 || (exports.HostInfoFlags = HostInfoFlags = {}));