UNPKG

node-cs2

Version:

Modern CS2/CS:GO Game Coordinator integration with latest GameTracking-CS2 protobuf definitions. Includes support for highlight_reel, wrapped_sticker, variations, Promise-based API, crate opening, sticker/patch/keychain operations, and all modern CS2 fiel

1,032 lines (961 loc) 396 kB
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ (function(global, factory) { /* global define, require, module */ /* AMD */ if (typeof define === 'function' && define.amd) define(["protobufjs/minimal"], factory); /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) module.exports = factory(require("protobufjs/minimal")); })(this, function($protobuf) { "use strict"; // Common aliases var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); /** * ESteamNetworkingSocketsCipher enum. * @exports ESteamNetworkingSocketsCipher * @enum {number} * @property {number} k_ESteamNetworkingSocketsCipher_INVALID=0 k_ESteamNetworkingSocketsCipher_INVALID value * @property {number} k_ESteamNetworkingSocketsCipher_NULL=1 k_ESteamNetworkingSocketsCipher_NULL value * @property {number} k_ESteamNetworkingSocketsCipher_AES_256_GCM=2 k_ESteamNetworkingSocketsCipher_AES_256_GCM value */ $root.ESteamNetworkingSocketsCipher = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "k_ESteamNetworkingSocketsCipher_INVALID"] = 0; values[valuesById[1] = "k_ESteamNetworkingSocketsCipher_NULL"] = 1; values[valuesById[2] = "k_ESteamNetworkingSocketsCipher_AES_256_GCM"] = 2; return values; })(); $root.CMsgSteamDatagramSessionCryptInfo = (function() { /** * Properties of a CMsgSteamDatagramSessionCryptInfo. * @exports ICMsgSteamDatagramSessionCryptInfo * @interface ICMsgSteamDatagramSessionCryptInfo * @property {CMsgSteamDatagramSessionCryptInfo.EKeyType|null} [key_type] CMsgSteamDatagramSessionCryptInfo key_type * @property {Uint8Array|null} [key_data] CMsgSteamDatagramSessionCryptInfo key_data * @property {number|Long|null} [nonce] CMsgSteamDatagramSessionCryptInfo nonce * @property {number|null} [protocol_version] CMsgSteamDatagramSessionCryptInfo protocol_version * @property {Array.<ESteamNetworkingSocketsCipher>|null} [ciphers] CMsgSteamDatagramSessionCryptInfo ciphers */ /** * Constructs a new CMsgSteamDatagramSessionCryptInfo. * @exports CMsgSteamDatagramSessionCryptInfo * @classdesc Represents a CMsgSteamDatagramSessionCryptInfo. * @implements ICMsgSteamDatagramSessionCryptInfo * @constructor * @param {ICMsgSteamDatagramSessionCryptInfo=} [properties] Properties to set */ function CMsgSteamDatagramSessionCryptInfo(properties) { this.ciphers = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CMsgSteamDatagramSessionCryptInfo key_type. * @member {CMsgSteamDatagramSessionCryptInfo.EKeyType} key_type * @memberof CMsgSteamDatagramSessionCryptInfo * @instance */ CMsgSteamDatagramSessionCryptInfo.prototype.key_type = 0; /** * CMsgSteamDatagramSessionCryptInfo key_data. * @member {Uint8Array} key_data * @memberof CMsgSteamDatagramSessionCryptInfo * @instance */ CMsgSteamDatagramSessionCryptInfo.prototype.key_data = $util.newBuffer([]); /** * CMsgSteamDatagramSessionCryptInfo nonce. * @member {number|Long} nonce * @memberof CMsgSteamDatagramSessionCryptInfo * @instance */ CMsgSteamDatagramSessionCryptInfo.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * CMsgSteamDatagramSessionCryptInfo protocol_version. * @member {number} protocol_version * @memberof CMsgSteamDatagramSessionCryptInfo * @instance */ CMsgSteamDatagramSessionCryptInfo.prototype.protocol_version = 0; /** * CMsgSteamDatagramSessionCryptInfo ciphers. * @member {Array.<ESteamNetworkingSocketsCipher>} ciphers * @memberof CMsgSteamDatagramSessionCryptInfo * @instance */ CMsgSteamDatagramSessionCryptInfo.prototype.ciphers = $util.emptyArray; /** * Creates a new CMsgSteamDatagramSessionCryptInfo instance using the specified properties. * @function create * @memberof CMsgSteamDatagramSessionCryptInfo * @static * @param {ICMsgSteamDatagramSessionCryptInfo=} [properties] Properties to set * @returns {CMsgSteamDatagramSessionCryptInfo} CMsgSteamDatagramSessionCryptInfo instance */ CMsgSteamDatagramSessionCryptInfo.create = function create(properties) { return new CMsgSteamDatagramSessionCryptInfo(properties); }; /** * Encodes the specified CMsgSteamDatagramSessionCryptInfo message. Does not implicitly {@link CMsgSteamDatagramSessionCryptInfo.verify|verify} messages. * @function encode * @memberof CMsgSteamDatagramSessionCryptInfo * @static * @param {ICMsgSteamDatagramSessionCryptInfo} message CMsgSteamDatagramSessionCryptInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CMsgSteamDatagramSessionCryptInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.key_type != null && Object.hasOwnProperty.call(message, "key_type")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.key_type); if (message.key_data != null && Object.hasOwnProperty.call(message, "key_data")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.key_data); if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce")) writer.uint32(/* id 3, wireType 1 =*/25).fixed64(message.nonce); if (message.protocol_version != null && Object.hasOwnProperty.call(message, "protocol_version")) writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.protocol_version); if (message.ciphers != null && message.ciphers.length) for (var i = 0; i < message.ciphers.length; ++i) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ciphers[i]); return writer; }; /** * Encodes the specified CMsgSteamDatagramSessionCryptInfo message, length delimited. Does not implicitly {@link CMsgSteamDatagramSessionCryptInfo.verify|verify} messages. * @function encodeDelimited * @memberof CMsgSteamDatagramSessionCryptInfo * @static * @param {ICMsgSteamDatagramSessionCryptInfo} message CMsgSteamDatagramSessionCryptInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CMsgSteamDatagramSessionCryptInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CMsgSteamDatagramSessionCryptInfo message from the specified reader or buffer. * @function decode * @memberof CMsgSteamDatagramSessionCryptInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {CMsgSteamDatagramSessionCryptInfo} CMsgSteamDatagramSessionCryptInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CMsgSteamDatagramSessionCryptInfo.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgSteamDatagramSessionCryptInfo(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.key_type = reader.int32(); break; } case 2: { message.key_data = reader.bytes(); break; } case 3: { message.nonce = reader.fixed64(); break; } case 4: { message.protocol_version = reader.uint32(); break; } case 5: { if (!(message.ciphers && message.ciphers.length)) message.ciphers = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.ciphers.push(reader.int32()); } else message.ciphers.push(reader.int32()); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CMsgSteamDatagramSessionCryptInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof CMsgSteamDatagramSessionCryptInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {CMsgSteamDatagramSessionCryptInfo} CMsgSteamDatagramSessionCryptInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CMsgSteamDatagramSessionCryptInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CMsgSteamDatagramSessionCryptInfo message. * @function verify * @memberof CMsgSteamDatagramSessionCryptInfo * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CMsgSteamDatagramSessionCryptInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.key_type != null && message.hasOwnProperty("key_type")) switch (message.key_type) { default: return "key_type: enum value expected"; case 0: case 1: break; } if (message.key_data != null && message.hasOwnProperty("key_data")) if (!(message.key_data && typeof message.key_data.length === "number" || $util.isString(message.key_data))) return "key_data: buffer expected"; if (message.nonce != null && message.hasOwnProperty("nonce")) if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) return "nonce: integer|Long expected"; if (message.protocol_version != null && message.hasOwnProperty("protocol_version")) if (!$util.isInteger(message.protocol_version)) return "protocol_version: integer expected"; if (message.ciphers != null && message.hasOwnProperty("ciphers")) { if (!Array.isArray(message.ciphers)) return "ciphers: array expected"; for (var i = 0; i < message.ciphers.length; ++i) switch (message.ciphers[i]) { default: return "ciphers: enum value[] expected"; case 0: case 1: case 2: break; } } return null; }; /** * Creates a CMsgSteamDatagramSessionCryptInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof CMsgSteamDatagramSessionCryptInfo * @static * @param {Object.<string,*>} object Plain object * @returns {CMsgSteamDatagramSessionCryptInfo} CMsgSteamDatagramSessionCryptInfo */ CMsgSteamDatagramSessionCryptInfo.fromObject = function fromObject(object) { if (object instanceof $root.CMsgSteamDatagramSessionCryptInfo) return object; var message = new $root.CMsgSteamDatagramSessionCryptInfo(); switch (object.key_type) { default: if (typeof object.key_type === "number") { message.key_type = object.key_type; break; } break; case "INVALID": case 0: message.key_type = 0; break; case "CURVE25519": case 1: message.key_type = 1; break; } if (object.key_data != null) if (typeof object.key_data === "string") $util.base64.decode(object.key_data, message.key_data = $util.newBuffer($util.base64.length(object.key_data)), 0); else if (object.key_data.length >= 0) message.key_data = object.key_data; if (object.nonce != null) if ($util.Long) (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = false; else if (typeof object.nonce === "string") message.nonce = parseInt(object.nonce, 10); else if (typeof object.nonce === "number") message.nonce = object.nonce; else if (typeof object.nonce === "object") message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(); if (object.protocol_version != null) message.protocol_version = object.protocol_version >>> 0; if (object.ciphers) { if (!Array.isArray(object.ciphers)) throw TypeError(".CMsgSteamDatagramSessionCryptInfo.ciphers: array expected"); message.ciphers = []; for (var i = 0; i < object.ciphers.length; ++i) switch (object.ciphers[i]) { default: if (typeof object.ciphers[i] === "number") { message.ciphers[i] = object.ciphers[i]; break; } case "k_ESteamNetworkingSocketsCipher_INVALID": case 0: message.ciphers[i] = 0; break; case "k_ESteamNetworkingSocketsCipher_NULL": case 1: message.ciphers[i] = 1; break; case "k_ESteamNetworkingSocketsCipher_AES_256_GCM": case 2: message.ciphers[i] = 2; break; } } return message; }; /** * Creates a plain object from a CMsgSteamDatagramSessionCryptInfo message. Also converts values to other types if specified. * @function toObject * @memberof CMsgSteamDatagramSessionCryptInfo * @static * @param {CMsgSteamDatagramSessionCryptInfo} message CMsgSteamDatagramSessionCryptInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ CMsgSteamDatagramSessionCryptInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.ciphers = []; if (options.defaults) { object.key_type = options.enums === String ? "INVALID" : 0; if (options.bytes === String) object.key_data = ""; else { object.key_data = []; if (options.bytes !== Array) object.key_data = $util.newBuffer(object.key_data); } if ($util.Long) { var long = new $util.Long(0, 0, false); object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.nonce = options.longs === String ? "0" : 0; object.protocol_version = 0; } if (message.key_type != null && message.hasOwnProperty("key_type")) object.key_type = options.enums === String ? $root.CMsgSteamDatagramSessionCryptInfo.EKeyType[message.key_type] === undefined ? message.key_type : $root.CMsgSteamDatagramSessionCryptInfo.EKeyType[message.key_type] : message.key_type; if (message.key_data != null && message.hasOwnProperty("key_data")) object.key_data = options.bytes === String ? $util.base64.encode(message.key_data, 0, message.key_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.key_data) : message.key_data; if (message.nonce != null && message.hasOwnProperty("nonce")) if (typeof message.nonce === "number") object.nonce = options.longs === String ? String(message.nonce) : message.nonce; else object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber() : message.nonce; if (message.protocol_version != null && message.hasOwnProperty("protocol_version")) object.protocol_version = message.protocol_version; if (message.ciphers && message.ciphers.length) { object.ciphers = []; for (var j = 0; j < message.ciphers.length; ++j) object.ciphers[j] = options.enums === String ? $root.ESteamNetworkingSocketsCipher[message.ciphers[j]] === undefined ? message.ciphers[j] : $root.ESteamNetworkingSocketsCipher[message.ciphers[j]] : message.ciphers[j]; } return object; }; /** * Converts this CMsgSteamDatagramSessionCryptInfo to JSON. * @function toJSON * @memberof CMsgSteamDatagramSessionCryptInfo * @instance * @returns {Object.<string,*>} JSON object */ CMsgSteamDatagramSessionCryptInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for CMsgSteamDatagramSessionCryptInfo * @function getTypeUrl * @memberof CMsgSteamDatagramSessionCryptInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ CMsgSteamDatagramSessionCryptInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/CMsgSteamDatagramSessionCryptInfo"; }; /** * EKeyType enum. * @name CMsgSteamDatagramSessionCryptInfo.EKeyType * @enum {number} * @property {number} INVALID=0 INVALID value * @property {number} CURVE25519=1 CURVE25519 value */ CMsgSteamDatagramSessionCryptInfo.EKeyType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "INVALID"] = 0; values[valuesById[1] = "CURVE25519"] = 1; return values; })(); return CMsgSteamDatagramSessionCryptInfo; })(); $root.CMsgSteamDatagramSessionCryptInfoSigned = (function() { /** * Properties of a CMsgSteamDatagramSessionCryptInfoSigned. * @exports ICMsgSteamDatagramSessionCryptInfoSigned * @interface ICMsgSteamDatagramSessionCryptInfoSigned * @property {Uint8Array|null} [info] CMsgSteamDatagramSessionCryptInfoSigned info * @property {Uint8Array|null} [signature] CMsgSteamDatagramSessionCryptInfoSigned signature */ /** * Constructs a new CMsgSteamDatagramSessionCryptInfoSigned. * @exports CMsgSteamDatagramSessionCryptInfoSigned * @classdesc Represents a CMsgSteamDatagramSessionCryptInfoSigned. * @implements ICMsgSteamDatagramSessionCryptInfoSigned * @constructor * @param {ICMsgSteamDatagramSessionCryptInfoSigned=} [properties] Properties to set */ function CMsgSteamDatagramSessionCryptInfoSigned(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CMsgSteamDatagramSessionCryptInfoSigned info. * @member {Uint8Array} info * @memberof CMsgSteamDatagramSessionCryptInfoSigned * @instance */ CMsgSteamDatagramSessionCryptInfoSigned.prototype.info = $util.newBuffer([]); /** * CMsgSteamDatagramSessionCryptInfoSigned signature. * @member {Uint8Array} signature * @memberof CMsgSteamDatagramSessionCryptInfoSigned * @instance */ CMsgSteamDatagramSessionCryptInfoSigned.prototype.signature = $util.newBuffer([]); /** * Creates a new CMsgSteamDatagramSessionCryptInfoSigned instance using the specified properties. * @function create * @memberof CMsgSteamDatagramSessionCryptInfoSigned * @static * @param {ICMsgSteamDatagramSessionCryptInfoSigned=} [properties] Properties to set * @returns {CMsgSteamDatagramSessionCryptInfoSigned} CMsgSteamDatagramSessionCryptInfoSigned instance */ CMsgSteamDatagramSessionCryptInfoSigned.create = function create(properties) { return new CMsgSteamDatagramSessionCryptInfoSigned(properties); }; /** * Encodes the specified CMsgSteamDatagramSessionCryptInfoSigned message. Does not implicitly {@link CMsgSteamDatagramSessionCryptInfoSigned.verify|verify} messages. * @function encode * @memberof CMsgSteamDatagramSessionCryptInfoSigned * @static * @param {ICMsgSteamDatagramSessionCryptInfoSigned} message CMsgSteamDatagramSessionCryptInfoSigned message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CMsgSteamDatagramSessionCryptInfoSigned.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.info != null && Object.hasOwnProperty.call(message, "info")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.info); if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signature); return writer; }; /** * Encodes the specified CMsgSteamDatagramSessionCryptInfoSigned message, length delimited. Does not implicitly {@link CMsgSteamDatagramSessionCryptInfoSigned.verify|verify} messages. * @function encodeDelimited * @memberof CMsgSteamDatagramSessionCryptInfoSigned * @static * @param {ICMsgSteamDatagramSessionCryptInfoSigned} message CMsgSteamDatagramSessionCryptInfoSigned message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CMsgSteamDatagramSessionCryptInfoSigned.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CMsgSteamDatagramSessionCryptInfoSigned message from the specified reader or buffer. * @function decode * @memberof CMsgSteamDatagramSessionCryptInfoSigned * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {CMsgSteamDatagramSessionCryptInfoSigned} CMsgSteamDatagramSessionCryptInfoSigned * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CMsgSteamDatagramSessionCryptInfoSigned.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgSteamDatagramSessionCryptInfoSigned(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.info = reader.bytes(); break; } case 2: { message.signature = reader.bytes(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CMsgSteamDatagramSessionCryptInfoSigned message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof CMsgSteamDatagramSessionCryptInfoSigned * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {CMsgSteamDatagramSessionCryptInfoSigned} CMsgSteamDatagramSessionCryptInfoSigned * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CMsgSteamDatagramSessionCryptInfoSigned.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CMsgSteamDatagramSessionCryptInfoSigned message. * @function verify * @memberof CMsgSteamDatagramSessionCryptInfoSigned * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CMsgSteamDatagramSessionCryptInfoSigned.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.info != null && message.hasOwnProperty("info")) if (!(message.info && typeof message.info.length === "number" || $util.isString(message.info))) return "info: buffer expected"; if (message.signature != null && message.hasOwnProperty("signature")) if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) return "signature: buffer expected"; return null; }; /** * Creates a CMsgSteamDatagramSessionCryptInfoSigned message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof CMsgSteamDatagramSessionCryptInfoSigned * @static * @param {Object.<string,*>} object Plain object * @returns {CMsgSteamDatagramSessionCryptInfoSigned} CMsgSteamDatagramSessionCryptInfoSigned */ CMsgSteamDatagramSessionCryptInfoSigned.fromObject = function fromObject(object) { if (object instanceof $root.CMsgSteamDatagramSessionCryptInfoSigned) return object; var message = new $root.CMsgSteamDatagramSessionCryptInfoSigned(); if (object.info != null) if (typeof object.info === "string") $util.base64.decode(object.info, message.info = $util.newBuffer($util.base64.length(object.info)), 0); else if (object.info.length >= 0) message.info = object.info; if (object.signature != null) if (typeof object.signature === "string") $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); else if (object.signature.length >= 0) message.signature = object.signature; return message; }; /** * Creates a plain object from a CMsgSteamDatagramSessionCryptInfoSigned message. Also converts values to other types if specified. * @function toObject * @memberof CMsgSteamDatagramSessionCryptInfoSigned * @static * @param {CMsgSteamDatagramSessionCryptInfoSigned} message CMsgSteamDatagramSessionCryptInfoSigned * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ CMsgSteamDatagramSessionCryptInfoSigned.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { if (options.bytes === String) object.info = ""; else { object.info = []; if (options.bytes !== Array) object.info = $util.newBuffer(object.info); } if (options.bytes === String) object.signature = ""; else { object.signature = []; if (options.bytes !== Array) object.signature = $util.newBuffer(object.signature); } } if (message.info != null && message.hasOwnProperty("info")) object.info = options.bytes === String ? $util.base64.encode(message.info, 0, message.info.length) : options.bytes === Array ? Array.prototype.slice.call(message.info) : message.info; if (message.signature != null && message.hasOwnProperty("signature")) object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; return object; }; /** * Converts this CMsgSteamDatagramSessionCryptInfoSigned to JSON. * @function toJSON * @memberof CMsgSteamDatagramSessionCryptInfoSigned * @instance * @returns {Object.<string,*>} JSON object */ CMsgSteamDatagramSessionCryptInfoSigned.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for CMsgSteamDatagramSessionCryptInfoSigned * @function getTypeUrl * @memberof CMsgSteamDatagramSessionCryptInfoSigned * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ CMsgSteamDatagramSessionCryptInfoSigned.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/CMsgSteamDatagramSessionCryptInfoSigned"; }; return CMsgSteamDatagramSessionCryptInfoSigned; })(); $root.CMsgSteamDatagramDiagnostic = (function() { /** * Properties of a CMsgSteamDatagramDiagnostic. * @exports ICMsgSteamDatagramDiagnostic * @interface ICMsgSteamDatagramDiagnostic * @property {number|null} [severity] CMsgSteamDatagramDiagnostic severity * @property {string|null} [text] CMsgSteamDatagramDiagnostic text */ /** * Constructs a new CMsgSteamDatagramDiagnostic. * @exports CMsgSteamDatagramDiagnostic * @classdesc Represents a CMsgSteamDatagramDiagnostic. * @implements ICMsgSteamDatagramDiagnostic * @constructor * @param {ICMsgSteamDatagramDiagnostic=} [properties] Properties to set */ function CMsgSteamDatagramDiagnostic(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CMsgSteamDatagramDiagnostic severity. * @member {number} severity * @memberof CMsgSteamDatagramDiagnostic * @instance */ CMsgSteamDatagramDiagnostic.prototype.severity = 0; /** * CMsgSteamDatagramDiagnostic text. * @member {string} text * @memberof CMsgSteamDatagramDiagnostic * @instance */ CMsgSteamDatagramDiagnostic.prototype.text = ""; /** * Creates a new CMsgSteamDatagramDiagnostic instance using the specified properties. * @function create * @memberof CMsgSteamDatagramDiagnostic * @static * @param {ICMsgSteamDatagramDiagnostic=} [properties] Properties to set * @returns {CMsgSteamDatagramDiagnostic} CMsgSteamDatagramDiagnostic instance */ CMsgSteamDatagramDiagnostic.create = function create(properties) { return new CMsgSteamDatagramDiagnostic(properties); }; /** * Encodes the specified CMsgSteamDatagramDiagnostic message. Does not implicitly {@link CMsgSteamDatagramDiagnostic.verify|verify} messages. * @function encode * @memberof CMsgSteamDatagramDiagnostic * @static * @param {ICMsgSteamDatagramDiagnostic} message CMsgSteamDatagramDiagnostic message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CMsgSteamDatagramDiagnostic.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.severity); if (message.text != null && Object.hasOwnProperty.call(message, "text")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); return writer; }; /** * Encodes the specified CMsgSteamDatagramDiagnostic message, length delimited. Does not implicitly {@link CMsgSteamDatagramDiagnostic.verify|verify} messages. * @function encodeDelimited * @memberof CMsgSteamDatagramDiagnostic * @static * @param {ICMsgSteamDatagramDiagnostic} message CMsgSteamDatagramDiagnostic message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CMsgSteamDatagramDiagnostic.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CMsgSteamDatagramDiagnostic message from the specified reader or buffer. * @function decode * @memberof CMsgSteamDatagramDiagnostic * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {CMsgSteamDatagramDiagnostic} CMsgSteamDatagramDiagnostic * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CMsgSteamDatagramDiagnostic.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgSteamDatagramDiagnostic(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.severity = reader.uint32(); break; } case 2: { message.text = reader.string(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CMsgSteamDatagramDiagnostic message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof CMsgSteamDatagramDiagnostic * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {CMsgSteamDatagramDiagnostic} CMsgSteamDatagramDiagnostic * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CMsgSteamDatagramDiagnostic.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CMsgSteamDatagramDiagnostic message. * @function verify * @memberof CMsgSteamDatagramDiagnostic * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CMsgSteamDatagramDiagnostic.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.severity != null && message.hasOwnProperty("severity")) if (!$util.isInteger(message.severity)) return "severity: integer expected"; if (message.text != null && message.hasOwnProperty("text")) if (!$util.isString(message.text)) return "text: string expected"; return null; }; /** * Creates a CMsgSteamDatagramDiagnostic message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof CMsgSteamDatagramDiagnostic * @static * @param {Object.<string,*>} object Plain object * @returns {CMsgSteamDatagramDiagnostic} CMsgSteamDatagramDiagnostic */ CMsgSteamDatagramDiagnostic.fromObject = function fromObject(object) { if (object instanceof $root.CMsgSteamDatagramDiagnostic) return object; var message = new $root.CMsgSteamDatagramDiagnostic(); if (object.severity != null) message.severity = object.severity >>> 0; if (object.text != null) message.text = String(object.text); return message; }; /** * Creates a plain object from a CMsgSteamDatagramDiagnostic message. Also converts values to other types if specified. * @function toObject * @memberof CMsgSteamDatagramDiagnostic * @static * @param {CMsgSteamDatagramDiagnostic} message CMsgSteamDatagramDiagnostic * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ CMsgSteamDatagramDiagnostic.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.severity = 0; object.text = ""; } if (message.severity != null && message.hasOwnProperty("severity")) object.severity = message.severity; if (message.text != null && message.hasOwnProperty("text")) object.text = message.text; return object; }; /** * Converts this CMsgSteamDatagramDiagnostic to JSON. * @function toJSON * @memberof CMsgSteamDatagramDiagnostic * @instance * @returns {Object.<string,*>} JSON object */ CMsgSteamDatagramDiagnostic.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for CMsgSteamDatagramDiagnostic * @function getTypeUrl * @memberof CMsgSteamDatagramDiagnostic * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ CMsgSteamDatagramDiagnostic.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/CMsgSteamDatagramDiagnostic"; }; return CMsgSteamDatagramDiagnostic; })(); $root.CMsgSteamDatagramLinkInstantaneousStats = (function() { /** * Properties of a CMsgSteamDatagramLinkInstantaneousStats. * @exports ICMsgSteamDatagramLinkInstantaneousStats * @interface ICMsgSteamDatagramLinkInstantaneousStats * @property {number|null} [out_packets_per_sec_x10] CMsgSteamDatagramLinkInstantaneousStats out_packets_per_sec_x10 * @property {number|null} [out_bytes_per_sec] CMsgSteamDatagramLinkInstantaneousStats out_bytes_per_sec * @property {number|null} [in_packets_per_sec_x10] CMsgSteamDatagramLinkInstantaneousStats in_packets_per_sec_x10 * @property {number|null} [in_bytes_per_sec] CMsgSteamDatagramLinkInstantaneousStats in_bytes_per_sec * @property {number|null} [ping_ms] CMsgSteamDatagramLinkInstantaneousStats ping_ms * @property {number|null} [packets_dropped_pct] CMsgSteamDatagramLinkInstantaneousStats packets_dropped_pct * @property {number|null} [packets_weird_sequence_pct] CMsgSteamDatagramLinkInstantaneousStats packets_weird_sequence_pct * @property {number|null} [peak_jitter_usec] CMsgSteamDatagramLinkInstantaneousStats peak_jitter_usec */ /** * Constructs a new CMsgSteamDatagramLinkInstantaneousStats. * @exports CMsgSteamDatagramLinkInstantaneousStats * @classdesc Represents a CMsgSteamDatagramLinkInstantaneousStats. * @implements ICMsgSteamDatagramLinkInstantaneousStats * @constructor * @param {ICMsgSteamDatagramLinkInstantaneousStats=} [properties] Properties to set */ function CMsgSteamDatagramLinkInstantaneousStats(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CMsgSteamDatagramLinkInstantaneousStats out_packets_per_sec_x10. * @member {number} out_packets_per_sec_x10 * @memberof CMsgSteamDatagramLinkInstantaneousStats * @instance */ CMsgSteamDatagramLinkInstantaneousStats.prototype.out_packets_per_sec_x10 = 0; /** * CMsgSteamDatagramLinkInstantaneousStats out_bytes_per_sec. * @member {number} out_bytes_per_sec * @memberof CMsgSteamDatagramLinkInstantaneousStats * @instance */ CMsgSteamDatagramLinkInstantaneousStats.prototype.out_bytes_per_sec = 0; /** * CMsgSteamDatagramLinkInstantaneousStats in_packets_per_sec_x10. * @member {number} in_packets_per_sec_x10 * @memberof CMsgSteamDatagramLinkInstantaneousStats * @instance */ CMsgSteamDatagramLinkInstantaneousStats.prototype.in_packets_per_sec_x10 = 0; /** * CMsgSteamDatagramLinkInstantaneousStats in_bytes_per_sec. * @member {number} in_bytes_per_sec * @memberof CMsgSteamDatagramLinkInstantaneousStats * @instance */ CMsgSteamDatagramLinkInstantaneousStats.prototype.in_bytes_per_sec = 0; /** * CMsgSteamDatagramLinkInstantaneousStats ping_ms. * @member {number} ping_ms * @memberof CMsgSteamDatagramLinkInstantaneousStats * @instance */ CMsgSteamDatagramLinkInstantaneousStats.prototype.ping_ms = 0; /** * CMsgSteamDatagramLinkInstantaneousStats packets_dropped_pct. * @member {number} packets_dropped_pct * @memberof CMsgSteamDatagramLinkInstantaneousStats * @instance */ CMsgSteamDatagramLinkInstantaneousStats.prototype.packets_dropped_pct = 0; /** * CMsgSteamDatagramLinkInstantaneousStats packets_weird_sequence_pct. * @member {number} packets_weird_sequence_pct * @memberof CMsgSteamDatagramLinkInstantaneousStats * @instance */ CMsgSteamDatagramLinkInstantaneousStats.prototype.packets_weird_sequence_pct = 0; /** * CMsgSteamDatagramLinkInstantaneousStats peak_jitter_usec. * @member {number} peak_jitter_usec * @memberof CMsgSteamDatagramLinkInstantaneousStats * @instance */ CMsgSteamDatagramLinkInstantaneousStats.prototype.peak_jitter_usec = 0; /** * Creates a new CMsgSteamDatagramLinkInstantaneousStats instance using the specified properties. * @function create * @memberof CMsgSteamDatagramLinkInstantaneousStats * @static * @param {ICMsgSteamDatagramLinkInstantaneousStats=} [properties] Properties to set * @returns {CMsgSteamDatagramLinkInstantaneousStats} CMsgSteamDatagramLinkInstantaneousStats instance */ CMsgSteamDatagramLinkInstantaneousStats.create = function create(properties) { return new CMsgSteamDatagramLinkInstantaneousStats(properties); }; /** * Encodes the specified CMsgSteamDatagramLinkInstantaneousStats message. Does not implicitly {@link CMsgSteamDatagramLinkInstantaneousStats.verify|verify} messages. * @function encode * @memberof CMsgSteamDatagramLinkInstantaneousStats * @static * @param {ICMsgSteamDatagramLinkInstantaneousStats} message CMsgSteamDatagramLinkInstantaneousStats message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CMsgSteamDatagramLinkInstantaneousStats.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.out_packets_per_sec_x10 != null && Object.hasOwnProperty.call(message, "out_packets_per_sec_x10")) writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.out_packets_per_sec_x10); if (message.out_bytes_per_sec