steam-condenser
Version:
TypeScript port of steam-condenser.
61 lines • 3.09 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 S2AInfoBasePacket_1 = __importDefault(require("./S2AInfoBasePacket"));
var SteamPacket_1 = __importDefault(require("./SteamPacket"));
var S2AInfoDetailedPacket = /** @class */ (function (_super) {
__extends(S2AInfoDetailedPacket, _super);
function S2AInfoDetailedPacket(contentData) {
var _this = _super.call(this, SteamPacket_1.default.S2A_INFO_DETAILED_HEADER, contentData) || this;
_this.info.serverIp = _this.contentData.getString();
_this.info.serverName = _this.contentData.getString();
_this.info.mapName = _this.contentData.getString();
_this.info.gameDir = _this.contentData.getString();
_this.info.gameDesc = _this.contentData.getString();
_this.info.numberOfPlayers = _this.contentData.getByte();
_this.info.maxPlayers = _this.contentData.getByte();
_this.info.networkVersion = _this.contentData.getByte();
_this.info.dedicated = String.fromCharCode(_this.contentData.getByte());
_this.info.operatingSystem = String.fromCharCode(_this.contentData.getByte());
_this.info.passwordProtected = _this.contentData.getByte() === 1;
var isMod = _this.contentData.getByte() === 1;
_this.info.isMod = isMod;
if (isMod) {
var modInfo = {};
modInfo.urlInfo = _this.contentData.getString();
modInfo.urlDl = _this.contentData.getString();
if (_this.contentData.remaining() === 12) {
modInfo.modVersion = _this.contentData.getShort();
modInfo.modSize = _this.contentData.getShort();
modInfo.svOnly = _this.contentData.getByte() === 1;
modInfo.clDll = _this.contentData.getByte() === 1;
_this.info.secureServer = _this.contentData.getByte() === 1;
_this.info.botNumber = _this.contentData.getByte();
}
_this.info.modInfo = modInfo;
}
else {
_this.info.secureServer = _this.contentData.getByte() === 1;
_this.info.botNumber = _this.contentData.getByte();
}
return _this;
}
return S2AInfoDetailedPacket;
}(S2AInfoBasePacket_1.default));
exports.default = S2AInfoDetailedPacket;
//# sourceMappingURL=S2AInfoDetailedPacket.js.map