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,101 lines (1,035 loc) • 1.09 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"] = {});
/**
* ETEProtobufIds enum.
* @exports ETEProtobufIds
* @enum {number}
* @property {number} TE_EffectDispatchId=400 TE_EffectDispatchId value
* @property {number} TE_ArmorRicochetId=401 TE_ArmorRicochetId value
* @property {number} TE_BeamEntPointId=402 TE_BeamEntPointId value
* @property {number} TE_BeamEntsId=403 TE_BeamEntsId value
* @property {number} TE_BeamPointsId=404 TE_BeamPointsId value
* @property {number} TE_BeamRingId=405 TE_BeamRingId value
* @property {number} TE_BubblesId=408 TE_BubblesId value
* @property {number} TE_BubbleTrailId=409 TE_BubbleTrailId value
* @property {number} TE_DecalId=410 TE_DecalId value
* @property {number} TE_WorldDecalId=411 TE_WorldDecalId value
* @property {number} TE_EnergySplashId=412 TE_EnergySplashId value
* @property {number} TE_FizzId=413 TE_FizzId value
* @property {number} TE_ShatterSurfaceId=414 TE_ShatterSurfaceId value
* @property {number} TE_GlowSpriteId=415 TE_GlowSpriteId value
* @property {number} TE_ImpactId=416 TE_ImpactId value
* @property {number} TE_MuzzleFlashId=417 TE_MuzzleFlashId value
* @property {number} TE_BloodStreamId=418 TE_BloodStreamId value
* @property {number} TE_ExplosionId=419 TE_ExplosionId value
* @property {number} TE_DustId=420 TE_DustId value
* @property {number} TE_LargeFunnelId=421 TE_LargeFunnelId value
* @property {number} TE_SparksId=422 TE_SparksId value
* @property {number} TE_PhysicsPropId=423 TE_PhysicsPropId value
* @property {number} TE_SmokeId=426 TE_SmokeId value
*/
$root.ETEProtobufIds = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[400] = "TE_EffectDispatchId"] = 400;
values[valuesById[401] = "TE_ArmorRicochetId"] = 401;
values[valuesById[402] = "TE_BeamEntPointId"] = 402;
values[valuesById[403] = "TE_BeamEntsId"] = 403;
values[valuesById[404] = "TE_BeamPointsId"] = 404;
values[valuesById[405] = "TE_BeamRingId"] = 405;
values[valuesById[408] = "TE_BubblesId"] = 408;
values[valuesById[409] = "TE_BubbleTrailId"] = 409;
values[valuesById[410] = "TE_DecalId"] = 410;
values[valuesById[411] = "TE_WorldDecalId"] = 411;
values[valuesById[412] = "TE_EnergySplashId"] = 412;
values[valuesById[413] = "TE_FizzId"] = 413;
values[valuesById[414] = "TE_ShatterSurfaceId"] = 414;
values[valuesById[415] = "TE_GlowSpriteId"] = 415;
values[valuesById[416] = "TE_ImpactId"] = 416;
values[valuesById[417] = "TE_MuzzleFlashId"] = 417;
values[valuesById[418] = "TE_BloodStreamId"] = 418;
values[valuesById[419] = "TE_ExplosionId"] = 419;
values[valuesById[420] = "TE_DustId"] = 420;
values[valuesById[421] = "TE_LargeFunnelId"] = 421;
values[valuesById[422] = "TE_SparksId"] = 422;
values[valuesById[423] = "TE_PhysicsPropId"] = 423;
values[valuesById[426] = "TE_SmokeId"] = 426;
return values;
})();
$root.CMsgTEArmorRicochet = (function() {
/**
* Properties of a CMsgTEArmorRicochet.
* @exports ICMsgTEArmorRicochet
* @interface ICMsgTEArmorRicochet
* @property {ICMsgVector|null} [pos] CMsgTEArmorRicochet pos
* @property {ICMsgVector|null} [dir] CMsgTEArmorRicochet dir
*/
/**
* Constructs a new CMsgTEArmorRicochet.
* @exports CMsgTEArmorRicochet
* @classdesc Represents a CMsgTEArmorRicochet.
* @implements ICMsgTEArmorRicochet
* @constructor
* @param {ICMsgTEArmorRicochet=} [properties] Properties to set
*/
function CMsgTEArmorRicochet(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]];
}
/**
* CMsgTEArmorRicochet pos.
* @member {ICMsgVector|null|undefined} pos
* @memberof CMsgTEArmorRicochet
* @instance
*/
CMsgTEArmorRicochet.prototype.pos = null;
/**
* CMsgTEArmorRicochet dir.
* @member {ICMsgVector|null|undefined} dir
* @memberof CMsgTEArmorRicochet
* @instance
*/
CMsgTEArmorRicochet.prototype.dir = null;
/**
* Creates a new CMsgTEArmorRicochet instance using the specified properties.
* @function create
* @memberof CMsgTEArmorRicochet
* @static
* @param {ICMsgTEArmorRicochet=} [properties] Properties to set
* @returns {CMsgTEArmorRicochet} CMsgTEArmorRicochet instance
*/
CMsgTEArmorRicochet.create = function create(properties) {
return new CMsgTEArmorRicochet(properties);
};
/**
* Encodes the specified CMsgTEArmorRicochet message. Does not implicitly {@link CMsgTEArmorRicochet.verify|verify} messages.
* @function encode
* @memberof CMsgTEArmorRicochet
* @static
* @param {ICMsgTEArmorRicochet} message CMsgTEArmorRicochet message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgTEArmorRicochet.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.pos != null && Object.hasOwnProperty.call(message, "pos"))
$root.CMsgVector.encode(message.pos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.dir != null && Object.hasOwnProperty.call(message, "dir"))
$root.CMsgVector.encode(message.dir, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgTEArmorRicochet message, length delimited. Does not implicitly {@link CMsgTEArmorRicochet.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgTEArmorRicochet
* @static
* @param {ICMsgTEArmorRicochet} message CMsgTEArmorRicochet message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgTEArmorRicochet.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgTEArmorRicochet message from the specified reader or buffer.
* @function decode
* @memberof CMsgTEArmorRicochet
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgTEArmorRicochet} CMsgTEArmorRicochet
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgTEArmorRicochet.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.CMsgTEArmorRicochet();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.pos = $root.CMsgVector.decode(reader, reader.uint32());
break;
}
case 2: {
message.dir = $root.CMsgVector.decode(reader, reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgTEArmorRicochet message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgTEArmorRicochet
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgTEArmorRicochet} CMsgTEArmorRicochet
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgTEArmorRicochet.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgTEArmorRicochet message.
* @function verify
* @memberof CMsgTEArmorRicochet
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgTEArmorRicochet.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.pos != null && message.hasOwnProperty("pos")) {
var error = $root.CMsgVector.verify(message.pos);
if (error)
return "pos." + error;
}
if (message.dir != null && message.hasOwnProperty("dir")) {
var error = $root.CMsgVector.verify(message.dir);
if (error)
return "dir." + error;
}
return null;
};
/**
* Creates a CMsgTEArmorRicochet message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgTEArmorRicochet
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgTEArmorRicochet} CMsgTEArmorRicochet
*/
CMsgTEArmorRicochet.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgTEArmorRicochet)
return object;
var message = new $root.CMsgTEArmorRicochet();
if (object.pos != null) {
if (typeof object.pos !== "object")
throw TypeError(".CMsgTEArmorRicochet.pos: object expected");
message.pos = $root.CMsgVector.fromObject(object.pos);
}
if (object.dir != null) {
if (typeof object.dir !== "object")
throw TypeError(".CMsgTEArmorRicochet.dir: object expected");
message.dir = $root.CMsgVector.fromObject(object.dir);
}
return message;
};
/**
* Creates a plain object from a CMsgTEArmorRicochet message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgTEArmorRicochet
* @static
* @param {CMsgTEArmorRicochet} message CMsgTEArmorRicochet
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgTEArmorRicochet.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.pos = null;
object.dir = null;
}
if (message.pos != null && message.hasOwnProperty("pos"))
object.pos = $root.CMsgVector.toObject(message.pos, options);
if (message.dir != null && message.hasOwnProperty("dir"))
object.dir = $root.CMsgVector.toObject(message.dir, options);
return object;
};
/**
* Converts this CMsgTEArmorRicochet to JSON.
* @function toJSON
* @memberof CMsgTEArmorRicochet
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgTEArmorRicochet.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CMsgTEArmorRicochet
* @function getTypeUrl
* @memberof CMsgTEArmorRicochet
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CMsgTEArmorRicochet.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/CMsgTEArmorRicochet";
};
return CMsgTEArmorRicochet;
})();
$root.CMsgTEBaseBeam = (function() {
/**
* Properties of a CMsgTEBaseBeam.
* @exports ICMsgTEBaseBeam
* @interface ICMsgTEBaseBeam
* @property {number|Long|null} [modelindex] CMsgTEBaseBeam modelindex
* @property {number|Long|null} [haloindex] CMsgTEBaseBeam haloindex
* @property {number|null} [startframe] CMsgTEBaseBeam startframe
* @property {number|null} [framerate] CMsgTEBaseBeam framerate
* @property {number|null} [life] CMsgTEBaseBeam life
* @property {number|null} [width] CMsgTEBaseBeam width
* @property {number|null} [endwidth] CMsgTEBaseBeam endwidth
* @property {number|null} [fadelength] CMsgTEBaseBeam fadelength
* @property {number|null} [amplitude] CMsgTEBaseBeam amplitude
* @property {number|null} [color] CMsgTEBaseBeam color
* @property {number|null} [speed] CMsgTEBaseBeam speed
* @property {number|null} [flags] CMsgTEBaseBeam flags
*/
/**
* Constructs a new CMsgTEBaseBeam.
* @exports CMsgTEBaseBeam
* @classdesc Represents a CMsgTEBaseBeam.
* @implements ICMsgTEBaseBeam
* @constructor
* @param {ICMsgTEBaseBeam=} [properties] Properties to set
*/
function CMsgTEBaseBeam(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]];
}
/**
* CMsgTEBaseBeam modelindex.
* @member {number|Long} modelindex
* @memberof CMsgTEBaseBeam
* @instance
*/
CMsgTEBaseBeam.prototype.modelindex = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* CMsgTEBaseBeam haloindex.
* @member {number|Long} haloindex
* @memberof CMsgTEBaseBeam
* @instance
*/
CMsgTEBaseBeam.prototype.haloindex = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* CMsgTEBaseBeam startframe.
* @member {number} startframe
* @memberof CMsgTEBaseBeam
* @instance
*/
CMsgTEBaseBeam.prototype.startframe = 0;
/**
* CMsgTEBaseBeam framerate.
* @member {number} framerate
* @memberof CMsgTEBaseBeam
* @instance
*/
CMsgTEBaseBeam.prototype.framerate = 0;
/**
* CMsgTEBaseBeam life.
* @member {number} life
* @memberof CMsgTEBaseBeam
* @instance
*/
CMsgTEBaseBeam.prototype.life = 0;
/**
* CMsgTEBaseBeam width.
* @member {number} width
* @memberof CMsgTEBaseBeam
* @instance
*/
CMsgTEBaseBeam.prototype.width = 0;
/**
* CMsgTEBaseBeam endwidth.
* @member {number} endwidth
* @memberof CMsgTEBaseBeam
* @instance
*/
CMsgTEBaseBeam.prototype.endwidth = 0;
/**
* CMsgTEBaseBeam fadelength.
* @member {number} fadelength
* @memberof CMsgTEBaseBeam
* @instance
*/
CMsgTEBaseBeam.prototype.fadelength = 0;
/**
* CMsgTEBaseBeam amplitude.
* @member {number} amplitude
* @memberof CMsgTEBaseBeam
* @instance
*/
CMsgTEBaseBeam.prototype.amplitude = 0;
/**
* CMsgTEBaseBeam color.
* @member {number} color
* @memberof CMsgTEBaseBeam
* @instance
*/
CMsgTEBaseBeam.prototype.color = 0;
/**
* CMsgTEBaseBeam speed.
* @member {number} speed
* @memberof CMsgTEBaseBeam
* @instance
*/
CMsgTEBaseBeam.prototype.speed = 0;
/**
* CMsgTEBaseBeam flags.
* @member {number} flags
* @memberof CMsgTEBaseBeam
* @instance
*/
CMsgTEBaseBeam.prototype.flags = 0;
/**
* Creates a new CMsgTEBaseBeam instance using the specified properties.
* @function create
* @memberof CMsgTEBaseBeam
* @static
* @param {ICMsgTEBaseBeam=} [properties] Properties to set
* @returns {CMsgTEBaseBeam} CMsgTEBaseBeam instance
*/
CMsgTEBaseBeam.create = function create(properties) {
return new CMsgTEBaseBeam(properties);
};
/**
* Encodes the specified CMsgTEBaseBeam message. Does not implicitly {@link CMsgTEBaseBeam.verify|verify} messages.
* @function encode
* @memberof CMsgTEBaseBeam
* @static
* @param {ICMsgTEBaseBeam} message CMsgTEBaseBeam message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgTEBaseBeam.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.modelindex != null && Object.hasOwnProperty.call(message, "modelindex"))
writer.uint32(/* id 1, wireType 1 =*/9).fixed64(message.modelindex);
if (message.haloindex != null && Object.hasOwnProperty.call(message, "haloindex"))
writer.uint32(/* id 2, wireType 1 =*/17).fixed64(message.haloindex);
if (message.startframe != null && Object.hasOwnProperty.call(message, "startframe"))
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.startframe);
if (message.framerate != null && Object.hasOwnProperty.call(message, "framerate"))
writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.framerate);
if (message.life != null && Object.hasOwnProperty.call(message, "life"))
writer.uint32(/* id 5, wireType 5 =*/45).float(message.life);
if (message.width != null && Object.hasOwnProperty.call(message, "width"))
writer.uint32(/* id 6, wireType 5 =*/53).float(message.width);
if (message.endwidth != null && Object.hasOwnProperty.call(message, "endwidth"))
writer.uint32(/* id 7, wireType 5 =*/61).float(message.endwidth);
if (message.fadelength != null && Object.hasOwnProperty.call(message, "fadelength"))
writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.fadelength);
if (message.amplitude != null && Object.hasOwnProperty.call(message, "amplitude"))
writer.uint32(/* id 9, wireType 5 =*/77).float(message.amplitude);
if (message.color != null && Object.hasOwnProperty.call(message, "color"))
writer.uint32(/* id 10, wireType 5 =*/85).fixed32(message.color);
if (message.speed != null && Object.hasOwnProperty.call(message, "speed"))
writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.speed);
if (message.flags != null && Object.hasOwnProperty.call(message, "flags"))
writer.uint32(/* id 12, wireType 0 =*/96).uint32(message.flags);
return writer;
};
/**
* Encodes the specified CMsgTEBaseBeam message, length delimited. Does not implicitly {@link CMsgTEBaseBeam.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgTEBaseBeam
* @static
* @param {ICMsgTEBaseBeam} message CMsgTEBaseBeam message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgTEBaseBeam.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgTEBaseBeam message from the specified reader or buffer.
* @function decode
* @memberof CMsgTEBaseBeam
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgTEBaseBeam} CMsgTEBaseBeam
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgTEBaseBeam.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.CMsgTEBaseBeam();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.modelindex = reader.fixed64();
break;
}
case 2: {
message.haloindex = reader.fixed64();
break;
}
case 3: {
message.startframe = reader.uint32();
break;
}
case 4: {
message.framerate = reader.uint32();
break;
}
case 5: {
message.life = reader.float();
break;
}
case 6: {
message.width = reader.float();
break;
}
case 7: {
message.endwidth = reader.float();
break;
}
case 8: {
message.fadelength = reader.uint32();
break;
}
case 9: {
message.amplitude = reader.float();
break;
}
case 10: {
message.color = reader.fixed32();
break;
}
case 11: {
message.speed = reader.uint32();
break;
}
case 12: {
message.flags = reader.uint32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgTEBaseBeam message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgTEBaseBeam
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgTEBaseBeam} CMsgTEBaseBeam
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgTEBaseBeam.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgTEBaseBeam message.
* @function verify
* @memberof CMsgTEBaseBeam
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgTEBaseBeam.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.modelindex != null && message.hasOwnProperty("modelindex"))
if (!$util.isInteger(message.modelindex) && !(message.modelindex && $util.isInteger(message.modelindex.low) && $util.isInteger(message.modelindex.high)))
return "modelindex: integer|Long expected";
if (message.haloindex != null && message.hasOwnProperty("haloindex"))
if (!$util.isInteger(message.haloindex) && !(message.haloindex && $util.isInteger(message.haloindex.low) && $util.isInteger(message.haloindex.high)))
return "haloindex: integer|Long expected";
if (message.startframe != null && message.hasOwnProperty("startframe"))
if (!$util.isInteger(message.startframe))
return "startframe: integer expected";
if (message.framerate != null && message.hasOwnProperty("framerate"))
if (!$util.isInteger(message.framerate))
return "framerate: integer expected";
if (message.life != null && message.hasOwnProperty("life"))
if (typeof message.life !== "number")
return "life: number expected";
if (message.width != null && message.hasOwnProperty("width"))
if (typeof message.width !== "number")
return "width: number expected";
if (message.endwidth != null && message.hasOwnProperty("endwidth"))
if (typeof message.endwidth !== "number")
return "endwidth: number expected";
if (message.fadelength != null && message.hasOwnProperty("fadelength"))
if (!$util.isInteger(message.fadelength))
return "fadelength: integer expected";
if (message.amplitude != null && message.hasOwnProperty("amplitude"))
if (typeof message.amplitude !== "number")
return "amplitude: number expected";
if (message.color != null && message.hasOwnProperty("color"))
if (!$util.isInteger(message.color))
return "color: integer expected";
if (message.speed != null && message.hasOwnProperty("speed"))
if (!$util.isInteger(message.speed))
return "speed: integer expected";
if (message.flags != null && message.hasOwnProperty("flags"))
if (!$util.isInteger(message.flags))
return "flags: integer expected";
return null;
};
/**
* Creates a CMsgTEBaseBeam message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgTEBaseBeam
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgTEBaseBeam} CMsgTEBaseBeam
*/
CMsgTEBaseBeam.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgTEBaseBeam)
return object;
var message = new $root.CMsgTEBaseBeam();
if (object.modelindex != null)
if ($util.Long)
(message.modelindex = $util.Long.fromValue(object.modelindex)).unsigned = false;
else if (typeof object.modelindex === "string")
message.modelindex = parseInt(object.modelindex, 10);
else if (typeof object.modelindex === "number")
message.modelindex = object.modelindex;
else if (typeof object.modelindex === "object")
message.modelindex = new $util.LongBits(object.modelindex.low >>> 0, object.modelindex.high >>> 0).toNumber();
if (object.haloindex != null)
if ($util.Long)
(message.haloindex = $util.Long.fromValue(object.haloindex)).unsigned = false;
else if (typeof object.haloindex === "string")
message.haloindex = parseInt(object.haloindex, 10);
else if (typeof object.haloindex === "number")
message.haloindex = object.haloindex;
else if (typeof object.haloindex === "object")
message.haloindex = new $util.LongBits(object.haloindex.low >>> 0, object.haloindex.high >>> 0).toNumber();
if (object.startframe != null)
message.startframe = object.startframe >>> 0;
if (object.framerate != null)
message.framerate = object.framerate >>> 0;
if (object.life != null)
message.life = Number(object.life);
if (object.width != null)
message.width = Number(object.width);
if (object.endwidth != null)
message.endwidth = Number(object.endwidth);
if (object.fadelength != null)
message.fadelength = object.fadelength >>> 0;
if (object.amplitude != null)
message.amplitude = Number(object.amplitude);
if (object.color != null)
message.color = object.color >>> 0;
if (object.speed != null)
message.speed = object.speed >>> 0;
if (object.flags != null)
message.flags = object.flags >>> 0;
return message;
};
/**
* Creates a plain object from a CMsgTEBaseBeam message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgTEBaseBeam
* @static
* @param {CMsgTEBaseBeam} message CMsgTEBaseBeam
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgTEBaseBeam.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.modelindex = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.modelindex = options.longs === String ? "0" : 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.haloindex = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.haloindex = options.longs === String ? "0" : 0;
object.startframe = 0;
object.framerate = 0;
object.life = 0;
object.width = 0;
object.endwidth = 0;
object.fadelength = 0;
object.amplitude = 0;
object.color = 0;
object.speed = 0;
object.flags = 0;
}
if (message.modelindex != null && message.hasOwnProperty("modelindex"))
if (typeof message.modelindex === "number")
object.modelindex = options.longs === String ? String(message.modelindex) : message.modelindex;
else
object.modelindex = options.longs === String ? $util.Long.prototype.toString.call(message.modelindex) : options.longs === Number ? new $util.LongBits(message.modelindex.low >>> 0, message.modelindex.high >>> 0).toNumber() : message.modelindex;
if (message.haloindex != null && message.hasOwnProperty("haloindex"))
if (typeof message.haloindex === "number")
object.haloindex = options.longs === String ? String(message.haloindex) : message.haloindex;
else
object.haloindex = options.longs === String ? $util.Long.prototype.toString.call(message.haloindex) : options.longs === Number ? new $util.LongBits(message.haloindex.low >>> 0, message.haloindex.high >>> 0).toNumber() : message.haloindex;
if (message.startframe != null && message.hasOwnProperty("startframe"))
object.startframe = message.startframe;
if (message.framerate != null && message.hasOwnProperty("framerate"))
object.framerate = message.framerate;
if (message.life != null && message.hasOwnProperty("life"))
object.life = options.json && !isFinite(message.life) ? String(message.life) : message.life;
if (message.width != null && message.hasOwnProperty("width"))
object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width;
if (message.endwidth != null && message.hasOwnProperty("endwidth"))
object.endwidth = options.json && !isFinite(message.endwidth) ? String(message.endwidth) : message.endwidth;
if (message.fadelength != null && message.hasOwnProperty("fadelength"))
object.fadelength = message.fadelength;
if (message.amplitude != null && message.hasOwnProperty("amplitude"))
object.amplitude = options.json && !isFinite(message.amplitude) ? String(message.amplitude) : message.amplitude;
if (message.color != null && message.hasOwnProperty("color"))
object.color = message.color;
if (message.speed != null && message.hasOwnProperty("speed"))
object.speed = message.speed;
if (message.flags != null && message.hasOwnProperty("flags"))
object.flags = message.flags;
return object;
};
/**
* Converts this CMsgTEBaseBeam to JSON.
* @function toJSON
* @memberof CMsgTEBaseBeam
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgTEBaseBeam.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CMsgTEBaseBeam
* @function getTypeUrl
* @memberof CMsgTEBaseBeam
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CMsgTEBaseBeam.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/CMsgTEBaseBeam";
};
return CMsgTEBaseBeam;
})();
$root.CMsgTEBeamEntPoint = (function() {
/**
* Properties of a CMsgTEBeamEntPoint.
* @exports ICMsgTEBeamEntPoint
* @interface ICMsgTEBeamEntPoint
* @property {ICMsgTEBaseBeam|null} [base] CMsgTEBeamEntPoint base
* @property {number|null} [startentity] CMsgTEBeamEntPoint startentity
* @property {number|null} [endentity] CMsgTEBeamEntPoint endentity
* @property {ICMsgVector|null} [start] CMsgTEBeamEntPoint start
* @property {ICMsgVector|null} [end] CMsgTEBeamEntPoint end
*/
/**
* Constructs a new CMsgTEBeamEntPoint.
* @exports CMsgTEBeamEntPoint
* @classdesc Represents a CMsgTEBeamEntPoint.
* @implements ICMsgTEBeamEntPoint
* @constructor
* @param {ICMsgTEBeamEntPoint=} [properties] Properties to set
*/
function CMsgTEBeamEntPoint(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]];
}
/**
* CMsgTEBeamEntPoint base.
* @member {ICMsgTEBaseBeam|null|undefined} base
* @memberof CMsgTEBeamEntPoint
* @instance
*/
CMsgTEBeamEntPoint.prototype.base = null;
/**
* CMsgTEBeamEntPoint startentity.
* @member {number} startentity
* @memberof CMsgTEBeamEntPoint
* @instance
*/
CMsgTEBeamEntPoint.prototype.startentity = 0;
/**
* CMsgTEBeamEntPoint endentity.
* @member {number} endentity
* @memberof CMsgTEBeamEntPoint
* @instance
*/
CMsgTEBeamEntPoint.prototype.endentity = 0;
/**
* CMsgTEBeamEntPoint start.
* @member {ICMsgVector|null|undefined} start
* @memberof CMsgTEBeamEntPoint
* @instance
*/
CMsgTEBeamEntPoint.prototype.start = null;
/**
* CMsgTEBeamEntPoint end.
* @member {ICMsgVector|null|undefined} end
* @memberof CMsgTEBeamEntPoint
* @instance
*/
CMsgTEBeamEntPoint.prototype.end = null;
/**
* Creates a new CMsgTEBeamEntPoint instance using the specified properties.
* @function create
* @memberof CMsgTEBeamEntPoint
* @static
* @param {ICMsgTEBeamEntPoint=} [properties] Properties to set
* @returns {CMsgTEBeamEntPoint} CMsgTEBeamEntPoint instance
*/
CMsgTEBeamEntPoint.create = function create(properties) {
return new CMsgTEBeamEntPoint(properties);
};
/**
* Encodes the specified CMsgTEBeamEntPoint message. Does not implicitly {@link CMsgTEBeamEntPoint.verify|verify} messages.
* @function encode
* @memberof CMsgTEBeamEntPoint
* @static
* @param {ICMsgTEBeamEntPoint} message CMsgTEBeamEntPoint message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgTEBeamEntPoint.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.base != null && Object.hasOwnProperty.call(message, "base"))
$root.CMsgTEBaseBeam.encode(message.base, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
if (message.startentity != null && Object.hasOwnProperty.call(message, "startentity"))
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.startentity);
if (message.endentity != null && Object.hasOwnProperty.call(message, "endentity"))
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.endentity);
if (message.start != null && Object.hasOwnProperty.call(message, "start"))
$root.CMsgVector.encode(message.start, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
if (message.end != null && Object.hasOwnProperty.call(message, "end"))
$root.CMsgVector.encode(message.end, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgTEBeamEntPoint message, length delimited. Does not implicitly {@link CMsgTEBeamEntPoint.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgTEBeamEntPoint
* @static
* @param {ICMsgTEBeamEntPoint} message CMsgTEBeamEntPoint message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgTEBeamEntPoint.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgTEBeamEntPoint message from the specified reader or buffer.
* @function decode
* @memberof CMsgTEBeamEntPoint
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgTEBeamEntPoint} CMsgTEBeamEntPoint
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgTEBeamEntPoint.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.CMsgTEBeamEntPoint();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.base = $root.CMsgTEBaseBeam.decode(reader, reader.uint32());
break;
}
case 2: {
message.startentity = reader.uint32();
break;
}
case 3: {
message.endentity = reader.uint32();
break;
}
case 4: {
message.start = $root.CMsgVector.decode(reader, reader.uint32());
break;
}
case 5: {
message.end = $root.CMsgVector.decode(reader, reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgTEBeamEntPoint message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgTEBeamEntPoint
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgTEBeamEntPoint} CMsgTEBeamEntPoint
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgTEBeamEntPoint.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgTEBeamEntPoint message.
* @function verify
* @memberof CMsgTEBeamEntPoint
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgTEBeamEntPoint.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.base != null && message.hasOwnProperty("base")) {
var error = $root.CMsgTEBaseBeam.verify(message.base);
if (error)
return "base." + error;
}
if (message.startentity != null && message.hasOwnProperty("startentity"))
if (!$util.isInteger(message.startentity))
return "startentity: integer expected";
if (message.endentity != null && message.hasOwnProperty("endentity"))
if (!$util.isInteger(message.endentity))
return "endentity: integer expected";
if (message.start != null && message.hasOwnProperty("start")) {
var error = $root.CMsgVector.verify(message.start);
if (error)
return "start." + error;
}
if (message.end != null && message.hasOwnProperty("end")) {
var error = $root.CMsgVector.verify(message.end);
if (error)
return "end." + error;
}
return null;
};
/**
* Creates a CMsgTEBeamEntPoint message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgTEBeamEntPoint
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgTEBeamEntPoint} CMsgTEBeamEntPoint
*/
CMsgTEBeamEntPoint.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgTEBeamEntPoint)
return object;
var message = new $root.CMsgTEBeamEntPoint();
if (object.base != null) {
if (typeof object.base !== "object")
throw TypeError(".CMsgTEBeamEntPoint.base: object expected");
message.base = $root.CMsgTEBaseBeam.fromObject(object.base);
}
if (object.startentity != null)
message.startentity = object.startentity >>> 0;
if (object.endentity != null)
message.endentity = object.endentity >>> 0;
if (object.start != null) {
if (typeof object.start !== "object")
throw TypeError(".CMsgTEBeamEntPoint.start: object expected");
message.start = $root.CMsgVector.fromObject(object.start);
}
if (object.end != null) {
if (typeof object.end !== "object")
throw TypeError(".CMsgTEBeamEntPoint.end: object expected");
message.end = $root.CMsgVector.fromObject(object.end);
}
return message;
};
/**
* Creates a plain object from a CMsgTEBeamEntPoint message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgTEBeamEntPoint
* @static
* @param {CMsgTEBeamEntPoint} message CMsgTEBeamEntPoint
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgTEBeamEntPoint.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.base = null;
object.startentity = 0;
object.endentity = 0;
object.start = null;
object.end = null;
}
if (message.base != null && message.hasOwnProperty("base"))
object.base = $root.CMsgTEBaseBeam.toObject(message.base, options);
if (message.startentity != null && message.hasOwnProperty("startentity"))
object.startentity = message.startentity;
if (message.endentity != null && message.hasOwnProperty("endentity"))
object.endentity = message.endentity;
if (message.start != null && message.hasOwnProperty("start"))
object.start = $root.CMsgVector.toObject(message.start, options);
if (message.end != null && message.hasOwnProperty("end"))
object.end = $root.CMsgVector.toObject(message.end, options);
return object;
};
/**
* Converts this CMsgTEBeamEntPoint to JSON.
* @function toJSON
* @memberof CMsgTEBeamEntPoint
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgTEBeamEntPoint.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CMsgTEBeamEntPoint
* @function getTypeUrl
* @memberof CMsgTEBeamEntPoint
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.go