steam-condenser
Version:
TypeScript port of steam-condenser.
46 lines • 1.87 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 (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var SteamPacket_1 = __importDefault(require("./SteamPacket"));
var S2ARulesPacket = /** @class */ (function (_super) {
__extends(S2ARulesPacket, _super);
function S2ARulesPacket(contentData) {
var _this = _super.call(this, SteamPacket_1.default.S2C_CHALLENGE_HEADER, contentData) || this;
_this.rules = {};
if (typeof contentData === 'undefined') {
throw new Error('Wrong formatted S2A_RULES packet.');
}
var rulesCount = _this.contentData.getShort();
_this.rules = {};
for (var x = 0; x < rulesCount; x += 1) {
var rule = _this.contentData.getString();
var value = _this.contentData.getString();
if (rule === '') {
// break;
}
_this.rules[rule] = value;
}
return _this;
}
S2ARulesPacket.prototype.getRulesArray = function () {
return this.rules;
};
return S2ARulesPacket;
}(SteamPacket_1.default));
exports.default = S2ARulesPacket;
//# sourceMappingURL=S2ARulesPacket.js.map