UNPKG

node-cs2

Version:

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

1,100 lines (1,030 loc) 5.46 MB
/*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"] = {}); /** * ECstrike15UserMessages enum. * @exports ECstrike15UserMessages * @enum {number} * @property {number} CS_UM_VGUIMenu=301 CS_UM_VGUIMenu value * @property {number} CS_UM_Geiger=302 CS_UM_Geiger value * @property {number} CS_UM_Train=303 CS_UM_Train value * @property {number} CS_UM_HudText=304 CS_UM_HudText value * @property {number} CS_UM_SayText=305 CS_UM_SayText value * @property {number} CS_UM_SayText2=306 CS_UM_SayText2 value * @property {number} CS_UM_TextMsg=307 CS_UM_TextMsg value * @property {number} CS_UM_HudMsg=308 CS_UM_HudMsg value * @property {number} CS_UM_ResetHud=309 CS_UM_ResetHud value * @property {number} CS_UM_GameTitle=310 CS_UM_GameTitle value * @property {number} CS_UM_Shake=312 CS_UM_Shake value * @property {number} CS_UM_Fade=313 CS_UM_Fade value * @property {number} CS_UM_Rumble=314 CS_UM_Rumble value * @property {number} CS_UM_CloseCaption=315 CS_UM_CloseCaption value * @property {number} CS_UM_CloseCaptionDirect=316 CS_UM_CloseCaptionDirect value * @property {number} CS_UM_SendAudio=317 CS_UM_SendAudio value * @property {number} CS_UM_RawAudio=318 CS_UM_RawAudio value * @property {number} CS_UM_VoiceMask=319 CS_UM_VoiceMask value * @property {number} CS_UM_RequestState=320 CS_UM_RequestState value * @property {number} CS_UM_Damage=321 CS_UM_Damage value * @property {number} CS_UM_RadioText=322 CS_UM_RadioText value * @property {number} CS_UM_HintText=323 CS_UM_HintText value * @property {number} CS_UM_KeyHintText=324 CS_UM_KeyHintText value * @property {number} CS_UM_ProcessSpottedEntityUpdate=325 CS_UM_ProcessSpottedEntityUpdate value * @property {number} CS_UM_ReloadEffect=326 CS_UM_ReloadEffect value * @property {number} CS_UM_AdjustMoney=327 CS_UM_AdjustMoney value * @property {number} CS_UM_UpdateTeamMoney=328 CS_UM_UpdateTeamMoney value * @property {number} CS_UM_StopSpectatorMode=329 CS_UM_StopSpectatorMode value * @property {number} CS_UM_KillCam=330 CS_UM_KillCam value * @property {number} CS_UM_DesiredTimescale=331 CS_UM_DesiredTimescale value * @property {number} CS_UM_CurrentTimescale=332 CS_UM_CurrentTimescale value * @property {number} CS_UM_AchievementEvent=333 CS_UM_AchievementEvent value * @property {number} CS_UM_MatchEndConditions=334 CS_UM_MatchEndConditions value * @property {number} CS_UM_DisconnectToLobby=335 CS_UM_DisconnectToLobby value * @property {number} CS_UM_PlayerStatsUpdate=336 CS_UM_PlayerStatsUpdate value * @property {number} CS_UM_ClientInfo=339 CS_UM_ClientInfo value * @property {number} CS_UM_XRankGet=340 CS_UM_XRankGet value * @property {number} CS_UM_XRankUpd=341 CS_UM_XRankUpd value * @property {number} CS_UM_CallVoteFailed=345 CS_UM_CallVoteFailed value * @property {number} CS_UM_VoteStart=346 CS_UM_VoteStart value * @property {number} CS_UM_VotePass=347 CS_UM_VotePass value * @property {number} CS_UM_VoteFailed=348 CS_UM_VoteFailed value * @property {number} CS_UM_VoteSetup=349 CS_UM_VoteSetup value * @property {number} CS_UM_ServerRankRevealAll=350 CS_UM_ServerRankRevealAll value * @property {number} CS_UM_SendLastKillerDamageToClient=351 CS_UM_SendLastKillerDamageToClient value * @property {number} CS_UM_ServerRankUpdate=352 CS_UM_ServerRankUpdate value * @property {number} CS_UM_ItemPickup=353 CS_UM_ItemPickup value * @property {number} CS_UM_ShowMenu=354 CS_UM_ShowMenu value * @property {number} CS_UM_BarTime=355 CS_UM_BarTime value * @property {number} CS_UM_AmmoDenied=356 CS_UM_AmmoDenied value * @property {number} CS_UM_MarkAchievement=357 CS_UM_MarkAchievement value * @property {number} CS_UM_MatchStatsUpdate=358 CS_UM_MatchStatsUpdate value * @property {number} CS_UM_ItemDrop=359 CS_UM_ItemDrop value * @property {number} CS_UM_SendPlayerItemDrops=361 CS_UM_SendPlayerItemDrops value * @property {number} CS_UM_RoundBackupFilenames=362 CS_UM_RoundBackupFilenames value * @property {number} CS_UM_SendPlayerItemFound=363 CS_UM_SendPlayerItemFound value * @property {number} CS_UM_ReportHit=364 CS_UM_ReportHit value * @property {number} CS_UM_XpUpdate=365 CS_UM_XpUpdate value * @property {number} CS_UM_QuestProgress=366 CS_UM_QuestProgress value * @property {number} CS_UM_ScoreLeaderboardData=367 CS_UM_ScoreLeaderboardData value * @property {number} CS_UM_PlayerDecalDigitalSignature=368 CS_UM_PlayerDecalDigitalSignature value * @property {number} CS_UM_WeaponSound=369 CS_UM_WeaponSound value * @property {number} CS_UM_UpdateScreenHealthBar=370 CS_UM_UpdateScreenHealthBar value * @property {number} CS_UM_EntityOutlineHighlight=371 CS_UM_EntityOutlineHighlight value * @property {number} CS_UM_SSUI=372 CS_UM_SSUI value * @property {number} CS_UM_SurvivalStats=373 CS_UM_SurvivalStats value * @property {number} CS_UM_DisconnectToLobby2=374 CS_UM_DisconnectToLobby2 value * @property {number} CS_UM_EndOfMatchAllPlayersData=375 CS_UM_EndOfMatchAllPlayersData value * @property {number} CS_UM_PostRoundDamageReport=376 CS_UM_PostRoundDamageReport value * @property {number} CS_UM_RoundEndReportData=379 CS_UM_RoundEndReportData value * @property {number} CS_UM_CurrentRoundOdds=380 CS_UM_CurrentRoundOdds value * @property {number} CS_UM_DeepStats=381 CS_UM_DeepStats value * @property {number} CS_UM_ShootInfo=383 CS_UM_ShootInfo value * @property {number} CS_UM_CounterStrafe=385 CS_UM_CounterStrafe value * @property {number} CS_UM_DamagePrediction=386 CS_UM_DamagePrediction value * @property {number} CS_UM_RecurringMissionSchema=387 CS_UM_RecurringMissionSchema value * @property {number} CS_UM_SendPlayerLoadout=388 CS_UM_SendPlayerLoadout value */ $root.ECstrike15UserMessages = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[301] = "CS_UM_VGUIMenu"] = 301; values[valuesById[302] = "CS_UM_Geiger"] = 302; values[valuesById[303] = "CS_UM_Train"] = 303; values[valuesById[304] = "CS_UM_HudText"] = 304; values[valuesById[305] = "CS_UM_SayText"] = 305; values[valuesById[306] = "CS_UM_SayText2"] = 306; values[valuesById[307] = "CS_UM_TextMsg"] = 307; values[valuesById[308] = "CS_UM_HudMsg"] = 308; values[valuesById[309] = "CS_UM_ResetHud"] = 309; values[valuesById[310] = "CS_UM_GameTitle"] = 310; values[valuesById[312] = "CS_UM_Shake"] = 312; values[valuesById[313] = "CS_UM_Fade"] = 313; values[valuesById[314] = "CS_UM_Rumble"] = 314; values[valuesById[315] = "CS_UM_CloseCaption"] = 315; values[valuesById[316] = "CS_UM_CloseCaptionDirect"] = 316; values[valuesById[317] = "CS_UM_SendAudio"] = 317; values[valuesById[318] = "CS_UM_RawAudio"] = 318; values[valuesById[319] = "CS_UM_VoiceMask"] = 319; values[valuesById[320] = "CS_UM_RequestState"] = 320; values[valuesById[321] = "CS_UM_Damage"] = 321; values[valuesById[322] = "CS_UM_RadioText"] = 322; values[valuesById[323] = "CS_UM_HintText"] = 323; values[valuesById[324] = "CS_UM_KeyHintText"] = 324; values[valuesById[325] = "CS_UM_ProcessSpottedEntityUpdate"] = 325; values[valuesById[326] = "CS_UM_ReloadEffect"] = 326; values[valuesById[327] = "CS_UM_AdjustMoney"] = 327; values[valuesById[328] = "CS_UM_UpdateTeamMoney"] = 328; values[valuesById[329] = "CS_UM_StopSpectatorMode"] = 329; values[valuesById[330] = "CS_UM_KillCam"] = 330; values[valuesById[331] = "CS_UM_DesiredTimescale"] = 331; values[valuesById[332] = "CS_UM_CurrentTimescale"] = 332; values[valuesById[333] = "CS_UM_AchievementEvent"] = 333; values[valuesById[334] = "CS_UM_MatchEndConditions"] = 334; values[valuesById[335] = "CS_UM_DisconnectToLobby"] = 335; values[valuesById[336] = "CS_UM_PlayerStatsUpdate"] = 336; values[valuesById[339] = "CS_UM_ClientInfo"] = 339; values[valuesById[340] = "CS_UM_XRankGet"] = 340; values[valuesById[341] = "CS_UM_XRankUpd"] = 341; values[valuesById[345] = "CS_UM_CallVoteFailed"] = 345; values[valuesById[346] = "CS_UM_VoteStart"] = 346; values[valuesById[347] = "CS_UM_VotePass"] = 347; values[valuesById[348] = "CS_UM_VoteFailed"] = 348; values[valuesById[349] = "CS_UM_VoteSetup"] = 349; values[valuesById[350] = "CS_UM_ServerRankRevealAll"] = 350; values[valuesById[351] = "CS_UM_SendLastKillerDamageToClient"] = 351; values[valuesById[352] = "CS_UM_ServerRankUpdate"] = 352; values[valuesById[353] = "CS_UM_ItemPickup"] = 353; values[valuesById[354] = "CS_UM_ShowMenu"] = 354; values[valuesById[355] = "CS_UM_BarTime"] = 355; values[valuesById[356] = "CS_UM_AmmoDenied"] = 356; values[valuesById[357] = "CS_UM_MarkAchievement"] = 357; values[valuesById[358] = "CS_UM_MatchStatsUpdate"] = 358; values[valuesById[359] = "CS_UM_ItemDrop"] = 359; values[valuesById[361] = "CS_UM_SendPlayerItemDrops"] = 361; values[valuesById[362] = "CS_UM_RoundBackupFilenames"] = 362; values[valuesById[363] = "CS_UM_SendPlayerItemFound"] = 363; values[valuesById[364] = "CS_UM_ReportHit"] = 364; values[valuesById[365] = "CS_UM_XpUpdate"] = 365; values[valuesById[366] = "CS_UM_QuestProgress"] = 366; values[valuesById[367] = "CS_UM_ScoreLeaderboardData"] = 367; values[valuesById[368] = "CS_UM_PlayerDecalDigitalSignature"] = 368; values[valuesById[369] = "CS_UM_WeaponSound"] = 369; values[valuesById[370] = "CS_UM_UpdateScreenHealthBar"] = 370; values[valuesById[371] = "CS_UM_EntityOutlineHighlight"] = 371; values[valuesById[372] = "CS_UM_SSUI"] = 372; values[valuesById[373] = "CS_UM_SurvivalStats"] = 373; values[valuesById[374] = "CS_UM_DisconnectToLobby2"] = 374; values[valuesById[375] = "CS_UM_EndOfMatchAllPlayersData"] = 375; values[valuesById[376] = "CS_UM_PostRoundDamageReport"] = 376; values[valuesById[379] = "CS_UM_RoundEndReportData"] = 379; values[valuesById[380] = "CS_UM_CurrentRoundOdds"] = 380; values[valuesById[381] = "CS_UM_DeepStats"] = 381; values[valuesById[383] = "CS_UM_ShootInfo"] = 383; values[valuesById[385] = "CS_UM_CounterStrafe"] = 385; values[valuesById[386] = "CS_UM_DamagePrediction"] = 386; values[valuesById[387] = "CS_UM_RecurringMissionSchema"] = 387; values[valuesById[388] = "CS_UM_SendPlayerLoadout"] = 388; return values; })(); /** * ECSUsrMsg_DisconnectToLobby_Action enum. * @exports ECSUsrMsg_DisconnectToLobby_Action * @enum {number} * @property {number} k_ECSUsrMsg_DisconnectToLobby_Action_Default=0 k_ECSUsrMsg_DisconnectToLobby_Action_Default value * @property {number} k_ECSUsrMsg_DisconnectToLobby_Action_GoQueue=1 k_ECSUsrMsg_DisconnectToLobby_Action_GoQueue value */ $root.ECSUsrMsg_DisconnectToLobby_Action = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "k_ECSUsrMsg_DisconnectToLobby_Action_Default"] = 0; values[valuesById[1] = "k_ECSUsrMsg_DisconnectToLobby_Action_GoQueue"] = 1; return values; })(); $root.CCSUsrMsg_VGUIMenu = (function() { /** * Properties of a CCSUsrMsg_VGUIMenu. * @exports ICCSUsrMsg_VGUIMenu * @interface ICCSUsrMsg_VGUIMenu * @property {string|null} [name] CCSUsrMsg_VGUIMenu name * @property {boolean|null} [show] CCSUsrMsg_VGUIMenu show * @property {Array.<CCSUsrMsg_VGUIMenu.IKeys>|null} [keys] CCSUsrMsg_VGUIMenu keys */ /** * Constructs a new CCSUsrMsg_VGUIMenu. * @exports CCSUsrMsg_VGUIMenu * @classdesc Represents a CCSUsrMsg_VGUIMenu. * @implements ICCSUsrMsg_VGUIMenu * @constructor * @param {ICCSUsrMsg_VGUIMenu=} [properties] Properties to set */ function CCSUsrMsg_VGUIMenu(properties) { this.keys = []; 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]]; } /** * CCSUsrMsg_VGUIMenu name. * @member {string} name * @memberof CCSUsrMsg_VGUIMenu * @instance */ CCSUsrMsg_VGUIMenu.prototype.name = ""; /** * CCSUsrMsg_VGUIMenu show. * @member {boolean} show * @memberof CCSUsrMsg_VGUIMenu * @instance */ CCSUsrMsg_VGUIMenu.prototype.show = false; /** * CCSUsrMsg_VGUIMenu keys. * @member {Array.<CCSUsrMsg_VGUIMenu.IKeys>} keys * @memberof CCSUsrMsg_VGUIMenu * @instance */ CCSUsrMsg_VGUIMenu.prototype.keys = $util.emptyArray; /** * Creates a new CCSUsrMsg_VGUIMenu instance using the specified properties. * @function create * @memberof CCSUsrMsg_VGUIMenu * @static * @param {ICCSUsrMsg_VGUIMenu=} [properties] Properties to set * @returns {CCSUsrMsg_VGUIMenu} CCSUsrMsg_VGUIMenu instance */ CCSUsrMsg_VGUIMenu.create = function create(properties) { return new CCSUsrMsg_VGUIMenu(properties); }; /** * Encodes the specified CCSUsrMsg_VGUIMenu message. Does not implicitly {@link CCSUsrMsg_VGUIMenu.verify|verify} messages. * @function encode * @memberof CCSUsrMsg_VGUIMenu * @static * @param {ICCSUsrMsg_VGUIMenu} message CCSUsrMsg_VGUIMenu message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CCSUsrMsg_VGUIMenu.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.show != null && Object.hasOwnProperty.call(message, "show")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.show); if (message.keys != null && message.keys.length) for (var i = 0; i < message.keys.length; ++i) $root.CCSUsrMsg_VGUIMenu.Keys.encode(message.keys[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified CCSUsrMsg_VGUIMenu message, length delimited. Does not implicitly {@link CCSUsrMsg_VGUIMenu.verify|verify} messages. * @function encodeDelimited * @memberof CCSUsrMsg_VGUIMenu * @static * @param {ICCSUsrMsg_VGUIMenu} message CCSUsrMsg_VGUIMenu message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CCSUsrMsg_VGUIMenu.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CCSUsrMsg_VGUIMenu message from the specified reader or buffer. * @function decode * @memberof CCSUsrMsg_VGUIMenu * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {CCSUsrMsg_VGUIMenu} CCSUsrMsg_VGUIMenu * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CCSUsrMsg_VGUIMenu.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.CCSUsrMsg_VGUIMenu(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.name = reader.string(); break; } case 2: { message.show = reader.bool(); break; } case 3: { if (!(message.keys && message.keys.length)) message.keys = []; message.keys.push($root.CCSUsrMsg_VGUIMenu.Keys.decode(reader, reader.uint32())); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CCSUsrMsg_VGUIMenu message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof CCSUsrMsg_VGUIMenu * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {CCSUsrMsg_VGUIMenu} CCSUsrMsg_VGUIMenu * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CCSUsrMsg_VGUIMenu.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CCSUsrMsg_VGUIMenu message. * @function verify * @memberof CCSUsrMsg_VGUIMenu * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CCSUsrMsg_VGUIMenu.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.show != null && message.hasOwnProperty("show")) if (typeof message.show !== "boolean") return "show: boolean expected"; if (message.keys != null && message.hasOwnProperty("keys")) { if (!Array.isArray(message.keys)) return "keys: array expected"; for (var i = 0; i < message.keys.length; ++i) { var error = $root.CCSUsrMsg_VGUIMenu.Keys.verify(message.keys[i]); if (error) return "keys." + error; } } return null; }; /** * Creates a CCSUsrMsg_VGUIMenu message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof CCSUsrMsg_VGUIMenu * @static * @param {Object.<string,*>} object Plain object * @returns {CCSUsrMsg_VGUIMenu} CCSUsrMsg_VGUIMenu */ CCSUsrMsg_VGUIMenu.fromObject = function fromObject(object) { if (object instanceof $root.CCSUsrMsg_VGUIMenu) return object; var message = new $root.CCSUsrMsg_VGUIMenu(); if (object.name != null) message.name = String(object.name); if (object.show != null) message.show = Boolean(object.show); if (object.keys) { if (!Array.isArray(object.keys)) throw TypeError(".CCSUsrMsg_VGUIMenu.keys: array expected"); message.keys = []; for (var i = 0; i < object.keys.length; ++i) { if (typeof object.keys[i] !== "object") throw TypeError(".CCSUsrMsg_VGUIMenu.keys: object expected"); message.keys[i] = $root.CCSUsrMsg_VGUIMenu.Keys.fromObject(object.keys[i]); } } return message; }; /** * Creates a plain object from a CCSUsrMsg_VGUIMenu message. Also converts values to other types if specified. * @function toObject * @memberof CCSUsrMsg_VGUIMenu * @static * @param {CCSUsrMsg_VGUIMenu} message CCSUsrMsg_VGUIMenu * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ CCSUsrMsg_VGUIMenu.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.keys = []; if (options.defaults) { object.name = ""; object.show = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.show != null && message.hasOwnProperty("show")) object.show = message.show; if (message.keys && message.keys.length) { object.keys = []; for (var j = 0; j < message.keys.length; ++j) object.keys[j] = $root.CCSUsrMsg_VGUIMenu.Keys.toObject(message.keys[j], options); } return object; }; /** * Converts this CCSUsrMsg_VGUIMenu to JSON. * @function toJSON * @memberof CCSUsrMsg_VGUIMenu * @instance * @returns {Object.<string,*>} JSON object */ CCSUsrMsg_VGUIMenu.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for CCSUsrMsg_VGUIMenu * @function getTypeUrl * @memberof CCSUsrMsg_VGUIMenu * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ CCSUsrMsg_VGUIMenu.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/CCSUsrMsg_VGUIMenu"; }; CCSUsrMsg_VGUIMenu.Keys = (function() { /** * Properties of a Keys. * @memberof CCSUsrMsg_VGUIMenu * @interface IKeys * @property {string|null} [name] Keys name * @property {string|null} [value] Keys value */ /** * Constructs a new Keys. * @memberof CCSUsrMsg_VGUIMenu * @classdesc Represents a Keys. * @implements IKeys * @constructor * @param {CCSUsrMsg_VGUIMenu.IKeys=} [properties] Properties to set */ function Keys(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]]; } /** * Keys name. * @member {string} name * @memberof CCSUsrMsg_VGUIMenu.Keys * @instance */ Keys.prototype.name = ""; /** * Keys value. * @member {string} value * @memberof CCSUsrMsg_VGUIMenu.Keys * @instance */ Keys.prototype.value = ""; /** * Creates a new Keys instance using the specified properties. * @function create * @memberof CCSUsrMsg_VGUIMenu.Keys * @static * @param {CCSUsrMsg_VGUIMenu.IKeys=} [properties] Properties to set * @returns {CCSUsrMsg_VGUIMenu.Keys} Keys instance */ Keys.create = function create(properties) { return new Keys(properties); }; /** * Encodes the specified Keys message. Does not implicitly {@link CCSUsrMsg_VGUIMenu.Keys.verify|verify} messages. * @function encode * @memberof CCSUsrMsg_VGUIMenu.Keys * @static * @param {CCSUsrMsg_VGUIMenu.IKeys} message Keys message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Keys.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); return writer; }; /** * Encodes the specified Keys message, length delimited. Does not implicitly {@link CCSUsrMsg_VGUIMenu.Keys.verify|verify} messages. * @function encodeDelimited * @memberof CCSUsrMsg_VGUIMenu.Keys * @static * @param {CCSUsrMsg_VGUIMenu.IKeys} message Keys message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Keys.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Keys message from the specified reader or buffer. * @function decode * @memberof CCSUsrMsg_VGUIMenu.Keys * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {CCSUsrMsg_VGUIMenu.Keys} Keys * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Keys.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.CCSUsrMsg_VGUIMenu.Keys(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.name = reader.string(); break; } case 2: { message.value = reader.string(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Keys message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof CCSUsrMsg_VGUIMenu.Keys * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {CCSUsrMsg_VGUIMenu.Keys} Keys * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Keys.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Keys message. * @function verify * @memberof CCSUsrMsg_VGUIMenu.Keys * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Keys.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.value != null && message.hasOwnProperty("value")) if (!$util.isString(message.value)) return "value: string expected"; return null; }; /** * Creates a Keys message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof CCSUsrMsg_VGUIMenu.Keys * @static * @param {Object.<string,*>} object Plain object * @returns {CCSUsrMsg_VGUIMenu.Keys} Keys */ Keys.fromObject = function fromObject(object) { if (object instanceof $root.CCSUsrMsg_VGUIMenu.Keys) return object; var message = new $root.CCSUsrMsg_VGUIMenu.Keys(); if (object.name != null) message.name = String(object.name); if (object.value != null) message.value = String(object.value); return message; }; /** * Creates a plain object from a Keys message. Also converts values to other types if specified. * @function toObject * @memberof CCSUsrMsg_VGUIMenu.Keys * @static * @param {CCSUsrMsg_VGUIMenu.Keys} message Keys * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ Keys.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.value = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.value != null && message.hasOwnProperty("value")) object.value = message.value; return object; }; /** * Converts this Keys to JSON. * @function toJSON * @memberof CCSUsrMsg_VGUIMenu.Keys * @instance * @returns {Object.<string,*>} JSON object */ Keys.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for Keys * @function getTypeUrl * @memberof CCSUsrMsg_VGUIMenu.Keys * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ Keys.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/CCSUsrMsg_VGUIMenu.Keys"; }; return Keys; })(); return CCSUsrMsg_VGUIMenu; })(); $root.CCSUsrMsg_Geiger = (function() { /** * Properties of a CCSUsrMsg_Geiger. * @exports ICCSUsrMsg_Geiger * @interface ICCSUsrMsg_Geiger * @property {number|null} [range] CCSUsrMsg_Geiger range */ /** * Constructs a new CCSUsrMsg_Geiger. * @exports CCSUsrMsg_Geiger * @classdesc Represents a CCSUsrMsg_Geiger. * @implements ICCSUsrMsg_Geiger * @constructor * @param {ICCSUsrMsg_Geiger=} [properties] Properties to set */ function CCSUsrMsg_Geiger(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]]; } /** * CCSUsrMsg_Geiger range. * @member {number} range * @memberof CCSUsrMsg_Geiger * @instance */ CCSUsrMsg_Geiger.prototype.range = 0; /** * Creates a new CCSUsrMsg_Geiger instance using the specified properties. * @function create * @memberof CCSUsrMsg_Geiger * @static * @param {ICCSUsrMsg_Geiger=} [properties] Properties to set * @returns {CCSUsrMsg_Geiger} CCSUsrMsg_Geiger instance */ CCSUsrMsg_Geiger.create = function create(properties) { return new CCSUsrMsg_Geiger(properties); }; /** * Encodes the specified CCSUsrMsg_Geiger message. Does not implicitly {@link CCSUsrMsg_Geiger.verify|verify} messages. * @function encode * @memberof CCSUsrMsg_Geiger * @static * @param {ICCSUsrMsg_Geiger} message CCSUsrMsg_Geiger message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CCSUsrMsg_Geiger.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.range != null && Object.hasOwnProperty.call(message, "range")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.range); return writer; }; /** * Encodes the specified CCSUsrMsg_Geiger message, length delimited. Does not implicitly {@link CCSUsrMsg_Geiger.verify|verify} messages. * @function encodeDelimited * @memberof CCSUsrMsg_Geiger * @static * @param {ICCSUsrMsg_Geiger} message CCSUsrMsg_Geiger message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CCSUsrMsg_Geiger.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CCSUsrMsg_Geiger message from the specified reader or buffer. * @function decode * @memberof CCSUsrMsg_Geiger * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {CCSUsrMsg_Geiger} CCSUsrMsg_Geiger * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CCSUsrMsg_Geiger.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.CCSUsrMsg_Geiger(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.range = reader.int32(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CCSUsrMsg_Geiger message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof CCSUsrMsg_Geiger * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {CCSUsrMsg_Geiger} CCSUsrMsg_Geiger * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CCSUsrMsg_Geiger.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CCSUsrMsg_Geiger message. * @function verify * @memberof CCSUsrMsg_Geiger * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CCSUsrMsg_Geiger.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.range != null && message.hasOwnProperty("range")) if (!$util.isInteger(message.range)) return "range: integer expected"; return null; }; /** * Creates a CCSUsrMsg_Geiger message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof CCSUsrMsg_Geiger * @static * @param {Object.<string,*>} object Plain object * @returns {CCSUsrMsg_Geiger} CCSUsrMsg_Geiger */ CCSUsrMsg_Geiger.fromObject = function fromObject(object) { if (object instanceof $root.CCSUsrMsg_Geiger) return object; var message = new $root.CCSUsrMsg_Geiger(); if (object.range != null) message.range = object.range | 0; return message; }; /** * Creates a plain object from a CCSUsrMsg_Geiger message. Also converts values to other types if specified. * @function toObject * @memberof CCSUsrMsg_Geiger * @static * @param {CCSUsrMsg_Geiger} message CCSUsrMsg_Geiger * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ CCSUsrMsg_Geiger.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.range = 0; if (message.range != null && message.hasOwnProperty("range")) object.range = message.range; return object; }; /** * Converts this CCSUsrMsg_Geiger to JSON. * @function toJSON * @memberof CCSUsrMsg_Geiger * @instance * @returns {Object.<string,*>} JSON object */ CCSUsrMsg_Geiger.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for CCSUsrMsg_Geiger * @function getTypeUrl * @memberof CCSUsrMsg_Geiger * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ CCSUsrMsg_Geiger.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/CCSUsrMsg_Geiger"; }; return CCSUsrMsg_Geiger; })(); $root.CCSUsrMsg_Train = (function() { /** * Properties of a CCSUsrMsg_Train. * @exports ICCSUsrMsg_Train * @interface ICCSUsrMsg_Train * @property {number|null} [train] CCSUsrMsg_Train train */ /** * Constructs a new CCSUsrMsg_Train. * @exports CCSUsrMsg_Train * @classdesc Represents a CCSUsrMsg_Train. * @implements ICCSUsrMsg_Train * @constructor * @param {ICCSUsrMsg_Train=} [properties] Properties to set */ function CCSUsrMsg_Train(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]]; } /** * CCSUsrMsg_Train train. * @member {number} train * @memberof CCSUsrMsg_Train * @instance */ CCSUsrMsg_Train.prototype.train = 0; /** * Creates a new CCSUsrMsg_Train instance using the specified properties. * @function create * @memberof CCSUsrMsg_Train * @static * @param {ICCSUsrMsg_Train=} [properties] Properties to set * @returns {CCSUsrMsg_Train} CCSUsrMsg_Train instance */ CCSUsrMsg_Train.create = function create(properties) { return new CCSUsrMsg_Train(properties); }; /** * Encodes the specified CCSUsrMsg_Train message. Does not implicitly {@link CCSUsrMsg_Train.verify|verify} messages. * @function encode * @memberof CCSUsrMsg_Train * @static * @param {ICCSUsrMsg_Train} message CCSUsrMsg_Train message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CCSUsrMsg_Train.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.train != null && Object.hasOwnProperty.call(message, "train")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.train); return writer; }; /** * Encodes the specified CCSUsrMsg_Train message, length delimited. Does not implicitly {@link CCSUsrMsg_Train.verify|verify} messages. * @function encodeDelimited * @memberof CCSUsrMsg_Train * @static * @param {ICCSUsrMsg_Train} message CCSUsrMsg_Train message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CCSUsrMsg_Train.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CCSUsrMsg_Train message from the specified reader or buffer. * @function decode * @memberof CCSUsrMsg_Train * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {CCSUsrMsg_Train} CCSUsrMsg_Train * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CCSUsrMsg_Train.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.CCSUsrMsg_Train(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.train = reader.int32(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CCSUsrMsg_Train message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof CCSUsrMsg_Train * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {CCSUsrMsg_Train} CCSUsrMsg_Train * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CCSUsrMsg_Train.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CCSUsrMsg_Train message. * @function verify * @memberof CCSUsrMsg_Train * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CCSUsrMsg_Train.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.train != null && message.hasOwnProperty("train")) if (!$util.isInteger(message.train)) return "train: integer expected"; return null; }; /** * Creates a CCSUsrMsg_Train message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof CCSUsrMsg_Train * @static * @param {Object.<string,*>} object Plain object * @returns {CCSUsrMsg_Train} CCSUsrMsg_Train */ CCSUsrMsg_Train.fromObject = function fromObject(object) { if (object instanceof $root.CCSUsrMsg_Train) return object; var message = new $root.CCSUsrMsg_Train(); if (object.train != null) message.train = object.train | 0; return message; }; /** * Creates a plain object from a CCSUsrMsg_Train message. Also converts values to other types if specified. * @function toObject * @memberof CCSUsrMsg_Train * @static * @param {CCSUsrMsg_Train} message CCSUsrMsg_Train * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ CCSUsrMsg_Train.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.train = 0; if (message.train != null && message.hasOwnProperty("train")) object.train = message.train; return object; }; /** * Converts this CCSUsrMsg_Train to JSON. * @function toJSON * @memberof CCSUsrMsg_Train * @instance * @returns {Object.<string,*>} JSON object */ CCSUsrMsg_Train.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for CCSUsrMsg_Train * @function getTypeUrl * @memberof CCSUsrMsg_Train * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */