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
902 lines (846 loc) • 1.41 MB
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"] = {});
$root.CGameNetworkingUI_GlobalState = (function() {
/**
* Properties of a CGameNetworkingUI_GlobalState.
* @exports ICGameNetworkingUI_GlobalState
* @interface ICGameNetworkingUI_GlobalState
*/
/**
* Constructs a new CGameNetworkingUI_GlobalState.
* @exports CGameNetworkingUI_GlobalState
* @classdesc Represents a CGameNetworkingUI_GlobalState.
* @implements ICGameNetworkingUI_GlobalState
* @constructor
* @param {ICGameNetworkingUI_GlobalState=} [properties] Properties to set
*/
function CGameNetworkingUI_GlobalState(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]];
}
/**
* Creates a new CGameNetworkingUI_GlobalState instance using the specified properties.
* @function create
* @memberof CGameNetworkingUI_GlobalState
* @static
* @param {ICGameNetworkingUI_GlobalState=} [properties] Properties to set
* @returns {CGameNetworkingUI_GlobalState} CGameNetworkingUI_GlobalState instance
*/
CGameNetworkingUI_GlobalState.create = function create(properties) {
return new CGameNetworkingUI_GlobalState(properties);
};
/**
* Encodes the specified CGameNetworkingUI_GlobalState message. Does not implicitly {@link CGameNetworkingUI_GlobalState.verify|verify} messages.
* @function encode
* @memberof CGameNetworkingUI_GlobalState
* @static
* @param {ICGameNetworkingUI_GlobalState} message CGameNetworkingUI_GlobalState message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CGameNetworkingUI_GlobalState.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified CGameNetworkingUI_GlobalState message, length delimited. Does not implicitly {@link CGameNetworkingUI_GlobalState.verify|verify} messages.
* @function encodeDelimited
* @memberof CGameNetworkingUI_GlobalState
* @static
* @param {ICGameNetworkingUI_GlobalState} message CGameNetworkingUI_GlobalState message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CGameNetworkingUI_GlobalState.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CGameNetworkingUI_GlobalState message from the specified reader or buffer.
* @function decode
* @memberof CGameNetworkingUI_GlobalState
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CGameNetworkingUI_GlobalState} CGameNetworkingUI_GlobalState
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CGameNetworkingUI_GlobalState.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.CGameNetworkingUI_GlobalState();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CGameNetworkingUI_GlobalState message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CGameNetworkingUI_GlobalState
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CGameNetworkingUI_GlobalState} CGameNetworkingUI_GlobalState
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CGameNetworkingUI_GlobalState.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CGameNetworkingUI_GlobalState message.
* @function verify
* @memberof CGameNetworkingUI_GlobalState
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CGameNetworkingUI_GlobalState.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a CGameNetworkingUI_GlobalState message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CGameNetworkingUI_GlobalState
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CGameNetworkingUI_GlobalState} CGameNetworkingUI_GlobalState
*/
CGameNetworkingUI_GlobalState.fromObject = function fromObject(object) {
if (object instanceof $root.CGameNetworkingUI_GlobalState)
return object;
return new $root.CGameNetworkingUI_GlobalState();
};
/**
* Creates a plain object from a CGameNetworkingUI_GlobalState message. Also converts values to other types if specified.
* @function toObject
* @memberof CGameNetworkingUI_GlobalState
* @static
* @param {CGameNetworkingUI_GlobalState} message CGameNetworkingUI_GlobalState
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CGameNetworkingUI_GlobalState.toObject = function toObject() {
return {};
};
/**
* Converts this CGameNetworkingUI_GlobalState to JSON.
* @function toJSON
* @memberof CGameNetworkingUI_GlobalState
* @instance
* @returns {Object.<string,*>} JSON object
*/
CGameNetworkingUI_GlobalState.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CGameNetworkingUI_GlobalState
* @function getTypeUrl
* @memberof CGameNetworkingUI_GlobalState
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CGameNetworkingUI_GlobalState.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/CGameNetworkingUI_GlobalState";
};
return CGameNetworkingUI_GlobalState;
})();
$root.CGameNetworkingUI_ConnectionState = (function() {
/**
* Properties of a CGameNetworkingUI_ConnectionState.
* @exports ICGameNetworkingUI_ConnectionState
* @interface ICGameNetworkingUI_ConnectionState
* @property {string|null} [connection_key] CGameNetworkingUI_ConnectionState connection_key
* @property {number|null} [appid] CGameNetworkingUI_ConnectionState appid
* @property {number|null} [connection_id_local] CGameNetworkingUI_ConnectionState connection_id_local
* @property {string|null} [identity_local] CGameNetworkingUI_ConnectionState identity_local
* @property {string|null} [identity_remote] CGameNetworkingUI_ConnectionState identity_remote
* @property {number|null} [connection_state] CGameNetworkingUI_ConnectionState connection_state
* @property {number|null} [start_time] CGameNetworkingUI_ConnectionState start_time
* @property {number|null} [close_time] CGameNetworkingUI_ConnectionState close_time
* @property {number|null} [close_reason] CGameNetworkingUI_ConnectionState close_reason
* @property {string|null} [close_message] CGameNetworkingUI_ConnectionState close_message
* @property {string|null} [status_loc_token] CGameNetworkingUI_ConnectionState status_loc_token
* @property {number|null} [transport_kind] CGameNetworkingUI_ConnectionState transport_kind
* @property {string|null} [sdrpopid_local] CGameNetworkingUI_ConnectionState sdrpopid_local
* @property {string|null} [sdrpopid_remote] CGameNetworkingUI_ConnectionState sdrpopid_remote
* @property {string|null} [address_remote] CGameNetworkingUI_ConnectionState address_remote
* @property {ICMsgSteamDatagramP2PRoutingSummary|null} [p2p_routing] CGameNetworkingUI_ConnectionState p2p_routing
* @property {number|null} [ping_interior] CGameNetworkingUI_ConnectionState ping_interior
* @property {number|null} [ping_remote_front] CGameNetworkingUI_ConnectionState ping_remote_front
* @property {number|null} [ping_default_internet_route] CGameNetworkingUI_ConnectionState ping_default_internet_route
* @property {ICMsgSteamDatagramConnectionQuality|null} [e2e_quality_local] CGameNetworkingUI_ConnectionState e2e_quality_local
* @property {ICMsgSteamDatagramConnectionQuality|null} [e2e_quality_remote] CGameNetworkingUI_ConnectionState e2e_quality_remote
* @property {number|Long|null} [e2e_quality_remote_instantaneous_time] CGameNetworkingUI_ConnectionState e2e_quality_remote_instantaneous_time
* @property {number|Long|null} [e2e_quality_remote_lifetime_time] CGameNetworkingUI_ConnectionState e2e_quality_remote_lifetime_time
* @property {ICMsgSteamDatagramConnectionQuality|null} [front_quality_local] CGameNetworkingUI_ConnectionState front_quality_local
* @property {ICMsgSteamDatagramConnectionQuality|null} [front_quality_remote] CGameNetworkingUI_ConnectionState front_quality_remote
* @property {number|Long|null} [front_quality_remote_instantaneous_time] CGameNetworkingUI_ConnectionState front_quality_remote_instantaneous_time
* @property {number|Long|null} [front_quality_remote_lifetime_time] CGameNetworkingUI_ConnectionState front_quality_remote_lifetime_time
*/
/**
* Constructs a new CGameNetworkingUI_ConnectionState.
* @exports CGameNetworkingUI_ConnectionState
* @classdesc Represents a CGameNetworkingUI_ConnectionState.
* @implements ICGameNetworkingUI_ConnectionState
* @constructor
* @param {ICGameNetworkingUI_ConnectionState=} [properties] Properties to set
*/
function CGameNetworkingUI_ConnectionState(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]];
}
/**
* CGameNetworkingUI_ConnectionState connection_key.
* @member {string} connection_key
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.connection_key = "";
/**
* CGameNetworkingUI_ConnectionState appid.
* @member {number} appid
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.appid = 0;
/**
* CGameNetworkingUI_ConnectionState connection_id_local.
* @member {number} connection_id_local
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.connection_id_local = 0;
/**
* CGameNetworkingUI_ConnectionState identity_local.
* @member {string} identity_local
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.identity_local = "";
/**
* CGameNetworkingUI_ConnectionState identity_remote.
* @member {string} identity_remote
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.identity_remote = "";
/**
* CGameNetworkingUI_ConnectionState connection_state.
* @member {number} connection_state
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.connection_state = 0;
/**
* CGameNetworkingUI_ConnectionState start_time.
* @member {number} start_time
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.start_time = 0;
/**
* CGameNetworkingUI_ConnectionState close_time.
* @member {number} close_time
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.close_time = 0;
/**
* CGameNetworkingUI_ConnectionState close_reason.
* @member {number} close_reason
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.close_reason = 0;
/**
* CGameNetworkingUI_ConnectionState close_message.
* @member {string} close_message
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.close_message = "";
/**
* CGameNetworkingUI_ConnectionState status_loc_token.
* @member {string} status_loc_token
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.status_loc_token = "";
/**
* CGameNetworkingUI_ConnectionState transport_kind.
* @member {number} transport_kind
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.transport_kind = 0;
/**
* CGameNetworkingUI_ConnectionState sdrpopid_local.
* @member {string} sdrpopid_local
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.sdrpopid_local = "";
/**
* CGameNetworkingUI_ConnectionState sdrpopid_remote.
* @member {string} sdrpopid_remote
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.sdrpopid_remote = "";
/**
* CGameNetworkingUI_ConnectionState address_remote.
* @member {string} address_remote
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.address_remote = "";
/**
* CGameNetworkingUI_ConnectionState p2p_routing.
* @member {ICMsgSteamDatagramP2PRoutingSummary|null|undefined} p2p_routing
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.p2p_routing = null;
/**
* CGameNetworkingUI_ConnectionState ping_interior.
* @member {number} ping_interior
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.ping_interior = 0;
/**
* CGameNetworkingUI_ConnectionState ping_remote_front.
* @member {number} ping_remote_front
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.ping_remote_front = 0;
/**
* CGameNetworkingUI_ConnectionState ping_default_internet_route.
* @member {number} ping_default_internet_route
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.ping_default_internet_route = 0;
/**
* CGameNetworkingUI_ConnectionState e2e_quality_local.
* @member {ICMsgSteamDatagramConnectionQuality|null|undefined} e2e_quality_local
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.e2e_quality_local = null;
/**
* CGameNetworkingUI_ConnectionState e2e_quality_remote.
* @member {ICMsgSteamDatagramConnectionQuality|null|undefined} e2e_quality_remote
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.e2e_quality_remote = null;
/**
* CGameNetworkingUI_ConnectionState e2e_quality_remote_instantaneous_time.
* @member {number|Long} e2e_quality_remote_instantaneous_time
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.e2e_quality_remote_instantaneous_time = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* CGameNetworkingUI_ConnectionState e2e_quality_remote_lifetime_time.
* @member {number|Long} e2e_quality_remote_lifetime_time
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.e2e_quality_remote_lifetime_time = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* CGameNetworkingUI_ConnectionState front_quality_local.
* @member {ICMsgSteamDatagramConnectionQuality|null|undefined} front_quality_local
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.front_quality_local = null;
/**
* CGameNetworkingUI_ConnectionState front_quality_remote.
* @member {ICMsgSteamDatagramConnectionQuality|null|undefined} front_quality_remote
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.front_quality_remote = null;
/**
* CGameNetworkingUI_ConnectionState front_quality_remote_instantaneous_time.
* @member {number|Long} front_quality_remote_instantaneous_time
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.front_quality_remote_instantaneous_time = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* CGameNetworkingUI_ConnectionState front_quality_remote_lifetime_time.
* @member {number|Long} front_quality_remote_lifetime_time
* @memberof CGameNetworkingUI_ConnectionState
* @instance
*/
CGameNetworkingUI_ConnectionState.prototype.front_quality_remote_lifetime_time = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* Creates a new CGameNetworkingUI_ConnectionState instance using the specified properties.
* @function create
* @memberof CGameNetworkingUI_ConnectionState
* @static
* @param {ICGameNetworkingUI_ConnectionState=} [properties] Properties to set
* @returns {CGameNetworkingUI_ConnectionState} CGameNetworkingUI_ConnectionState instance
*/
CGameNetworkingUI_ConnectionState.create = function create(properties) {
return new CGameNetworkingUI_ConnectionState(properties);
};
/**
* Encodes the specified CGameNetworkingUI_ConnectionState message. Does not implicitly {@link CGameNetworkingUI_ConnectionState.verify|verify} messages.
* @function encode
* @memberof CGameNetworkingUI_ConnectionState
* @static
* @param {ICGameNetworkingUI_ConnectionState} message CGameNetworkingUI_ConnectionState message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CGameNetworkingUI_ConnectionState.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.connection_key != null && Object.hasOwnProperty.call(message, "connection_key"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_key);
if (message.appid != null && Object.hasOwnProperty.call(message, "appid"))
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.appid);
if (message.connection_id_local != null && Object.hasOwnProperty.call(message, "connection_id_local"))
writer.uint32(/* id 3, wireType 5 =*/29).fixed32(message.connection_id_local);
if (message.identity_local != null && Object.hasOwnProperty.call(message, "identity_local"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.identity_local);
if (message.identity_remote != null && Object.hasOwnProperty.call(message, "identity_remote"))
writer.uint32(/* id 5, wireType 2 =*/42).string(message.identity_remote);
if (message.connection_state != null && Object.hasOwnProperty.call(message, "connection_state"))
writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.connection_state);
if (message.start_time != null && Object.hasOwnProperty.call(message, "start_time"))
writer.uint32(/* id 12, wireType 0 =*/96).uint32(message.start_time);
if (message.close_time != null && Object.hasOwnProperty.call(message, "close_time"))
writer.uint32(/* id 13, wireType 0 =*/104).uint32(message.close_time);
if (message.close_reason != null && Object.hasOwnProperty.call(message, "close_reason"))
writer.uint32(/* id 14, wireType 0 =*/112).uint32(message.close_reason);
if (message.close_message != null && Object.hasOwnProperty.call(message, "close_message"))
writer.uint32(/* id 15, wireType 2 =*/122).string(message.close_message);
if (message.status_loc_token != null && Object.hasOwnProperty.call(message, "status_loc_token"))
writer.uint32(/* id 16, wireType 2 =*/130).string(message.status_loc_token);
if (message.transport_kind != null && Object.hasOwnProperty.call(message, "transport_kind"))
writer.uint32(/* id 20, wireType 0 =*/160).uint32(message.transport_kind);
if (message.sdrpopid_local != null && Object.hasOwnProperty.call(message, "sdrpopid_local"))
writer.uint32(/* id 21, wireType 2 =*/170).string(message.sdrpopid_local);
if (message.sdrpopid_remote != null && Object.hasOwnProperty.call(message, "sdrpopid_remote"))
writer.uint32(/* id 22, wireType 2 =*/178).string(message.sdrpopid_remote);
if (message.address_remote != null && Object.hasOwnProperty.call(message, "address_remote"))
writer.uint32(/* id 23, wireType 2 =*/186).string(message.address_remote);
if (message.p2p_routing != null && Object.hasOwnProperty.call(message, "p2p_routing"))
$root.CMsgSteamDatagramP2PRoutingSummary.encode(message.p2p_routing, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim();
if (message.ping_interior != null && Object.hasOwnProperty.call(message, "ping_interior"))
writer.uint32(/* id 25, wireType 0 =*/200).uint32(message.ping_interior);
if (message.ping_remote_front != null && Object.hasOwnProperty.call(message, "ping_remote_front"))
writer.uint32(/* id 26, wireType 0 =*/208).uint32(message.ping_remote_front);
if (message.ping_default_internet_route != null && Object.hasOwnProperty.call(message, "ping_default_internet_route"))
writer.uint32(/* id 27, wireType 0 =*/216).uint32(message.ping_default_internet_route);
if (message.e2e_quality_local != null && Object.hasOwnProperty.call(message, "e2e_quality_local"))
$root.CMsgSteamDatagramConnectionQuality.encode(message.e2e_quality_local, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim();
if (message.e2e_quality_remote != null && Object.hasOwnProperty.call(message, "e2e_quality_remote"))
$root.CMsgSteamDatagramConnectionQuality.encode(message.e2e_quality_remote, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim();
if (message.e2e_quality_remote_instantaneous_time != null && Object.hasOwnProperty.call(message, "e2e_quality_remote_instantaneous_time"))
writer.uint32(/* id 32, wireType 0 =*/256).uint64(message.e2e_quality_remote_instantaneous_time);
if (message.e2e_quality_remote_lifetime_time != null && Object.hasOwnProperty.call(message, "e2e_quality_remote_lifetime_time"))
writer.uint32(/* id 33, wireType 0 =*/264).uint64(message.e2e_quality_remote_lifetime_time);
if (message.front_quality_local != null && Object.hasOwnProperty.call(message, "front_quality_local"))
$root.CMsgSteamDatagramConnectionQuality.encode(message.front_quality_local, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim();
if (message.front_quality_remote != null && Object.hasOwnProperty.call(message, "front_quality_remote"))
$root.CMsgSteamDatagramConnectionQuality.encode(message.front_quality_remote, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim();
if (message.front_quality_remote_instantaneous_time != null && Object.hasOwnProperty.call(message, "front_quality_remote_instantaneous_time"))
writer.uint32(/* id 42, wireType 0 =*/336).uint64(message.front_quality_remote_instantaneous_time);
if (message.front_quality_remote_lifetime_time != null && Object.hasOwnProperty.call(message, "front_quality_remote_lifetime_time"))
writer.uint32(/* id 43, wireType 0 =*/344).uint64(message.front_quality_remote_lifetime_time);
return writer;
};
/**
* Encodes the specified CGameNetworkingUI_ConnectionState message, length delimited. Does not implicitly {@link CGameNetworkingUI_ConnectionState.verify|verify} messages.
* @function encodeDelimited
* @memberof CGameNetworkingUI_ConnectionState
* @static
* @param {ICGameNetworkingUI_ConnectionState} message CGameNetworkingUI_ConnectionState message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CGameNetworkingUI_ConnectionState.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CGameNetworkingUI_ConnectionState message from the specified reader or buffer.
* @function decode
* @memberof CGameNetworkingUI_ConnectionState
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CGameNetworkingUI_ConnectionState} CGameNetworkingUI_ConnectionState
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CGameNetworkingUI_ConnectionState.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.CGameNetworkingUI_ConnectionState();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.connection_key = reader.string();
break;
}
case 2: {
message.appid = reader.uint32();
break;
}
case 3: {
message.connection_id_local = reader.fixed32();
break;
}
case 4: {
message.identity_local = reader.string();
break;
}
case 5: {
message.identity_remote = reader.string();
break;
}
case 10: {
message.connection_state = reader.uint32();
break;
}
case 12: {
message.start_time = reader.uint32();
break;
}
case 13: {
message.close_time = reader.uint32();
break;
}
case 14: {
message.close_reason = reader.uint32();
break;
}
case 15: {
message.close_message = reader.string();
break;
}
case 16: {
message.status_loc_token = reader.string();
break;
}
case 20: {
message.transport_kind = reader.uint32();
break;
}
case 21: {
message.sdrpopid_local = reader.string();
break;
}
case 22: {
message.sdrpopid_remote = reader.string();
break;
}
case 23: {
message.address_remote = reader.string();
break;
}
case 24: {
message.p2p_routing = $root.CMsgSteamDatagramP2PRoutingSummary.decode(reader, reader.uint32());
break;
}
case 25: {
message.ping_interior = reader.uint32();
break;
}
case 26: {
message.ping_remote_front = reader.uint32();
break;
}
case 27: {
message.ping_default_internet_route = reader.uint32();
break;
}
case 30: {
message.e2e_quality_local = $root.CMsgSteamDatagramConnectionQuality.decode(reader, reader.uint32());
break;
}
case 31: {
message.e2e_quality_remote = $root.CMsgSteamDatagramConnectionQuality.decode(reader, reader.uint32());
break;
}
case 32: {
message.e2e_quality_remote_instantaneous_time = reader.uint64();
break;
}
case 33: {
message.e2e_quality_remote_lifetime_time = reader.uint64();
break;
}
case 40: {
message.front_quality_local = $root.CMsgSteamDatagramConnectionQuality.decode(reader, reader.uint32());
break;
}
case 41: {
message.front_quality_remote = $root.CMsgSteamDatagramConnectionQuality.decode(reader, reader.uint32());
break;
}
case 42: {
message.front_quality_remote_instantaneous_time = reader.uint64();
break;
}
case 43: {
message.front_quality_remote_lifetime_time = reader.uint64();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CGameNetworkingUI_ConnectionState message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CGameNetworkingUI_ConnectionState
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CGameNetworkingUI_ConnectionState} CGameNetworkingUI_ConnectionState
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CGameNetworkingUI_ConnectionState.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CGameNetworkingUI_ConnectionState message.
* @function verify
* @memberof CGameNetworkingUI_ConnectionState
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CGameNetworkingUI_ConnectionState.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.connection_key != null && message.hasOwnProperty("connection_key"))
if (!$util.isString(message.connection_key))
return "connection_key: string expected";
if (message.appid != null && message.hasOwnProperty("appid"))
if (!$util.isInteger(message.appid))
return "appid: integer expected";
if (message.connection_id_local != null && message.hasOwnProperty("connection_id_local"))
if (!$util.isInteger(message.connection_id_local))
return "connection_id_local: integer expected";
if (message.identity_local != null && message.hasOwnProperty("identity_local"))
if (!$util.isString(message.identity_local))
return "identity_local: string expected";
if (message.identity_remote != null && message.hasOwnProperty("identity_remote"))
if (!$util.isString(message.identity_remote))
return "identity_remote: string expected";
if (message.connection_state != null && message.hasOwnProperty("connection_state"))
if (!$util.isInteger(message.connection_state))
return "connection_state: integer expected";
if (message.start_time != null && message.hasOwnProperty("start_time"))
if (!$util.isInteger(message.start_time))
return "start_time: integer expected";
if (message.close_time != null && message.hasOwnProperty("close_time"))
if (!$util.isInteger(message.close_time))
return "close_time: integer expected";
if (message.close_reason != null && message.hasOwnProperty("close_reason"))
if (!$util.isInteger(message.close_reason))
return "close_reason: integer expected";
if (message.close_message != null && message.hasOwnProperty("close_message"))
if (!$util.isString(message.close_message))
return "close_message: string expected";
if (message.status_loc_token != null && message.hasOwnProperty("status_loc_token"))
if (!$util.isString(message.status_loc_token))
return "status_loc_token: string expected";
if (message.transport_kind != null && message.hasOwnProperty("transport_kind"))
if (!$util.isInteger(message.transport_kind))
return "transport_kind: integer expected";
if (message.sdrpopid_local != null && message.hasOwnProperty("sdrpopid_local"))
if (!$util.isString(message.sdrpopid_local))
return "sdrpopid_local: string expected";
if (message.sdrpopid_remote != null && message.hasOwnProperty("sdrpopid_remote"))
if (!$util.isString(message.sdrpopid_remote))
return "sdrpopid_remote: string expected";
if (message.address_remote != null && message.hasOwnProperty("address_remote"))
if (!$util.isString(message.address_remote))
return "address_remote: string expected";
if (message.p2p_routing != null && message.hasOwnProperty("p2p_routing")) {
var error = $root.CMsgSteamDatagramP2PRoutingSummary.verify(message.p2p_routing);
if (error)
return "p2p_routing." + error;
}
if (message.ping_interior != null && message.hasOwnProperty("ping_interior"))
if (!$util.isInteger(message.ping_interior))
return "ping_interior: integer expected";
if (message.ping_remote_front != null && message.hasOwnProperty("ping_remote_front"))
if (!$util.isInteger(message.ping_remote_front))
return "ping_remote_front: integer expected";
if (message.ping_default_internet_route != null && message.hasOwnProperty("ping_default_internet_route"))
if (!$util.isInteger(message.ping_default_internet_route))
return "ping_default_internet_route: integer expected";
if (message.e2e_quality_local != null && message.hasOwnProperty("e2e_quality_local")) {
var error = $root.CMsgSteamDatagramConnectionQuality.verify(message.e2e_quality_local);
if (error)
return "e2e_quality_local." + error;
}
if (message.e2e_quality_remote != null && message.hasOwnProperty("e2e_quality_remote")) {
var error = $root.CMsgSteamDatagramConnectionQuality.verify(message.e2e_quality_remote);
if (error)
return "e2e_quality_remote." + error;
}
if (message.e2e_quality_remote_instantaneous_time != null && message.hasOwnProperty("e2e_quality_remote_instantaneous_time"))
if (!$util.isInteger(message.e2e_quality_remote_instantaneous_time) && !(message.e2e_quality_remote_instantaneous_time && $util.isInteger(message.e2e_quality_remote_instantaneous_time.low) && $util.isInteger(message.e2e_quality_remote_instantaneous_time.high)))
return "e2e_quality_remote_instantaneous_time: integer|Long expected";
if (message.e2e_quality_remote_lifetime_time != null && message.hasOwnProperty("e2e_quality_remote_lifetime_time"))
if (!$util.isInteger(message.e2e_quality_remote_lifetime_time) && !(message.e2e_quality_remote_lifetime_time && $util.isInteger(message.e2e_quality_remote_lifetime_time.low) && $util.isInteger(message.e2e_quality_remote_lifetime_time.high)))
return "e2e_quality_remote_lifetime_time: integer|Long expected";
if (message.front_quality_local != null && message.hasOwnProperty("front_quality_local")) {
var error = $root.CMsgSteamDatagramConnectionQuality.verify(message.front_quality_local);
if (error)
return "front_quality_local." + error;
}
if (message.front_quality_remote != null && message.hasOwnProperty("front_quality_remote")) {
var error = $root.CMsgSteamDatagramConnectionQuality.verify(message.front_quality_remote);
if (error)
return "front_quality_remote." + error;
}
if (message.front_quality_remote_instantaneous_time != null && message.hasOwnProperty("front_quality_remote_instantaneous_time"))
if (!$util.isInteger(message.front_quality_remote_instantaneous_time) && !(message.front_quality_remote_instantaneous_time && $util.isInteger(message.front_quality_remote_instantaneous_time.low) && $util.isInteger(message.front_quality_remote_instantaneous_time.high)))
return "front_quality_remote_instantaneous_time: integer|Long expected";
if (message.front_quality_remote_lifetime_time != null && message.hasOwnProperty("front_quality_remote_lifetime_time"))
if (!$util.isInteger(message.front_quality_remote_lifetime_time) && !(message.front_quality_remote_lifetime_time && $util.isInteger(message.front_quality_remote_lifetime_time.low) && $util.isInteger(message.front_quality_remote_lifetime_time.high)))
return "front_quality_remote_lifetime_time: integer|Long expected";
return null;
};
/**
* Creates a CGameNetworkingUI_ConnectionState message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CGameNetworkingUI_ConnectionState
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CGameNetworkingUI_ConnectionState} CGameNetworkingUI_ConnectionState
*/
CGameNetworkingUI_ConnectionState.fromObject = function fromObject(object) {
if (object instanceof $root.CGameNetworkingUI_ConnectionState)
return object;
var message = new $root.CGameNetworkingUI_ConnectionState();
if (object.connection_key != null)
message.connection_key = String(object.connection_key);
if (object.appid != null)
message.appid = object.appid >>> 0;
if (object.connection_id_local != null)
message.connection_id_local = object.connection_id_local >>> 0;
if (object.identity_local != null)
message.identity_local = String(object.identity_local);
if (object.identity_remote != null)
message.identity_remote = String(object.identity_remote);
if (object.connection_state != null)
message.connection_state = object.connection_state >>> 0;
if (object.start_time != null)
message.start_time = object.start_time >>> 0;
if (object.close_time != null)
message.close_time = object.close_time >>> 0;
if (object.close_reason != null)
message.close_reason = object.close_reason >>> 0;
if (object.close_message != null)
message.close_message = String(object.close_message);
if (object.status_loc_token != null)
message.status_loc_token = String(object.status_loc_token);
if (object.transport_kind != null)
message.transport_kind = object.transport_kind >>> 0;
if (object.sdrpopid_local != null)
message.sdrpopid_local = String(object.sdrpopid_local);
if (object.sdrpopid_remote != null)
message.sdrpopid_remote = String(object.sdrpopid_remote);
if (object.address_remote != null)
message.address_remote = String(object.address_remote);
if (object.p2p_routing != null) {
if (typeof object.p2p_routing !== "object")
throw TypeError(".CGameNetworkingUI_ConnectionState.p2p_routing: object expected");
message.p2p_routing = $root.CMsgSteamDatagramP2PRoutingSummary.fromObject(object.p2p_routing);
}
if (object.ping_interior != null)
message.ping_interior = object.ping_interior >>> 0;
if (object.ping_remote_front != null)
message.ping_remote_front = object.ping_remote_front >>> 0;
if (object.ping_default_internet_route != null)
message.ping_default_internet_route = object.ping_default_internet_route >>> 0;
if (object.e2e_quality_local != null) {
if (typeof object.e2e_quality_local !== "object")
throw TypeError(".CGameNetworkingUI_ConnectionState.e2e_quality_local: object expected");
message.e2e_quality_local = $root.CMsgSteamDatagramConnectionQuality.fromObject(object.e2e_quality_local);
}
if (object.e2e_quality_remote != null) {
if (typeof object.e2e_quality_remote !== "object")
throw TypeError(".CGameNetworkingUI_ConnectionState.e2e_quality_remote: object expected");
message.e2e_quality_remote = $root.CMsgSteamDatagramConnectionQuality.fromObject(object.e2e_quality_remote);
}
if (object.e2e_quality_remote_instantaneous_time != null)
if ($util.Long)
(message.e2e_quality_remote_instantaneous_time = $util.Long.fromValue(object.e2e_quality_remote_instantaneous_time)).unsigned = true;
else if (typeof object.e2e_quality_remote_instantaneous_time === "string")
message.e2e_quality_remote_instantaneous_time = parseInt(object.e2e_quality_remote_instantaneous_time, 10);
else if (typeof object.e2e_quality_remote_instantaneous_time === "number")
message.e2e_quality_remote_instantaneous_time = object.e2e_quality_remote_instantaneous_time;
else if (typeof object.e2e_quality_remote_instantaneous_time === "object")
message.e2e_quality_remote_instantaneous_time = new $util.LongBits(object.e2e_quality_remote_instantaneous_time.low >>> 0, object.e2e_quality_remote_instantaneous_time.high >>> 0).toNumber(true);
if (object.e2e_quality_remote_lifetime_time != null)
if ($util.Long)
(message.e2e_quality_remote_lifetime_time = $util.Long.fromValue(object.e2e_quality_remote_lifetime_time)).unsigned = true;
else if (typeof object.e2e_quality_remote_lifetime_time === "string")
message.e2e_quality_remote_lifetime_time = parseInt(object.e2e_quality_remote_lifetime_time, 10);
else if (typeof object.e2e_quality_remote_lifetime_time === "number")
message.e2e_quality_remote_lifetime_time = object.e2e_quality_remote_lifetime_time;
else if (typeof object.e2e_quality_remote_lifetime_time === "object")
message.e2e_quality_remote_lifetime_time = new $util.LongBits(object.e2e_quality_remote_lifetime_time.low >>> 0, object.e2e_quality_remote_lifetime_time.high >>> 0).toNumber(true);
if (object.front_quality_local != null) {
if (typeof object.front_quality_local !== "object")
throw TypeError(".CGameNetworkingUI_ConnectionState.front_quality_local: object expected");
message.front_quality_local = $root.CMsgSteamDatagramConnectionQuality.fromObject(object.front_quality_local);
}
if (object.front_quality_remote != null) {
if (typeof object.front_quality_remote !== "object")
throw TypeError(".CGameNetworkingUI_ConnectionState.front_quality_remote: object expected");
message.front_quality_remote = $root.CMsgSteamDatagram