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
933 lines (871 loc) • 516 kB
JavaScript
/*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"] = {});
/**
* ESteamNetworkingUDPMsgID enum.
* @exports ESteamNetworkingUDPMsgID
* @enum {number}
* @property {number} k_ESteamNetworkingUDPMsg_ChallengeRequest=32 k_ESteamNetworkingUDPMsg_ChallengeRequest value
* @property {number} k_ESteamNetworkingUDPMsg_ChallengeReply=33 k_ESteamNetworkingUDPMsg_ChallengeReply value
* @property {number} k_ESteamNetworkingUDPMsg_ConnectRequest=34 k_ESteamNetworkingUDPMsg_ConnectRequest value
* @property {number} k_ESteamNetworkingUDPMsg_ConnectOK=35 k_ESteamNetworkingUDPMsg_ConnectOK value
* @property {number} k_ESteamNetworkingUDPMsg_ConnectionClosed=36 k_ESteamNetworkingUDPMsg_ConnectionClosed value
* @property {number} k_ESteamNetworkingUDPMsg_NoConnection=37 k_ESteamNetworkingUDPMsg_NoConnection value
*/
$root.ESteamNetworkingUDPMsgID = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[32] = "k_ESteamNetworkingUDPMsg_ChallengeRequest"] = 32;
values[valuesById[33] = "k_ESteamNetworkingUDPMsg_ChallengeReply"] = 33;
values[valuesById[34] = "k_ESteamNetworkingUDPMsg_ConnectRequest"] = 34;
values[valuesById[35] = "k_ESteamNetworkingUDPMsg_ConnectOK"] = 35;
values[valuesById[36] = "k_ESteamNetworkingUDPMsg_ConnectionClosed"] = 36;
values[valuesById[37] = "k_ESteamNetworkingUDPMsg_NoConnection"] = 37;
return values;
})();
$root.CMsgSteamSockets_UDP_ChallengeRequest = (function() {
/**
* Properties of a CMsgSteamSockets_UDP_ChallengeRequest.
* @exports ICMsgSteamSockets_UDP_ChallengeRequest
* @interface ICMsgSteamSockets_UDP_ChallengeRequest
* @property {number|null} [connection_id] CMsgSteamSockets_UDP_ChallengeRequest connection_id
* @property {number|Long|null} [my_timestamp] CMsgSteamSockets_UDP_ChallengeRequest my_timestamp
* @property {number|null} [protocol_version] CMsgSteamSockets_UDP_ChallengeRequest protocol_version
*/
/**
* Constructs a new CMsgSteamSockets_UDP_ChallengeRequest.
* @exports CMsgSteamSockets_UDP_ChallengeRequest
* @classdesc Represents a CMsgSteamSockets_UDP_ChallengeRequest.
* @implements ICMsgSteamSockets_UDP_ChallengeRequest
* @constructor
* @param {ICMsgSteamSockets_UDP_ChallengeRequest=} [properties] Properties to set
*/
function CMsgSteamSockets_UDP_ChallengeRequest(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]];
}
/**
* CMsgSteamSockets_UDP_ChallengeRequest connection_id.
* @member {number} connection_id
* @memberof CMsgSteamSockets_UDP_ChallengeRequest
* @instance
*/
CMsgSteamSockets_UDP_ChallengeRequest.prototype.connection_id = 0;
/**
* CMsgSteamSockets_UDP_ChallengeRequest my_timestamp.
* @member {number|Long} my_timestamp
* @memberof CMsgSteamSockets_UDP_ChallengeRequest
* @instance
*/
CMsgSteamSockets_UDP_ChallengeRequest.prototype.my_timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* CMsgSteamSockets_UDP_ChallengeRequest protocol_version.
* @member {number} protocol_version
* @memberof CMsgSteamSockets_UDP_ChallengeRequest
* @instance
*/
CMsgSteamSockets_UDP_ChallengeRequest.prototype.protocol_version = 0;
/**
* Creates a new CMsgSteamSockets_UDP_ChallengeRequest instance using the specified properties.
* @function create
* @memberof CMsgSteamSockets_UDP_ChallengeRequest
* @static
* @param {ICMsgSteamSockets_UDP_ChallengeRequest=} [properties] Properties to set
* @returns {CMsgSteamSockets_UDP_ChallengeRequest} CMsgSteamSockets_UDP_ChallengeRequest instance
*/
CMsgSteamSockets_UDP_ChallengeRequest.create = function create(properties) {
return new CMsgSteamSockets_UDP_ChallengeRequest(properties);
};
/**
* Encodes the specified CMsgSteamSockets_UDP_ChallengeRequest message. Does not implicitly {@link CMsgSteamSockets_UDP_ChallengeRequest.verify|verify} messages.
* @function encode
* @memberof CMsgSteamSockets_UDP_ChallengeRequest
* @static
* @param {ICMsgSteamSockets_UDP_ChallengeRequest} message CMsgSteamSockets_UDP_ChallengeRequest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgSteamSockets_UDP_ChallengeRequest.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id"))
writer.uint32(/* id 1, wireType 5 =*/13).fixed32(message.connection_id);
if (message.my_timestamp != null && Object.hasOwnProperty.call(message, "my_timestamp"))
writer.uint32(/* id 3, wireType 1 =*/25).fixed64(message.my_timestamp);
if (message.protocol_version != null && Object.hasOwnProperty.call(message, "protocol_version"))
writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.protocol_version);
return writer;
};
/**
* Encodes the specified CMsgSteamSockets_UDP_ChallengeRequest message, length delimited. Does not implicitly {@link CMsgSteamSockets_UDP_ChallengeRequest.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgSteamSockets_UDP_ChallengeRequest
* @static
* @param {ICMsgSteamSockets_UDP_ChallengeRequest} message CMsgSteamSockets_UDP_ChallengeRequest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgSteamSockets_UDP_ChallengeRequest.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgSteamSockets_UDP_ChallengeRequest message from the specified reader or buffer.
* @function decode
* @memberof CMsgSteamSockets_UDP_ChallengeRequest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgSteamSockets_UDP_ChallengeRequest} CMsgSteamSockets_UDP_ChallengeRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgSteamSockets_UDP_ChallengeRequest.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.CMsgSteamSockets_UDP_ChallengeRequest();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.connection_id = reader.fixed32();
break;
}
case 3: {
message.my_timestamp = reader.fixed64();
break;
}
case 4: {
message.protocol_version = reader.uint32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgSteamSockets_UDP_ChallengeRequest message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgSteamSockets_UDP_ChallengeRequest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgSteamSockets_UDP_ChallengeRequest} CMsgSteamSockets_UDP_ChallengeRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgSteamSockets_UDP_ChallengeRequest.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgSteamSockets_UDP_ChallengeRequest message.
* @function verify
* @memberof CMsgSteamSockets_UDP_ChallengeRequest
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgSteamSockets_UDP_ChallengeRequest.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.connection_id != null && message.hasOwnProperty("connection_id"))
if (!$util.isInteger(message.connection_id))
return "connection_id: integer expected";
if (message.my_timestamp != null && message.hasOwnProperty("my_timestamp"))
if (!$util.isInteger(message.my_timestamp) && !(message.my_timestamp && $util.isInteger(message.my_timestamp.low) && $util.isInteger(message.my_timestamp.high)))
return "my_timestamp: integer|Long expected";
if (message.protocol_version != null && message.hasOwnProperty("protocol_version"))
if (!$util.isInteger(message.protocol_version))
return "protocol_version: integer expected";
return null;
};
/**
* Creates a CMsgSteamSockets_UDP_ChallengeRequest message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgSteamSockets_UDP_ChallengeRequest
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgSteamSockets_UDP_ChallengeRequest} CMsgSteamSockets_UDP_ChallengeRequest
*/
CMsgSteamSockets_UDP_ChallengeRequest.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgSteamSockets_UDP_ChallengeRequest)
return object;
var message = new $root.CMsgSteamSockets_UDP_ChallengeRequest();
if (object.connection_id != null)
message.connection_id = object.connection_id >>> 0;
if (object.my_timestamp != null)
if ($util.Long)
(message.my_timestamp = $util.Long.fromValue(object.my_timestamp)).unsigned = false;
else if (typeof object.my_timestamp === "string")
message.my_timestamp = parseInt(object.my_timestamp, 10);
else if (typeof object.my_timestamp === "number")
message.my_timestamp = object.my_timestamp;
else if (typeof object.my_timestamp === "object")
message.my_timestamp = new $util.LongBits(object.my_timestamp.low >>> 0, object.my_timestamp.high >>> 0).toNumber();
if (object.protocol_version != null)
message.protocol_version = object.protocol_version >>> 0;
return message;
};
/**
* Creates a plain object from a CMsgSteamSockets_UDP_ChallengeRequest message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgSteamSockets_UDP_ChallengeRequest
* @static
* @param {CMsgSteamSockets_UDP_ChallengeRequest} message CMsgSteamSockets_UDP_ChallengeRequest
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgSteamSockets_UDP_ChallengeRequest.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.connection_id = 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.my_timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.my_timestamp = options.longs === String ? "0" : 0;
object.protocol_version = 0;
}
if (message.connection_id != null && message.hasOwnProperty("connection_id"))
object.connection_id = message.connection_id;
if (message.my_timestamp != null && message.hasOwnProperty("my_timestamp"))
if (typeof message.my_timestamp === "number")
object.my_timestamp = options.longs === String ? String(message.my_timestamp) : message.my_timestamp;
else
object.my_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.my_timestamp) : options.longs === Number ? new $util.LongBits(message.my_timestamp.low >>> 0, message.my_timestamp.high >>> 0).toNumber() : message.my_timestamp;
if (message.protocol_version != null && message.hasOwnProperty("protocol_version"))
object.protocol_version = message.protocol_version;
return object;
};
/**
* Converts this CMsgSteamSockets_UDP_ChallengeRequest to JSON.
* @function toJSON
* @memberof CMsgSteamSockets_UDP_ChallengeRequest
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgSteamSockets_UDP_ChallengeRequest.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CMsgSteamSockets_UDP_ChallengeRequest
* @function getTypeUrl
* @memberof CMsgSteamSockets_UDP_ChallengeRequest
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CMsgSteamSockets_UDP_ChallengeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/CMsgSteamSockets_UDP_ChallengeRequest";
};
return CMsgSteamSockets_UDP_ChallengeRequest;
})();
$root.CMsgSteamSockets_UDP_ChallengeReply = (function() {
/**
* Properties of a CMsgSteamSockets_UDP_ChallengeReply.
* @exports ICMsgSteamSockets_UDP_ChallengeReply
* @interface ICMsgSteamSockets_UDP_ChallengeReply
* @property {number|null} [connection_id] CMsgSteamSockets_UDP_ChallengeReply connection_id
* @property {number|Long|null} [challenge] CMsgSteamSockets_UDP_ChallengeReply challenge
* @property {number|Long|null} [your_timestamp] CMsgSteamSockets_UDP_ChallengeReply your_timestamp
* @property {number|null} [protocol_version] CMsgSteamSockets_UDP_ChallengeReply protocol_version
*/
/**
* Constructs a new CMsgSteamSockets_UDP_ChallengeReply.
* @exports CMsgSteamSockets_UDP_ChallengeReply
* @classdesc Represents a CMsgSteamSockets_UDP_ChallengeReply.
* @implements ICMsgSteamSockets_UDP_ChallengeReply
* @constructor
* @param {ICMsgSteamSockets_UDP_ChallengeReply=} [properties] Properties to set
*/
function CMsgSteamSockets_UDP_ChallengeReply(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]];
}
/**
* CMsgSteamSockets_UDP_ChallengeReply connection_id.
* @member {number} connection_id
* @memberof CMsgSteamSockets_UDP_ChallengeReply
* @instance
*/
CMsgSteamSockets_UDP_ChallengeReply.prototype.connection_id = 0;
/**
* CMsgSteamSockets_UDP_ChallengeReply challenge.
* @member {number|Long} challenge
* @memberof CMsgSteamSockets_UDP_ChallengeReply
* @instance
*/
CMsgSteamSockets_UDP_ChallengeReply.prototype.challenge = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* CMsgSteamSockets_UDP_ChallengeReply your_timestamp.
* @member {number|Long} your_timestamp
* @memberof CMsgSteamSockets_UDP_ChallengeReply
* @instance
*/
CMsgSteamSockets_UDP_ChallengeReply.prototype.your_timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* CMsgSteamSockets_UDP_ChallengeReply protocol_version.
* @member {number} protocol_version
* @memberof CMsgSteamSockets_UDP_ChallengeReply
* @instance
*/
CMsgSteamSockets_UDP_ChallengeReply.prototype.protocol_version = 0;
/**
* Creates a new CMsgSteamSockets_UDP_ChallengeReply instance using the specified properties.
* @function create
* @memberof CMsgSteamSockets_UDP_ChallengeReply
* @static
* @param {ICMsgSteamSockets_UDP_ChallengeReply=} [properties] Properties to set
* @returns {CMsgSteamSockets_UDP_ChallengeReply} CMsgSteamSockets_UDP_ChallengeReply instance
*/
CMsgSteamSockets_UDP_ChallengeReply.create = function create(properties) {
return new CMsgSteamSockets_UDP_ChallengeReply(properties);
};
/**
* Encodes the specified CMsgSteamSockets_UDP_ChallengeReply message. Does not implicitly {@link CMsgSteamSockets_UDP_ChallengeReply.verify|verify} messages.
* @function encode
* @memberof CMsgSteamSockets_UDP_ChallengeReply
* @static
* @param {ICMsgSteamSockets_UDP_ChallengeReply} message CMsgSteamSockets_UDP_ChallengeReply message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgSteamSockets_UDP_ChallengeReply.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id"))
writer.uint32(/* id 1, wireType 5 =*/13).fixed32(message.connection_id);
if (message.challenge != null && Object.hasOwnProperty.call(message, "challenge"))
writer.uint32(/* id 2, wireType 1 =*/17).fixed64(message.challenge);
if (message.your_timestamp != null && Object.hasOwnProperty.call(message, "your_timestamp"))
writer.uint32(/* id 3, wireType 1 =*/25).fixed64(message.your_timestamp);
if (message.protocol_version != null && Object.hasOwnProperty.call(message, "protocol_version"))
writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.protocol_version);
return writer;
};
/**
* Encodes the specified CMsgSteamSockets_UDP_ChallengeReply message, length delimited. Does not implicitly {@link CMsgSteamSockets_UDP_ChallengeReply.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgSteamSockets_UDP_ChallengeReply
* @static
* @param {ICMsgSteamSockets_UDP_ChallengeReply} message CMsgSteamSockets_UDP_ChallengeReply message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgSteamSockets_UDP_ChallengeReply.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgSteamSockets_UDP_ChallengeReply message from the specified reader or buffer.
* @function decode
* @memberof CMsgSteamSockets_UDP_ChallengeReply
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgSteamSockets_UDP_ChallengeReply} CMsgSteamSockets_UDP_ChallengeReply
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgSteamSockets_UDP_ChallengeReply.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.CMsgSteamSockets_UDP_ChallengeReply();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.connection_id = reader.fixed32();
break;
}
case 2: {
message.challenge = reader.fixed64();
break;
}
case 3: {
message.your_timestamp = reader.fixed64();
break;
}
case 4: {
message.protocol_version = reader.uint32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgSteamSockets_UDP_ChallengeReply message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgSteamSockets_UDP_ChallengeReply
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgSteamSockets_UDP_ChallengeReply} CMsgSteamSockets_UDP_ChallengeReply
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgSteamSockets_UDP_ChallengeReply.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgSteamSockets_UDP_ChallengeReply message.
* @function verify
* @memberof CMsgSteamSockets_UDP_ChallengeReply
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgSteamSockets_UDP_ChallengeReply.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.connection_id != null && message.hasOwnProperty("connection_id"))
if (!$util.isInteger(message.connection_id))
return "connection_id: integer expected";
if (message.challenge != null && message.hasOwnProperty("challenge"))
if (!$util.isInteger(message.challenge) && !(message.challenge && $util.isInteger(message.challenge.low) && $util.isInteger(message.challenge.high)))
return "challenge: integer|Long expected";
if (message.your_timestamp != null && message.hasOwnProperty("your_timestamp"))
if (!$util.isInteger(message.your_timestamp) && !(message.your_timestamp && $util.isInteger(message.your_timestamp.low) && $util.isInteger(message.your_timestamp.high)))
return "your_timestamp: integer|Long expected";
if (message.protocol_version != null && message.hasOwnProperty("protocol_version"))
if (!$util.isInteger(message.protocol_version))
return "protocol_version: integer expected";
return null;
};
/**
* Creates a CMsgSteamSockets_UDP_ChallengeReply message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgSteamSockets_UDP_ChallengeReply
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgSteamSockets_UDP_ChallengeReply} CMsgSteamSockets_UDP_ChallengeReply
*/
CMsgSteamSockets_UDP_ChallengeReply.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgSteamSockets_UDP_ChallengeReply)
return object;
var message = new $root.CMsgSteamSockets_UDP_ChallengeReply();
if (object.connection_id != null)
message.connection_id = object.connection_id >>> 0;
if (object.challenge != null)
if ($util.Long)
(message.challenge = $util.Long.fromValue(object.challenge)).unsigned = false;
else if (typeof object.challenge === "string")
message.challenge = parseInt(object.challenge, 10);
else if (typeof object.challenge === "number")
message.challenge = object.challenge;
else if (typeof object.challenge === "object")
message.challenge = new $util.LongBits(object.challenge.low >>> 0, object.challenge.high >>> 0).toNumber();
if (object.your_timestamp != null)
if ($util.Long)
(message.your_timestamp = $util.Long.fromValue(object.your_timestamp)).unsigned = false;
else if (typeof object.your_timestamp === "string")
message.your_timestamp = parseInt(object.your_timestamp, 10);
else if (typeof object.your_timestamp === "number")
message.your_timestamp = object.your_timestamp;
else if (typeof object.your_timestamp === "object")
message.your_timestamp = new $util.LongBits(object.your_timestamp.low >>> 0, object.your_timestamp.high >>> 0).toNumber();
if (object.protocol_version != null)
message.protocol_version = object.protocol_version >>> 0;
return message;
};
/**
* Creates a plain object from a CMsgSteamSockets_UDP_ChallengeReply message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgSteamSockets_UDP_ChallengeReply
* @static
* @param {CMsgSteamSockets_UDP_ChallengeReply} message CMsgSteamSockets_UDP_ChallengeReply
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgSteamSockets_UDP_ChallengeReply.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.connection_id = 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.challenge = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.challenge = options.longs === String ? "0" : 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.your_timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.your_timestamp = options.longs === String ? "0" : 0;
object.protocol_version = 0;
}
if (message.connection_id != null && message.hasOwnProperty("connection_id"))
object.connection_id = message.connection_id;
if (message.challenge != null && message.hasOwnProperty("challenge"))
if (typeof message.challenge === "number")
object.challenge = options.longs === String ? String(message.challenge) : message.challenge;
else
object.challenge = options.longs === String ? $util.Long.prototype.toString.call(message.challenge) : options.longs === Number ? new $util.LongBits(message.challenge.low >>> 0, message.challenge.high >>> 0).toNumber() : message.challenge;
if (message.your_timestamp != null && message.hasOwnProperty("your_timestamp"))
if (typeof message.your_timestamp === "number")
object.your_timestamp = options.longs === String ? String(message.your_timestamp) : message.your_timestamp;
else
object.your_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.your_timestamp) : options.longs === Number ? new $util.LongBits(message.your_timestamp.low >>> 0, message.your_timestamp.high >>> 0).toNumber() : message.your_timestamp;
if (message.protocol_version != null && message.hasOwnProperty("protocol_version"))
object.protocol_version = message.protocol_version;
return object;
};
/**
* Converts this CMsgSteamSockets_UDP_ChallengeReply to JSON.
* @function toJSON
* @memberof CMsgSteamSockets_UDP_ChallengeReply
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgSteamSockets_UDP_ChallengeReply.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CMsgSteamSockets_UDP_ChallengeReply
* @function getTypeUrl
* @memberof CMsgSteamSockets_UDP_ChallengeReply
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CMsgSteamSockets_UDP_ChallengeReply.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/CMsgSteamSockets_UDP_ChallengeReply";
};
return CMsgSteamSockets_UDP_ChallengeReply;
})();
$root.CMsgSteamSockets_UDP_ConnectRequest = (function() {
/**
* Properties of a CMsgSteamSockets_UDP_ConnectRequest.
* @exports ICMsgSteamSockets_UDP_ConnectRequest
* @interface ICMsgSteamSockets_UDP_ConnectRequest
* @property {number|null} [client_connection_id] CMsgSteamSockets_UDP_ConnectRequest client_connection_id
* @property {number|Long|null} [challenge] CMsgSteamSockets_UDP_ConnectRequest challenge
* @property {number|Long|null} [my_timestamp] CMsgSteamSockets_UDP_ConnectRequest my_timestamp
* @property {number|null} [ping_est_ms] CMsgSteamSockets_UDP_ConnectRequest ping_est_ms
* @property {ICMsgSteamDatagramSessionCryptInfoSigned|null} [crypt] CMsgSteamSockets_UDP_ConnectRequest crypt
* @property {ICMsgSteamDatagramCertificateSigned|null} [cert] CMsgSteamSockets_UDP_ConnectRequest cert
* @property {number|null} [legacy_protocol_version] CMsgSteamSockets_UDP_ConnectRequest legacy_protocol_version
* @property {string|null} [identity_string] CMsgSteamSockets_UDP_ConnectRequest identity_string
* @property {number|Long|null} [legacy_client_steam_id] CMsgSteamSockets_UDP_ConnectRequest legacy_client_steam_id
* @property {ICMsgSteamNetworkingIdentityLegacyBinary|null} [legacy_identity_binary] CMsgSteamSockets_UDP_ConnectRequest legacy_identity_binary
*/
/**
* Constructs a new CMsgSteamSockets_UDP_ConnectRequest.
* @exports CMsgSteamSockets_UDP_ConnectRequest
* @classdesc Represents a CMsgSteamSockets_UDP_ConnectRequest.
* @implements ICMsgSteamSockets_UDP_ConnectRequest
* @constructor
* @param {ICMsgSteamSockets_UDP_ConnectRequest=} [properties] Properties to set
*/
function CMsgSteamSockets_UDP_ConnectRequest(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]];
}
/**
* CMsgSteamSockets_UDP_ConnectRequest client_connection_id.
* @member {number} client_connection_id
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @instance
*/
CMsgSteamSockets_UDP_ConnectRequest.prototype.client_connection_id = 0;
/**
* CMsgSteamSockets_UDP_ConnectRequest challenge.
* @member {number|Long} challenge
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @instance
*/
CMsgSteamSockets_UDP_ConnectRequest.prototype.challenge = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* CMsgSteamSockets_UDP_ConnectRequest my_timestamp.
* @member {number|Long} my_timestamp
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @instance
*/
CMsgSteamSockets_UDP_ConnectRequest.prototype.my_timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* CMsgSteamSockets_UDP_ConnectRequest ping_est_ms.
* @member {number} ping_est_ms
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @instance
*/
CMsgSteamSockets_UDP_ConnectRequest.prototype.ping_est_ms = 0;
/**
* CMsgSteamSockets_UDP_ConnectRequest crypt.
* @member {ICMsgSteamDatagramSessionCryptInfoSigned|null|undefined} crypt
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @instance
*/
CMsgSteamSockets_UDP_ConnectRequest.prototype.crypt = null;
/**
* CMsgSteamSockets_UDP_ConnectRequest cert.
* @member {ICMsgSteamDatagramCertificateSigned|null|undefined} cert
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @instance
*/
CMsgSteamSockets_UDP_ConnectRequest.prototype.cert = null;
/**
* CMsgSteamSockets_UDP_ConnectRequest legacy_protocol_version.
* @member {number} legacy_protocol_version
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @instance
*/
CMsgSteamSockets_UDP_ConnectRequest.prototype.legacy_protocol_version = 0;
/**
* CMsgSteamSockets_UDP_ConnectRequest identity_string.
* @member {string} identity_string
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @instance
*/
CMsgSteamSockets_UDP_ConnectRequest.prototype.identity_string = "";
/**
* CMsgSteamSockets_UDP_ConnectRequest legacy_client_steam_id.
* @member {number|Long} legacy_client_steam_id
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @instance
*/
CMsgSteamSockets_UDP_ConnectRequest.prototype.legacy_client_steam_id = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* CMsgSteamSockets_UDP_ConnectRequest legacy_identity_binary.
* @member {ICMsgSteamNetworkingIdentityLegacyBinary|null|undefined} legacy_identity_binary
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @instance
*/
CMsgSteamSockets_UDP_ConnectRequest.prototype.legacy_identity_binary = null;
/**
* Creates a new CMsgSteamSockets_UDP_ConnectRequest instance using the specified properties.
* @function create
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @static
* @param {ICMsgSteamSockets_UDP_ConnectRequest=} [properties] Properties to set
* @returns {CMsgSteamSockets_UDP_ConnectRequest} CMsgSteamSockets_UDP_ConnectRequest instance
*/
CMsgSteamSockets_UDP_ConnectRequest.create = function create(properties) {
return new CMsgSteamSockets_UDP_ConnectRequest(properties);
};
/**
* Encodes the specified CMsgSteamSockets_UDP_ConnectRequest message. Does not implicitly {@link CMsgSteamSockets_UDP_ConnectRequest.verify|verify} messages.
* @function encode
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @static
* @param {ICMsgSteamSockets_UDP_ConnectRequest} message CMsgSteamSockets_UDP_ConnectRequest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgSteamSockets_UDP_ConnectRequest.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.client_connection_id != null && Object.hasOwnProperty.call(message, "client_connection_id"))
writer.uint32(/* id 1, wireType 5 =*/13).fixed32(message.client_connection_id);
if (message.challenge != null && Object.hasOwnProperty.call(message, "challenge"))
writer.uint32(/* id 2, wireType 1 =*/17).fixed64(message.challenge);
if (message.legacy_client_steam_id != null && Object.hasOwnProperty.call(message, "legacy_client_steam_id"))
writer.uint32(/* id 3, wireType 1 =*/25).fixed64(message.legacy_client_steam_id);
if (message.cert != null && Object.hasOwnProperty.call(message, "cert"))
$root.CMsgSteamDatagramCertificateSigned.encode(message.cert, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
if (message.my_timestamp != null && Object.hasOwnProperty.call(message, "my_timestamp"))
writer.uint32(/* id 5, wireType 1 =*/41).fixed64(message.my_timestamp);
if (message.ping_est_ms != null && Object.hasOwnProperty.call(message, "ping_est_ms"))
writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.ping_est_ms);
if (message.crypt != null && Object.hasOwnProperty.call(message, "crypt"))
$root.CMsgSteamDatagramSessionCryptInfoSigned.encode(message.crypt, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
if (message.legacy_protocol_version != null && Object.hasOwnProperty.call(message, "legacy_protocol_version"))
writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.legacy_protocol_version);
if (message.legacy_identity_binary != null && Object.hasOwnProperty.call(message, "legacy_identity_binary"))
$root.CMsgSteamNetworkingIdentityLegacyBinary.encode(message.legacy_identity_binary, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
if (message.identity_string != null && Object.hasOwnProperty.call(message, "identity_string"))
writer.uint32(/* id 10, wireType 2 =*/82).string(message.identity_string);
return writer;
};
/**
* Encodes the specified CMsgSteamSockets_UDP_ConnectRequest message, length delimited. Does not implicitly {@link CMsgSteamSockets_UDP_ConnectRequest.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @static
* @param {ICMsgSteamSockets_UDP_ConnectRequest} message CMsgSteamSockets_UDP_ConnectRequest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgSteamSockets_UDP_ConnectRequest.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgSteamSockets_UDP_ConnectRequest message from the specified reader or buffer.
* @function decode
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgSteamSockets_UDP_ConnectRequest} CMsgSteamSockets_UDP_ConnectRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgSteamSockets_UDP_ConnectRequest.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.CMsgSteamSockets_UDP_ConnectRequest();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.client_connection_id = reader.fixed32();
break;
}
case 2: {
message.challenge = reader.fixed64();
break;
}
case 5: {
message.my_timestamp = reader.fixed64();
break;
}
case 6: {
message.ping_est_ms = reader.uint32();
break;
}
case 7: {
message.crypt = $root.CMsgSteamDatagramSessionCryptInfoSigned.decode(reader, reader.uint32());
break;
}
case 4: {
message.cert = $root.CMsgSteamDatagramCertificateSigned.decode(reader, reader.uint32());
break;
}
case 8: {
message.legacy_protocol_version = reader.uint32();
break;
}
case 10: {
message.identity_string = reader.string();
break;
}
case 3: {
message.legacy_client_steam_id = reader.fixed64();
break;
}
case 9: {
message.legacy_identity_binary = $root.CMsgSteamNetworkingIdentityLegacyBinary.decode(reader, reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgSteamSockets_UDP_ConnectRequest message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgSteamSockets_UDP_ConnectRequest} CMsgSteamSockets_UDP_ConnectRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgSteamSockets_UDP_ConnectRequest.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgSteamSockets_UDP_ConnectRequest message.
* @function verify
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgSteamSockets_UDP_ConnectRequest.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.client_connection_id != null && message.hasOwnProperty("client_connection_id"))
if (!$util.isInteger(message.client_connection_id))
return "client_connection_id: integer expected";
if (message.challenge != null && message.hasOwnProperty("challenge"))
if (!$util.isInteger(message.challenge) && !(message.challenge && $util.isInteger(message.challenge.low) && $util.isInteger(message.challenge.high)))
return "challenge: integer|Long expected";
if (message.my_timestamp != null && message.hasOwnProperty("my_timestamp"))
if (!$util.isInteger(message.my_timestamp) && !(message.my_timestamp && $util.isInteger(message.my_timestamp.low) && $util.isInteger(message.my_timestamp.high)))
return "my_timestamp: integer|Long expected";
if (message.ping_est_ms != null && message.hasOwnProperty("ping_est_ms"))
if (!$util.isInteger(message.ping_est_ms))
return "ping_est_ms: integer expected";
if (message.crypt != null && message.hasOwnProperty("crypt")) {
var error = $root.CMsgSteamDatagramSessionCryptInfoSigned.verify(message.crypt);
if (error)
return "crypt." + error;
}
if (message.cert != null && message.hasOwnProperty("cert")) {
var error = $root.CMsgSteamDatagramCertificateSigned.verify(message.cert);
if (error)
return "cert." + error;
}
if (message.legacy_protocol_version != null && message.hasOwnProperty("legacy_protocol_version"))
if (!$util.isInteger(message.legacy_protocol_version))
return "legacy_protocol_version: integer expected";
if (message.identity_string != null && message.hasOwnProperty("identity_string"))
if (!$util.isString(message.identity_string))
return "identity_string: string expected";
if (message.legacy_client_steam_id != null && message.hasOwnProperty("legacy_client_steam_id"))
if (!$util.isInteger(message.legacy_client_steam_id) && !(message.legacy_client_steam_id && $util.isInteger(message.legacy_client_steam_id.low) && $util.isInteger(message.legacy_client_steam_id.high)))
return "legacy_client_steam_id: integer|Long expected";
if (message.legacy_identity_binary != null && message.hasOwnProperty("legacy_identity_binary")) {
var error = $root.CMsgSteamNetworkingIdentityLegacyBinary.verify(message.legacy_identity_binary);
if (error)
return "legacy_identity_binary." + error;
}
return null;
};
/**
* Creates a CMsgSteamSockets_UDP_ConnectRequest message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgSteamSockets_UDP_ConnectRequest
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgSteamSockets_UDP_ConnectRequest} CMsgSteamSockets_UDP_ConnectRequest
*/
CMsgSteamSockets_UDP_ConnectRequest.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgSteamSockets_UDP_ConnectRequest)
return object;
var message = new $root.CMsgSteamSockets_UDP_ConnectRequest();
if (object.client_connection_id != null)
message.client_connection_id = object.client_connection_id >>> 0;
if (object.challenge != null)
if ($util.Long)