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,098 lines (1,025 loc) • 776 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"] = {});
/**
* EBasePredictionEvents enum.
* @exports EBasePredictionEvents
* @enum {number}
* @property {number} BPE_StringCommand=128 BPE_StringCommand value
* @property {number} BPE_Teleport=130 BPE_Teleport value
* @property {number} BPE_Diagnostic=16384 BPE_Diagnostic value
*/
$root.EBasePredictionEvents = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[128] = "BPE_StringCommand"] = 128;
values[valuesById[130] = "BPE_Teleport"] = 130;
values[valuesById[16384] = "BPE_Diagnostic"] = 16384;
return values;
})();
$root.CPredictionEvent_Teleport = (function() {
/**
* Properties of a CPredictionEvent_Teleport.
* @exports ICPredictionEvent_Teleport
* @interface ICPredictionEvent_Teleport
* @property {ICMsgVector|null} [origin] CPredictionEvent_Teleport origin
* @property {ICMsgQAngle|null} [angles] CPredictionEvent_Teleport angles
* @property {number|null} [drop_to_ground_range] CPredictionEvent_Teleport drop_to_ground_range
*/
/**
* Constructs a new CPredictionEvent_Teleport.
* @exports CPredictionEvent_Teleport
* @classdesc Represents a CPredictionEvent_Teleport.
* @implements ICPredictionEvent_Teleport
* @constructor
* @param {ICPredictionEvent_Teleport=} [properties] Properties to set
*/
function CPredictionEvent_Teleport(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]];
}
/**
* CPredictionEvent_Teleport origin.
* @member {ICMsgVector|null|undefined} origin
* @memberof CPredictionEvent_Teleport
* @instance
*/
CPredictionEvent_Teleport.prototype.origin = null;
/**
* CPredictionEvent_Teleport angles.
* @member {ICMsgQAngle|null|undefined} angles
* @memberof CPredictionEvent_Teleport
* @instance
*/
CPredictionEvent_Teleport.prototype.angles = null;
/**
* CPredictionEvent_Teleport drop_to_ground_range.
* @member {number} drop_to_ground_range
* @memberof CPredictionEvent_Teleport
* @instance
*/
CPredictionEvent_Teleport.prototype.drop_to_ground_range = 0;
/**
* Creates a new CPredictionEvent_Teleport instance using the specified properties.
* @function create
* @memberof CPredictionEvent_Teleport
* @static
* @param {ICPredictionEvent_Teleport=} [properties] Properties to set
* @returns {CPredictionEvent_Teleport} CPredictionEvent_Teleport instance
*/
CPredictionEvent_Teleport.create = function create(properties) {
return new CPredictionEvent_Teleport(properties);
};
/**
* Encodes the specified CPredictionEvent_Teleport message. Does not implicitly {@link CPredictionEvent_Teleport.verify|verify} messages.
* @function encode
* @memberof CPredictionEvent_Teleport
* @static
* @param {ICPredictionEvent_Teleport} message CPredictionEvent_Teleport message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CPredictionEvent_Teleport.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.origin != null && Object.hasOwnProperty.call(message, "origin"))
$root.CMsgVector.encode(message.origin, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.angles != null && Object.hasOwnProperty.call(message, "angles"))
$root.CMsgQAngle.encode(message.angles, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.drop_to_ground_range != null && Object.hasOwnProperty.call(message, "drop_to_ground_range"))
writer.uint32(/* id 3, wireType 5 =*/29).float(message.drop_to_ground_range);
return writer;
};
/**
* Encodes the specified CPredictionEvent_Teleport message, length delimited. Does not implicitly {@link CPredictionEvent_Teleport.verify|verify} messages.
* @function encodeDelimited
* @memberof CPredictionEvent_Teleport
* @static
* @param {ICPredictionEvent_Teleport} message CPredictionEvent_Teleport message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CPredictionEvent_Teleport.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CPredictionEvent_Teleport message from the specified reader or buffer.
* @function decode
* @memberof CPredictionEvent_Teleport
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CPredictionEvent_Teleport} CPredictionEvent_Teleport
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CPredictionEvent_Teleport.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.CPredictionEvent_Teleport();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.origin = $root.CMsgVector.decode(reader, reader.uint32());
break;
}
case 2: {
message.angles = $root.CMsgQAngle.decode(reader, reader.uint32());
break;
}
case 3: {
message.drop_to_ground_range = reader.float();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CPredictionEvent_Teleport message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CPredictionEvent_Teleport
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CPredictionEvent_Teleport} CPredictionEvent_Teleport
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CPredictionEvent_Teleport.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CPredictionEvent_Teleport message.
* @function verify
* @memberof CPredictionEvent_Teleport
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CPredictionEvent_Teleport.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.origin != null && message.hasOwnProperty("origin")) {
var error = $root.CMsgVector.verify(message.origin);
if (error)
return "origin." + error;
}
if (message.angles != null && message.hasOwnProperty("angles")) {
var error = $root.CMsgQAngle.verify(message.angles);
if (error)
return "angles." + error;
}
if (message.drop_to_ground_range != null && message.hasOwnProperty("drop_to_ground_range"))
if (typeof message.drop_to_ground_range !== "number")
return "drop_to_ground_range: number expected";
return null;
};
/**
* Creates a CPredictionEvent_Teleport message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CPredictionEvent_Teleport
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CPredictionEvent_Teleport} CPredictionEvent_Teleport
*/
CPredictionEvent_Teleport.fromObject = function fromObject(object) {
if (object instanceof $root.CPredictionEvent_Teleport)
return object;
var message = new $root.CPredictionEvent_Teleport();
if (object.origin != null) {
if (typeof object.origin !== "object")
throw TypeError(".CPredictionEvent_Teleport.origin: object expected");
message.origin = $root.CMsgVector.fromObject(object.origin);
}
if (object.angles != null) {
if (typeof object.angles !== "object")
throw TypeError(".CPredictionEvent_Teleport.angles: object expected");
message.angles = $root.CMsgQAngle.fromObject(object.angles);
}
if (object.drop_to_ground_range != null)
message.drop_to_ground_range = Number(object.drop_to_ground_range);
return message;
};
/**
* Creates a plain object from a CPredictionEvent_Teleport message. Also converts values to other types if specified.
* @function toObject
* @memberof CPredictionEvent_Teleport
* @static
* @param {CPredictionEvent_Teleport} message CPredictionEvent_Teleport
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CPredictionEvent_Teleport.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.origin = null;
object.angles = null;
object.drop_to_ground_range = 0;
}
if (message.origin != null && message.hasOwnProperty("origin"))
object.origin = $root.CMsgVector.toObject(message.origin, options);
if (message.angles != null && message.hasOwnProperty("angles"))
object.angles = $root.CMsgQAngle.toObject(message.angles, options);
if (message.drop_to_ground_range != null && message.hasOwnProperty("drop_to_ground_range"))
object.drop_to_ground_range = options.json && !isFinite(message.drop_to_ground_range) ? String(message.drop_to_ground_range) : message.drop_to_ground_range;
return object;
};
/**
* Converts this CPredictionEvent_Teleport to JSON.
* @function toJSON
* @memberof CPredictionEvent_Teleport
* @instance
* @returns {Object.<string,*>} JSON object
*/
CPredictionEvent_Teleport.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CPredictionEvent_Teleport
* @function getTypeUrl
* @memberof CPredictionEvent_Teleport
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CPredictionEvent_Teleport.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/CPredictionEvent_Teleport";
};
return CPredictionEvent_Teleport;
})();
$root.CPredictionEvent_StringCommand = (function() {
/**
* Properties of a CPredictionEvent_StringCommand.
* @exports ICPredictionEvent_StringCommand
* @interface ICPredictionEvent_StringCommand
* @property {string|null} [command] CPredictionEvent_StringCommand command
*/
/**
* Constructs a new CPredictionEvent_StringCommand.
* @exports CPredictionEvent_StringCommand
* @classdesc Represents a CPredictionEvent_StringCommand.
* @implements ICPredictionEvent_StringCommand
* @constructor
* @param {ICPredictionEvent_StringCommand=} [properties] Properties to set
*/
function CPredictionEvent_StringCommand(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]];
}
/**
* CPredictionEvent_StringCommand command.
* @member {string} command
* @memberof CPredictionEvent_StringCommand
* @instance
*/
CPredictionEvent_StringCommand.prototype.command = "";
/**
* Creates a new CPredictionEvent_StringCommand instance using the specified properties.
* @function create
* @memberof CPredictionEvent_StringCommand
* @static
* @param {ICPredictionEvent_StringCommand=} [properties] Properties to set
* @returns {CPredictionEvent_StringCommand} CPredictionEvent_StringCommand instance
*/
CPredictionEvent_StringCommand.create = function create(properties) {
return new CPredictionEvent_StringCommand(properties);
};
/**
* Encodes the specified CPredictionEvent_StringCommand message. Does not implicitly {@link CPredictionEvent_StringCommand.verify|verify} messages.
* @function encode
* @memberof CPredictionEvent_StringCommand
* @static
* @param {ICPredictionEvent_StringCommand} message CPredictionEvent_StringCommand message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CPredictionEvent_StringCommand.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.command != null && Object.hasOwnProperty.call(message, "command"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.command);
return writer;
};
/**
* Encodes the specified CPredictionEvent_StringCommand message, length delimited. Does not implicitly {@link CPredictionEvent_StringCommand.verify|verify} messages.
* @function encodeDelimited
* @memberof CPredictionEvent_StringCommand
* @static
* @param {ICPredictionEvent_StringCommand} message CPredictionEvent_StringCommand message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CPredictionEvent_StringCommand.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CPredictionEvent_StringCommand message from the specified reader or buffer.
* @function decode
* @memberof CPredictionEvent_StringCommand
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CPredictionEvent_StringCommand} CPredictionEvent_StringCommand
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CPredictionEvent_StringCommand.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.CPredictionEvent_StringCommand();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.command = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CPredictionEvent_StringCommand message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CPredictionEvent_StringCommand
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CPredictionEvent_StringCommand} CPredictionEvent_StringCommand
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CPredictionEvent_StringCommand.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CPredictionEvent_StringCommand message.
* @function verify
* @memberof CPredictionEvent_StringCommand
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CPredictionEvent_StringCommand.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.command != null && message.hasOwnProperty("command"))
if (!$util.isString(message.command))
return "command: string expected";
return null;
};
/**
* Creates a CPredictionEvent_StringCommand message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CPredictionEvent_StringCommand
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CPredictionEvent_StringCommand} CPredictionEvent_StringCommand
*/
CPredictionEvent_StringCommand.fromObject = function fromObject(object) {
if (object instanceof $root.CPredictionEvent_StringCommand)
return object;
var message = new $root.CPredictionEvent_StringCommand();
if (object.command != null)
message.command = String(object.command);
return message;
};
/**
* Creates a plain object from a CPredictionEvent_StringCommand message. Also converts values to other types if specified.
* @function toObject
* @memberof CPredictionEvent_StringCommand
* @static
* @param {CPredictionEvent_StringCommand} message CPredictionEvent_StringCommand
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CPredictionEvent_StringCommand.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.command = "";
if (message.command != null && message.hasOwnProperty("command"))
object.command = message.command;
return object;
};
/**
* Converts this CPredictionEvent_StringCommand to JSON.
* @function toJSON
* @memberof CPredictionEvent_StringCommand
* @instance
* @returns {Object.<string,*>} JSON object
*/
CPredictionEvent_StringCommand.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CPredictionEvent_StringCommand
* @function getTypeUrl
* @memberof CPredictionEvent_StringCommand
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CPredictionEvent_StringCommand.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/CPredictionEvent_StringCommand";
};
return CPredictionEvent_StringCommand;
})();
$root.CPredictionEvent_Diagnostic = (function() {
/**
* Properties of a CPredictionEvent_Diagnostic.
* @exports ICPredictionEvent_Diagnostic
* @interface ICPredictionEvent_Diagnostic
* @property {number|null} [id] CPredictionEvent_Diagnostic id
* @property {number|null} [requested_sync] CPredictionEvent_Diagnostic requested_sync
* @property {number|null} [requested_player_index] CPredictionEvent_Diagnostic requested_player_index
* @property {Array.<number>|null} [execution_sync] CPredictionEvent_Diagnostic execution_sync
*/
/**
* Constructs a new CPredictionEvent_Diagnostic.
* @exports CPredictionEvent_Diagnostic
* @classdesc Represents a CPredictionEvent_Diagnostic.
* @implements ICPredictionEvent_Diagnostic
* @constructor
* @param {ICPredictionEvent_Diagnostic=} [properties] Properties to set
*/
function CPredictionEvent_Diagnostic(properties) {
this.execution_sync = [];
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]];
}
/**
* CPredictionEvent_Diagnostic id.
* @member {number} id
* @memberof CPredictionEvent_Diagnostic
* @instance
*/
CPredictionEvent_Diagnostic.prototype.id = 0;
/**
* CPredictionEvent_Diagnostic requested_sync.
* @member {number} requested_sync
* @memberof CPredictionEvent_Diagnostic
* @instance
*/
CPredictionEvent_Diagnostic.prototype.requested_sync = 0;
/**
* CPredictionEvent_Diagnostic requested_player_index.
* @member {number} requested_player_index
* @memberof CPredictionEvent_Diagnostic
* @instance
*/
CPredictionEvent_Diagnostic.prototype.requested_player_index = 0;
/**
* CPredictionEvent_Diagnostic execution_sync.
* @member {Array.<number>} execution_sync
* @memberof CPredictionEvent_Diagnostic
* @instance
*/
CPredictionEvent_Diagnostic.prototype.execution_sync = $util.emptyArray;
/**
* Creates a new CPredictionEvent_Diagnostic instance using the specified properties.
* @function create
* @memberof CPredictionEvent_Diagnostic
* @static
* @param {ICPredictionEvent_Diagnostic=} [properties] Properties to set
* @returns {CPredictionEvent_Diagnostic} CPredictionEvent_Diagnostic instance
*/
CPredictionEvent_Diagnostic.create = function create(properties) {
return new CPredictionEvent_Diagnostic(properties);
};
/**
* Encodes the specified CPredictionEvent_Diagnostic message. Does not implicitly {@link CPredictionEvent_Diagnostic.verify|verify} messages.
* @function encode
* @memberof CPredictionEvent_Diagnostic
* @static
* @param {ICPredictionEvent_Diagnostic} message CPredictionEvent_Diagnostic message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CPredictionEvent_Diagnostic.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.id);
if (message.requested_sync != null && Object.hasOwnProperty.call(message, "requested_sync"))
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.requested_sync);
if (message.requested_player_index != null && Object.hasOwnProperty.call(message, "requested_player_index"))
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.requested_player_index);
if (message.execution_sync != null && message.execution_sync.length)
for (var i = 0; i < message.execution_sync.length; ++i)
writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.execution_sync[i]);
return writer;
};
/**
* Encodes the specified CPredictionEvent_Diagnostic message, length delimited. Does not implicitly {@link CPredictionEvent_Diagnostic.verify|verify} messages.
* @function encodeDelimited
* @memberof CPredictionEvent_Diagnostic
* @static
* @param {ICPredictionEvent_Diagnostic} message CPredictionEvent_Diagnostic message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CPredictionEvent_Diagnostic.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CPredictionEvent_Diagnostic message from the specified reader or buffer.
* @function decode
* @memberof CPredictionEvent_Diagnostic
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CPredictionEvent_Diagnostic} CPredictionEvent_Diagnostic
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CPredictionEvent_Diagnostic.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.CPredictionEvent_Diagnostic();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.id = reader.uint32();
break;
}
case 2: {
message.requested_sync = reader.uint32();
break;
}
case 3: {
message.requested_player_index = reader.uint32();
break;
}
case 4: {
if (!(message.execution_sync && message.execution_sync.length))
message.execution_sync = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.execution_sync.push(reader.uint32());
} else
message.execution_sync.push(reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CPredictionEvent_Diagnostic message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CPredictionEvent_Diagnostic
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CPredictionEvent_Diagnostic} CPredictionEvent_Diagnostic
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CPredictionEvent_Diagnostic.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CPredictionEvent_Diagnostic message.
* @function verify
* @memberof CPredictionEvent_Diagnostic
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CPredictionEvent_Diagnostic.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.id != null && message.hasOwnProperty("id"))
if (!$util.isInteger(message.id))
return "id: integer expected";
if (message.requested_sync != null && message.hasOwnProperty("requested_sync"))
if (!$util.isInteger(message.requested_sync))
return "requested_sync: integer expected";
if (message.requested_player_index != null && message.hasOwnProperty("requested_player_index"))
if (!$util.isInteger(message.requested_player_index))
return "requested_player_index: integer expected";
if (message.execution_sync != null && message.hasOwnProperty("execution_sync")) {
if (!Array.isArray(message.execution_sync))
return "execution_sync: array expected";
for (var i = 0; i < message.execution_sync.length; ++i)
if (!$util.isInteger(message.execution_sync[i]))
return "execution_sync: integer[] expected";
}
return null;
};
/**
* Creates a CPredictionEvent_Diagnostic message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CPredictionEvent_Diagnostic
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CPredictionEvent_Diagnostic} CPredictionEvent_Diagnostic
*/
CPredictionEvent_Diagnostic.fromObject = function fromObject(object) {
if (object instanceof $root.CPredictionEvent_Diagnostic)
return object;
var message = new $root.CPredictionEvent_Diagnostic();
if (object.id != null)
message.id = object.id >>> 0;
if (object.requested_sync != null)
message.requested_sync = object.requested_sync >>> 0;
if (object.requested_player_index != null)
message.requested_player_index = object.requested_player_index >>> 0;
if (object.execution_sync) {
if (!Array.isArray(object.execution_sync))
throw TypeError(".CPredictionEvent_Diagnostic.execution_sync: array expected");
message.execution_sync = [];
for (var i = 0; i < object.execution_sync.length; ++i)
message.execution_sync[i] = object.execution_sync[i] >>> 0;
}
return message;
};
/**
* Creates a plain object from a CPredictionEvent_Diagnostic message. Also converts values to other types if specified.
* @function toObject
* @memberof CPredictionEvent_Diagnostic
* @static
* @param {CPredictionEvent_Diagnostic} message CPredictionEvent_Diagnostic
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CPredictionEvent_Diagnostic.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.execution_sync = [];
if (options.defaults) {
object.id = 0;
object.requested_sync = 0;
object.requested_player_index = 0;
}
if (message.id != null && message.hasOwnProperty("id"))
object.id = message.id;
if (message.requested_sync != null && message.hasOwnProperty("requested_sync"))
object.requested_sync = message.requested_sync;
if (message.requested_player_index != null && message.hasOwnProperty("requested_player_index"))
object.requested_player_index = message.requested_player_index;
if (message.execution_sync && message.execution_sync.length) {
object.execution_sync = [];
for (var j = 0; j < message.execution_sync.length; ++j)
object.execution_sync[j] = message.execution_sync[j];
}
return object;
};
/**
* Converts this CPredictionEvent_Diagnostic to JSON.
* @function toJSON
* @memberof CPredictionEvent_Diagnostic
* @instance
* @returns {Object.<string,*>} JSON object
*/
CPredictionEvent_Diagnostic.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CPredictionEvent_Diagnostic
* @function getTypeUrl
* @memberof CPredictionEvent_Diagnostic
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CPredictionEvent_Diagnostic.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/CPredictionEvent_Diagnostic";
};
return CPredictionEvent_Diagnostic;
})();
/**
* SignonState_t enum.
* @exports SignonState_t
* @enum {number}
* @property {number} SIGNONSTATE_NONE=0 SIGNONSTATE_NONE value
* @property {number} SIGNONSTATE_CHALLENGE=1 SIGNONSTATE_CHALLENGE value
* @property {number} SIGNONSTATE_CONNECTED=2 SIGNONSTATE_CONNECTED value
* @property {number} SIGNONSTATE_NEW=3 SIGNONSTATE_NEW value
* @property {number} SIGNONSTATE_PRESPAWN=4 SIGNONSTATE_PRESPAWN value
* @property {number} SIGNONSTATE_SPAWN=5 SIGNONSTATE_SPAWN value
* @property {number} SIGNONSTATE_FULL=6 SIGNONSTATE_FULL value
* @property {number} SIGNONSTATE_CHANGELEVEL=7 SIGNONSTATE_CHANGELEVEL value
*/
$root.SignonState_t = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "SIGNONSTATE_NONE"] = 0;
values[valuesById[1] = "SIGNONSTATE_CHALLENGE"] = 1;
values[valuesById[2] = "SIGNONSTATE_CONNECTED"] = 2;
values[valuesById[3] = "SIGNONSTATE_NEW"] = 3;
values[valuesById[4] = "SIGNONSTATE_PRESPAWN"] = 4;
values[valuesById[5] = "SIGNONSTATE_SPAWN"] = 5;
values[valuesById[6] = "SIGNONSTATE_FULL"] = 6;
values[valuesById[7] = "SIGNONSTATE_CHANGELEVEL"] = 7;
return values;
})();
/**
* NET_Messages enum.
* @exports NET_Messages
* @enum {number}
* @property {number} net_NOP=0 net_NOP value
* @property {number} net_Disconnect_Legacy=1 net_Disconnect_Legacy value
* @property {number} net_SplitScreenUser=3 net_SplitScreenUser value
* @property {number} net_Tick=4 net_Tick value
* @property {number} net_StringCmd=5 net_StringCmd value
* @property {number} net_SetConVar=6 net_SetConVar value
* @property {number} net_SignonState=7 net_SignonState value
* @property {number} net_SpawnGroup_Load=8 net_SpawnGroup_Load value
* @property {number} net_SpawnGroup_ManifestUpdate=9 net_SpawnGroup_ManifestUpdate value
* @property {number} net_SpawnGroup_SetCreationTick=11 net_SpawnGroup_SetCreationTick value
* @property {number} net_SpawnGroup_Unload=12 net_SpawnGroup_Unload value
* @property {number} net_SpawnGroup_LoadCompleted=13 net_SpawnGroup_LoadCompleted value
* @property {number} net_DebugOverlay=15 net_DebugOverlay value
*/
$root.NET_Messages = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "net_NOP"] = 0;
values[valuesById[1] = "net_Disconnect_Legacy"] = 1;
values[valuesById[3] = "net_SplitScreenUser"] = 3;
values[valuesById[4] = "net_Tick"] = 4;
values[valuesById[5] = "net_StringCmd"] = 5;
values[valuesById[6] = "net_SetConVar"] = 6;
values[valuesById[7] = "net_SignonState"] = 7;
values[valuesById[8] = "net_SpawnGroup_Load"] = 8;
values[valuesById[9] = "net_SpawnGroup_ManifestUpdate"] = 9;
values[valuesById[11] = "net_SpawnGroup_SetCreationTick"] = 11;
values[valuesById[12] = "net_SpawnGroup_Unload"] = 12;
values[valuesById[13] = "net_SpawnGroup_LoadCompleted"] = 13;
values[valuesById[15] = "net_DebugOverlay"] = 15;
return values;
})();
/**
* SpawnGroupFlags_t enum.
* @exports SpawnGroupFlags_t
* @enum {number}
* @property {number} SPAWN_GROUP_LOAD_ENTITIES_FROM_SAVE=1 SPAWN_GROUP_LOAD_ENTITIES_FROM_SAVE value
* @property {number} SPAWN_GROUP_DONT_SPAWN_ENTITIES=2 SPAWN_GROUP_DONT_SPAWN_ENTITIES value
* @property {number} SPAWN_GROUP_SYNCHRONOUS_SPAWN=4 SPAWN_GROUP_SYNCHRONOUS_SPAWN value
* @property {number} SPAWN_GROUP_IS_INITIAL_SPAWN_GROUP=8 SPAWN_GROUP_IS_INITIAL_SPAWN_GROUP value
* @property {number} SPAWN_GROUP_CREATE_CLIENT_ONLY_ENTITIES=16 SPAWN_GROUP_CREATE_CLIENT_ONLY_ENTITIES value
* @property {number} SPAWN_GROUP_BLOCK_UNTIL_LOADED=64 SPAWN_GROUP_BLOCK_UNTIL_LOADED value
* @property {number} SPAWN_GROUP_LOAD_STREAMING_DATA=128 SPAWN_GROUP_LOAD_STREAMING_DATA value
* @property {number} SPAWN_GROUP_CREATE_NEW_SCENE_WORLD=256 SPAWN_GROUP_CREATE_NEW_SCENE_WORLD value
*/
$root.SpawnGroupFlags_t = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[1] = "SPAWN_GROUP_LOAD_ENTITIES_FROM_SAVE"] = 1;
values[valuesById[2] = "SPAWN_GROUP_DONT_SPAWN_ENTITIES"] = 2;
values[valuesById[4] = "SPAWN_GROUP_SYNCHRONOUS_SPAWN"] = 4;
values[valuesById[8] = "SPAWN_GROUP_IS_INITIAL_SPAWN_GROUP"] = 8;
values[valuesById[16] = "SPAWN_GROUP_CREATE_CLIENT_ONLY_ENTITIES"] = 16;
values[valuesById[64] = "SPAWN_GROUP_BLOCK_UNTIL_LOADED"] = 64;
values[valuesById[128] = "SPAWN_GROUP_LOAD_STREAMING_DATA"] = 128;
values[valuesById[256] = "SPAWN_GROUP_CREATE_NEW_SCENE_WORLD"] = 256;
return values;
})();
$root.CMsgVector = (function() {
/**
* Properties of a CMsgVector.
* @exports ICMsgVector
* @interface ICMsgVector
* @property {number|null} [x] CMsgVector x
* @property {number|null} [y] CMsgVector y
* @property {number|null} [z] CMsgVector z
* @property {number|null} [w] CMsgVector w
*/
/**
* Constructs a new CMsgVector.
* @exports CMsgVector
* @classdesc Represents a CMsgVector.
* @implements ICMsgVector
* @constructor
* @param {ICMsgVector=} [properties] Properties to set
*/
function CMsgVector(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]];
}
/**
* CMsgVector x.
* @member {number} x
* @memberof CMsgVector
* @instance
*/
CMsgVector.prototype.x = 0;
/**
* CMsgVector y.
* @member {number} y
* @memberof CMsgVector
* @instance
*/
CMsgVector.prototype.y = 0;
/**
* CMsgVector z.
* @member {number} z
* @memberof CMsgVector
* @instance
*/
CMsgVector.prototype.z = 0;
/**
* CMsgVector w.
* @member {number} w
* @memberof CMsgVector
* @instance
*/
CMsgVector.prototype.w = 0;
/**
* Creates a new CMsgVector instance using the specified properties.
* @function create
* @memberof CMsgVector
* @static
* @param {ICMsgVector=} [properties] Properties to set
* @returns {CMsgVector} CMsgVector instance
*/
CMsgVector.create = function create(properties) {
return new CMsgVector(properties);
};
/**
* Encodes the specified CMsgVector message. Does not implicitly {@link CMsgVector.verify|verify} messages.
* @function encode
* @memberof CMsgVector
* @static
* @param {ICMsgVector} message CMsgVector message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgVector.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.x != null && Object.hasOwnProperty.call(message, "x"))
writer.uint32(/* id 1, wireType 5 =*/13).float(message.x);
if (message.y != null && Object.hasOwnProperty.call(message, "y"))
writer.uint32(/* id 2, wireType 5 =*/21).float(message.y);
if (message.z != null && Object.hasOwnProperty.call(message, "z"))
writer.uint32(/* id 3, wireType 5 =*/29).float(message.z);
if (message.w != null && Object.hasOwnProperty.call(message, "w"))
writer.uint32(/* id 4, wireType 5 =*/37).float(message.w);
return writer;
};
/**
* Encodes the specified CMsgVector message, length delimited. Does not implicitly {@link CMsgVector.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgVector
* @static
* @param {ICMsgVector} message CMsgVector message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgVector.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgVector message from the specified reader or buffer.
* @function decode
* @memberof CMsgVector
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgVector} CMsgVector
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgVector.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.CMsgVector();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.x = reader.float();
break;
}
case 2: {
message.y = reader.float();
break;
}
case 3: {
message.z = reader.float();
break;
}
case 4: {
message.w = reader.float();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgVector message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgVector
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgVector} CMsgVector
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgVector.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgVector message.
* @function verify
* @memberof CMsgVector
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgVector.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.x != null && message.hasOwnProperty("x"))
if (typeof message.x !== "number")
return "x: number expected";
if (message.y != null && message.hasOwnProperty("y"))
if (typeof message.y !== "number")
return "y: number expected";
if (message.z != null && message.hasOwnProperty("z"))
if (typeof message.z !== "number")
return "z: number expected";
if (message.w != null && message.hasOwnProperty("w"))
if (typeof message.w !== "number")
return "w: number expected";
return null;
};
/**
* Creates a CMsgVector message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgVector
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgVector} CMsgVector
*/
CMsgVector.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgVector)
return object;
var message = new $root.CMsgVector();
if (object.x != null)
message.x = Number(object.x);
if (object.y != null)
message.y = Number(object.y);
if (object.z != null)
message.z = Number(object.z);
if