UNPKG

tf2

Version:

Exposes a simple API for interacting with the Team Fortress 2 game coordinator

1,027 lines (961 loc) 1.75 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"] = {}); /** * PartnerAccountType enum. * @exports PartnerAccountType * @enum {string} * @property {number} PARTNER_NONE=0 PARTNER_NONE value * @property {number} PARTNER_PERFECT_WORLD=1 PARTNER_PERFECT_WORLD value * @property {number} PARTNER_NEXON=2 PARTNER_NEXON value */ $root.PartnerAccountType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "PARTNER_NONE"] = 0; values[valuesById[1] = "PARTNER_PERFECT_WORLD"] = 1; values[valuesById[2] = "PARTNER_NEXON"] = 2; return values; })(); /** * GCConnectionStatus enum. * @exports GCConnectionStatus * @enum {string} * @property {number} GCConnectionStatus_HAVE_SESSION=0 GCConnectionStatus_HAVE_SESSION value * @property {number} GCConnectionStatus_GC_GOING_DOWN=1 GCConnectionStatus_GC_GOING_DOWN value * @property {number} GCConnectionStatus_NO_SESSION=2 GCConnectionStatus_NO_SESSION value * @property {number} GCConnectionStatus_NO_SESSION_IN_LOGON_QUEUE=3 GCConnectionStatus_NO_SESSION_IN_LOGON_QUEUE value * @property {number} GCConnectionStatus_NO_STEAM=4 GCConnectionStatus_NO_STEAM value * @property {number} GCConnectionStatus_SUSPENDED=5 GCConnectionStatus_SUSPENDED value */ $root.GCConnectionStatus = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "GCConnectionStatus_HAVE_SESSION"] = 0; values[valuesById[1] = "GCConnectionStatus_GC_GOING_DOWN"] = 1; values[valuesById[2] = "GCConnectionStatus_NO_SESSION"] = 2; values[valuesById[3] = "GCConnectionStatus_NO_SESSION_IN_LOGON_QUEUE"] = 3; values[valuesById[4] = "GCConnectionStatus_NO_STEAM"] = 4; values[valuesById[5] = "GCConnectionStatus_SUSPENDED"] = 5; return values; })(); $root.CMsgSOIDOwner = (function() { /** * Properties of a CMsgSOIDOwner. * @exports ICMsgSOIDOwner * @interface ICMsgSOIDOwner * @property {number|null} [type] CMsgSOIDOwner type * @property {number|Long|null} [id] CMsgSOIDOwner id */ /** * Constructs a new CMsgSOIDOwner. * @exports CMsgSOIDOwner * @classdesc Represents a CMsgSOIDOwner. * @implements ICMsgSOIDOwner * @constructor * @param {ICMsgSOIDOwner=} [properties] Properties to set */ function CMsgSOIDOwner(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]]; } /** * CMsgSOIDOwner type. * @member {number} type * @memberof CMsgSOIDOwner * @instance */ CMsgSOIDOwner.prototype.type = 0; /** * CMsgSOIDOwner id. * @member {number|Long} id * @memberof CMsgSOIDOwner * @instance */ CMsgSOIDOwner.prototype.id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** * Creates a new CMsgSOIDOwner instance using the specified properties. * @function create * @memberof CMsgSOIDOwner * @static * @param {ICMsgSOIDOwner=} [properties] Properties to set * @returns {CMsgSOIDOwner} CMsgSOIDOwner instance */ CMsgSOIDOwner.create = function create(properties) { return new CMsgSOIDOwner(properties); }; /** * Encodes the specified CMsgSOIDOwner message. Does not implicitly {@link CMsgSOIDOwner.verify|verify} messages. * @function encode * @memberof CMsgSOIDOwner * @static * @param {ICMsgSOIDOwner} message CMsgSOIDOwner message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CMsgSOIDOwner.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.type != null && message.hasOwnProperty("type")) writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.type); if (message.id != null && message.hasOwnProperty("id")) writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.id); return writer; }; /** * Encodes the specified CMsgSOIDOwner message, length delimited. Does not implicitly {@link CMsgSOIDOwner.verify|verify} messages. * @function encodeDelimited * @memberof CMsgSOIDOwner * @static * @param {ICMsgSOIDOwner} message CMsgSOIDOwner message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CMsgSOIDOwner.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CMsgSOIDOwner message from the specified reader or buffer. * @function decode * @memberof CMsgSOIDOwner * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {CMsgSOIDOwner} CMsgSOIDOwner * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CMsgSOIDOwner.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgSOIDOwner(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.type = reader.uint32(); break; case 2: message.id = reader.uint64(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CMsgSOIDOwner message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof CMsgSOIDOwner * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {CMsgSOIDOwner} CMsgSOIDOwner * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CMsgSOIDOwner.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CMsgSOIDOwner message. * @function verify * @memberof CMsgSOIDOwner * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CMsgSOIDOwner.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.type != null && message.hasOwnProperty("type")) if (!$util.isInteger(message.type)) return "type: integer expected"; if (message.id != null && message.hasOwnProperty("id")) if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) return "id: integer|Long expected"; return null; }; /** * Creates a CMsgSOIDOwner message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof CMsgSOIDOwner * @static * @param {Object.<string,*>} object Plain object * @returns {CMsgSOIDOwner} CMsgSOIDOwner */ CMsgSOIDOwner.fromObject = function fromObject(object) { if (object instanceof $root.CMsgSOIDOwner) return object; var message = new $root.CMsgSOIDOwner(); if (object.type != null) message.type = object.type >>> 0; if (object.id != null) if ($util.Long) (message.id = $util.Long.fromValue(object.id)).unsigned = true; else if (typeof object.id === "string") message.id = parseInt(object.id, 10); else if (typeof object.id === "number") message.id = object.id; else if (typeof object.id === "object") message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); return message; }; /** * Creates a plain object from a CMsgSOIDOwner message. Also converts values to other types if specified. * @function toObject * @memberof CMsgSOIDOwner * @static * @param {CMsgSOIDOwner} message CMsgSOIDOwner * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ CMsgSOIDOwner.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.type = 0; if ($util.Long) { var long = new $util.Long(0, 0, true); object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.id = options.longs === String ? "0" : 0; } if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; if (message.id != null && message.hasOwnProperty("id")) if (typeof message.id === "number") object.id = options.longs === String ? String(message.id) : message.id; else object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; return object; }; /** * Converts this CMsgSOIDOwner to JSON. * @function toJSON * @memberof CMsgSOIDOwner * @instance * @returns {Object.<string,*>} JSON object */ CMsgSOIDOwner.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return CMsgSOIDOwner; })(); $root.CMsgSOSingleObject = (function() { /** * Properties of a CMsgSOSingleObject. * @exports ICMsgSOSingleObject * @interface ICMsgSOSingleObject * @property {number|Long|null} [owner] CMsgSOSingleObject owner * @property {number|null} [type_id] CMsgSOSingleObject type_id * @property {Uint8Array|null} [object_data] CMsgSOSingleObject object_data * @property {number|Long|null} [version] CMsgSOSingleObject version * @property {ICMsgSOIDOwner|null} [owner_soid] CMsgSOSingleObject owner_soid * @property {number|null} [service_id] CMsgSOSingleObject service_id */ /** * Constructs a new CMsgSOSingleObject. * @exports CMsgSOSingleObject * @classdesc Represents a CMsgSOSingleObject. * @implements ICMsgSOSingleObject * @constructor * @param {ICMsgSOSingleObject=} [properties] Properties to set */ function CMsgSOSingleObject(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]]; } /** * CMsgSOSingleObject owner. * @member {number|Long} owner * @memberof CMsgSOSingleObject * @instance */ CMsgSOSingleObject.prototype.owner = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * CMsgSOSingleObject type_id. * @member {number} type_id * @memberof CMsgSOSingleObject * @instance */ CMsgSOSingleObject.prototype.type_id = 0; /** * CMsgSOSingleObject object_data. * @member {Uint8Array} object_data * @memberof CMsgSOSingleObject * @instance */ CMsgSOSingleObject.prototype.object_data = $util.newBuffer([]); /** * CMsgSOSingleObject version. * @member {number|Long} version * @memberof CMsgSOSingleObject * @instance */ CMsgSOSingleObject.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * CMsgSOSingleObject owner_soid. * @member {ICMsgSOIDOwner|null|undefined} owner_soid * @memberof CMsgSOSingleObject * @instance */ CMsgSOSingleObject.prototype.owner_soid = null; /** * CMsgSOSingleObject service_id. * @member {number} service_id * @memberof CMsgSOSingleObject * @instance */ CMsgSOSingleObject.prototype.service_id = 0; /** * Creates a new CMsgSOSingleObject instance using the specified properties. * @function create * @memberof CMsgSOSingleObject * @static * @param {ICMsgSOSingleObject=} [properties] Properties to set * @returns {CMsgSOSingleObject} CMsgSOSingleObject instance */ CMsgSOSingleObject.create = function create(properties) { return new CMsgSOSingleObject(properties); }; /** * Encodes the specified CMsgSOSingleObject message. Does not implicitly {@link CMsgSOSingleObject.verify|verify} messages. * @function encode * @memberof CMsgSOSingleObject * @static * @param {ICMsgSOSingleObject} message CMsgSOSingleObject message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CMsgSOSingleObject.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.owner != null && message.hasOwnProperty("owner")) writer.uint32(/* id 1, wireType 1 =*/9).fixed64(message.owner); if (message.type_id != null && message.hasOwnProperty("type_id")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type_id); if (message.object_data != null && message.hasOwnProperty("object_data")) writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.object_data); if (message.version != null && message.hasOwnProperty("version")) writer.uint32(/* id 4, wireType 1 =*/33).fixed64(message.version); if (message.owner_soid != null && message.hasOwnProperty("owner_soid")) $root.CMsgSOIDOwner.encode(message.owner_soid, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.service_id != null && message.hasOwnProperty("service_id")) writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.service_id); return writer; }; /** * Encodes the specified CMsgSOSingleObject message, length delimited. Does not implicitly {@link CMsgSOSingleObject.verify|verify} messages. * @function encodeDelimited * @memberof CMsgSOSingleObject * @static * @param {ICMsgSOSingleObject} message CMsgSOSingleObject message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CMsgSOSingleObject.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CMsgSOSingleObject message from the specified reader or buffer. * @function decode * @memberof CMsgSOSingleObject * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {CMsgSOSingleObject} CMsgSOSingleObject * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CMsgSOSingleObject.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgSOSingleObject(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.owner = reader.fixed64(); break; case 2: message.type_id = reader.int32(); break; case 3: message.object_data = reader.bytes(); break; case 4: message.version = reader.fixed64(); break; case 5: message.owner_soid = $root.CMsgSOIDOwner.decode(reader, reader.uint32()); break; case 6: message.service_id = reader.uint32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CMsgSOSingleObject message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof CMsgSOSingleObject * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {CMsgSOSingleObject} CMsgSOSingleObject * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CMsgSOSingleObject.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CMsgSOSingleObject message. * @function verify * @memberof CMsgSOSingleObject * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CMsgSOSingleObject.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.owner != null && message.hasOwnProperty("owner")) if (!$util.isInteger(message.owner) && !(message.owner && $util.isInteger(message.owner.low) && $util.isInteger(message.owner.high))) return "owner: integer|Long expected"; if (message.type_id != null && message.hasOwnProperty("type_id")) if (!$util.isInteger(message.type_id)) return "type_id: integer expected"; if (message.object_data != null && message.hasOwnProperty("object_data")) if (!(message.object_data && typeof message.object_data.length === "number" || $util.isString(message.object_data))) return "object_data: buffer expected"; if (message.version != null && message.hasOwnProperty("version")) if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) return "version: integer|Long expected"; if (message.owner_soid != null && message.hasOwnProperty("owner_soid")) { var error = $root.CMsgSOIDOwner.verify(message.owner_soid); if (error) return "owner_soid." + error; } if (message.service_id != null && message.hasOwnProperty("service_id")) if (!$util.isInteger(message.service_id)) return "service_id: integer expected"; return null; }; /** * Creates a CMsgSOSingleObject message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof CMsgSOSingleObject * @static * @param {Object.<string,*>} object Plain object * @returns {CMsgSOSingleObject} CMsgSOSingleObject */ CMsgSOSingleObject.fromObject = function fromObject(object) { if (object instanceof $root.CMsgSOSingleObject) return object; var message = new $root.CMsgSOSingleObject(); if (object.owner != null) if ($util.Long) (message.owner = $util.Long.fromValue(object.owner)).unsigned = false; else if (typeof object.owner === "string") message.owner = parseInt(object.owner, 10); else if (typeof object.owner === "number") message.owner = object.owner; else if (typeof object.owner === "object") message.owner = new $util.LongBits(object.owner.low >>> 0, object.owner.high >>> 0).toNumber(); if (object.type_id != null) message.type_id = object.type_id | 0; if (object.object_data != null) if (typeof object.object_data === "string") $util.base64.decode(object.object_data, message.object_data = $util.newBuffer($util.base64.length(object.object_data)), 0); else if (object.object_data.length) message.object_data = object.object_data; if (object.version != null) if ($util.Long) (message.version = $util.Long.fromValue(object.version)).unsigned = false; else if (typeof object.version === "string") message.version = parseInt(object.version, 10); else if (typeof object.version === "number") message.version = object.version; else if (typeof object.version === "object") message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(); if (object.owner_soid != null) { if (typeof object.owner_soid !== "object") throw TypeError(".CMsgSOSingleObject.owner_soid: object expected"); message.owner_soid = $root.CMsgSOIDOwner.fromObject(object.owner_soid); } if (object.service_id != null) message.service_id = object.service_id >>> 0; return message; }; /** * Creates a plain object from a CMsgSOSingleObject message. Also converts values to other types if specified. * @function toObject * @memberof CMsgSOSingleObject * @static * @param {CMsgSOSingleObject} message CMsgSOSingleObject * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ CMsgSOSingleObject.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.owner = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.owner = options.longs === String ? "0" : 0; object.type_id = 0; if (options.bytes === String) object.object_data = ""; else { object.object_data = []; if (options.bytes !== Array) object.object_data = $util.newBuffer(object.object_data); } if ($util.Long) { var long = new $util.Long(0, 0, false); object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.version = options.longs === String ? "0" : 0; object.owner_soid = null; object.service_id = 0; } if (message.owner != null && message.hasOwnProperty("owner")) if (typeof message.owner === "number") object.owner = options.longs === String ? String(message.owner) : message.owner; else object.owner = options.longs === String ? $util.Long.prototype.toString.call(message.owner) : options.longs === Number ? new $util.LongBits(message.owner.low >>> 0, message.owner.high >>> 0).toNumber() : message.owner; if (message.type_id != null && message.hasOwnProperty("type_id")) object.type_id = message.type_id; if (message.object_data != null && message.hasOwnProperty("object_data")) object.object_data = options.bytes === String ? $util.base64.encode(message.object_data, 0, message.object_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.object_data) : message.object_data; if (message.version != null && message.hasOwnProperty("version")) if (typeof message.version === "number") object.version = options.longs === String ? String(message.version) : message.version; else object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber() : message.version; if (message.owner_soid != null && message.hasOwnProperty("owner_soid")) object.owner_soid = $root.CMsgSOIDOwner.toObject(message.owner_soid, options); if (message.service_id != null && message.hasOwnProperty("service_id")) object.service_id = message.service_id; return object; }; /** * Converts this CMsgSOSingleObject to JSON. * @function toJSON * @memberof CMsgSOSingleObject * @instance * @returns {Object.<string,*>} JSON object */ CMsgSOSingleObject.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return CMsgSOSingleObject; })(); $root.CMsgSOMultipleObjects = (function() { /** * Properties of a CMsgSOMultipleObjects. * @exports ICMsgSOMultipleObjects * @interface ICMsgSOMultipleObjects * @property {number|Long|null} [owner] CMsgSOMultipleObjects owner * @property {Array.<CMsgSOMultipleObjects.ISingleObject>|null} [objects] CMsgSOMultipleObjects objects * @property {number|Long|null} [version] CMsgSOMultipleObjects version * @property {ICMsgSOIDOwner|null} [owner_soid] CMsgSOMultipleObjects owner_soid * @property {number|null} [service_id] CMsgSOMultipleObjects service_id */ /** * Constructs a new CMsgSOMultipleObjects. * @exports CMsgSOMultipleObjects * @classdesc Represents a CMsgSOMultipleObjects. * @implements ICMsgSOMultipleObjects * @constructor * @param {ICMsgSOMultipleObjects=} [properties] Properties to set */ function CMsgSOMultipleObjects(properties) { this.objects = []; 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]]; } /** * CMsgSOMultipleObjects owner. * @member {number|Long} owner * @memberof CMsgSOMultipleObjects * @instance */ CMsgSOMultipleObjects.prototype.owner = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * CMsgSOMultipleObjects objects. * @member {Array.<CMsgSOMultipleObjects.ISingleObject>} objects * @memberof CMsgSOMultipleObjects * @instance */ CMsgSOMultipleObjects.prototype.objects = $util.emptyArray; /** * CMsgSOMultipleObjects version. * @member {number|Long} version * @memberof CMsgSOMultipleObjects * @instance */ CMsgSOMultipleObjects.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * CMsgSOMultipleObjects owner_soid. * @member {ICMsgSOIDOwner|null|undefined} owner_soid * @memberof CMsgSOMultipleObjects * @instance */ CMsgSOMultipleObjects.prototype.owner_soid = null; /** * CMsgSOMultipleObjects service_id. * @member {number} service_id * @memberof CMsgSOMultipleObjects * @instance */ CMsgSOMultipleObjects.prototype.service_id = 0; /** * Creates a new CMsgSOMultipleObjects instance using the specified properties. * @function create * @memberof CMsgSOMultipleObjects * @static * @param {ICMsgSOMultipleObjects=} [properties] Properties to set * @returns {CMsgSOMultipleObjects} CMsgSOMultipleObjects instance */ CMsgSOMultipleObjects.create = function create(properties) { return new CMsgSOMultipleObjects(properties); }; /** * Encodes the specified CMsgSOMultipleObjects message. Does not implicitly {@link CMsgSOMultipleObjects.verify|verify} messages. * @function encode * @memberof CMsgSOMultipleObjects * @static * @param {ICMsgSOMultipleObjects} message CMsgSOMultipleObjects message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CMsgSOMultipleObjects.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.owner != null && message.hasOwnProperty("owner")) writer.uint32(/* id 1, wireType 1 =*/9).fixed64(message.owner); if (message.objects != null && message.objects.length) for (var i = 0; i < message.objects.length; ++i) $root.CMsgSOMultipleObjects.SingleObject.encode(message.objects[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.version != null && message.hasOwnProperty("version")) writer.uint32(/* id 3, wireType 1 =*/25).fixed64(message.version); if (message.owner_soid != null && message.hasOwnProperty("owner_soid")) $root.CMsgSOIDOwner.encode(message.owner_soid, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.service_id != null && message.hasOwnProperty("service_id")) writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.service_id); return writer; }; /** * Encodes the specified CMsgSOMultipleObjects message, length delimited. Does not implicitly {@link CMsgSOMultipleObjects.verify|verify} messages. * @function encodeDelimited * @memberof CMsgSOMultipleObjects * @static * @param {ICMsgSOMultipleObjects} message CMsgSOMultipleObjects message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CMsgSOMultipleObjects.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CMsgSOMultipleObjects message from the specified reader or buffer. * @function decode * @memberof CMsgSOMultipleObjects * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {CMsgSOMultipleObjects} CMsgSOMultipleObjects * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CMsgSOMultipleObjects.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgSOMultipleObjects(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.owner = reader.fixed64(); break; case 2: if (!(message.objects && message.objects.length)) message.objects = []; message.objects.push($root.CMsgSOMultipleObjects.SingleObject.decode(reader, reader.uint32())); break; case 3: message.version = reader.fixed64(); break; case 6: message.owner_soid = $root.CMsgSOIDOwner.decode(reader, reader.uint32()); break; case 7: message.service_id = reader.uint32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CMsgSOMultipleObjects message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof CMsgSOMultipleObjects * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {CMsgSOMultipleObjects} CMsgSOMultipleObjects * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CMsgSOMultipleObjects.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CMsgSOMultipleObjects message. * @function verify * @memberof CMsgSOMultipleObjects * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CMsgSOMultipleObjects.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.owner != null && message.hasOwnProperty("owner")) if (!$util.isInteger(message.owner) && !(message.owner && $util.isInteger(message.owner.low) && $util.isInteger(message.owner.high))) return "owner: integer|Long expected"; if (message.objects != null && message.hasOwnProperty("objects")) { if (!Array.isArray(message.objects)) return "objects: array expected"; for (var i = 0; i < message.objects.length; ++i) { var error = $root.CMsgSOMultipleObjects.SingleObject.verify(message.objects[i]); if (error) return "objects." + error; } } if (message.version != null && message.hasOwnProperty("version")) if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) return "version: integer|Long expected"; if (message.owner_soid != null && message.hasOwnProperty("owner_soid")) { var error = $root.CMsgSOIDOwner.verify(message.owner_soid); if (error) return "owner_soid." + error; } if (message.service_id != null && message.hasOwnProperty("service_id")) if (!$util.isInteger(message.service_id)) return "service_id: integer expected"; return null; }; /** * Creates a CMsgSOMultipleObjects message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof CMsgSOMultipleObjects * @static * @param {Object.<string,*>} object Plain object * @returns {CMsgSOMultipleObjects} CMsgSOMultipleObjects */ CMsgSOMultipleObjects.fromObject = function fromObject(object) { if (object instanceof $root.CMsgSOMultipleObjects) return object; var message = new $root.CMsgSOMultipleObjects(); if (object.owner != null) if ($util.Long) (message.owner = $util.Long.fromValue(object.owner)).unsigned = false; else if (typeof object.owner === "string") message.owner = parseInt(object.owner, 10); else if (typeof object.owner === "number") message.owner = object.owner; else if (typeof object.owner === "object") message.owner = new $util.LongBits(object.owner.low >>> 0, object.owner.high >>> 0).toNumber(); if (object.objects) { if (!Array.isArray(object.objects)) throw TypeError(".CMsgSOMultipleObjects.objects: array expected"); message.objects = []; for (var i = 0; i < object.objects.length; ++i) { if (typeof object.objects[i] !== "object") throw TypeError(".CMsgSOMultipleObjects.objects: object expected"); message.objects[i] = $root.CMsgSOMultipleObjects.SingleObject.fromObject(object.objects[i]); } } if (object.version != null) if ($util.Long) (message.version = $util.Long.fromValue(object.version)).unsigned = false; else if (typeof object.version === "string") message.version = parseInt(object.version, 10); else if (typeof object.version === "number") message.version = object.version; else if (typeof object.version === "object") message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(); if (object.owner_soid != null) { if (typeof object.owner_soid !== "object") throw TypeError(".CMsgSOMultipleObjects.owner_soid: object expected"); message.owner_soid = $root.CMsgSOIDOwner.fromObject(object.owner_soid); } if (object.service_id != null) message.service_id = object.service_id >>> 0; return message; }; /** * Creates a plain object from a CMsgSOMultipleObjects message. Also converts values to other types if specified. * @function toObject * @memberof CMsgSOMultipleObjects * @static * @param {CMsgSOMultipleObjects} message CMsgSOMultipleObjects * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ CMsgSOMultipleObjects.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.objects = []; if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, false); object.owner = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.owner = options.longs === String ? "0" : 0; if ($util.Long) { var long = new $util.Long(0, 0, false); object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.version = options.longs === String ? "0" : 0; object.owner_soid = null; object.service_id = 0; } if (message.owner != null && message.hasOwnProperty("owner")) if (typeof message.owner === "number") object.owner = options.longs === String ? String(message.owner) : message.owner; else object.owner = options.longs === String ? $util.Long.prototype.toString.call(message.owner) : options.longs === Number ? new $util.LongBits(message.owner.low >>> 0, message.owner.high >>> 0).toNumber() : message.owner; if (message.objects && message.objects.length) { object.objects = []; for (var j = 0; j < message.objects.length; ++j) object.objects[j] = $root.CMsgSOMultipleObjects.SingleObject.toObject(message.objects[j], options); } if (message.version != null && message.hasOwnProperty("version")) if (typeof message.version === "number") object.version = options.longs === String ? String(message.version) : message.version; else object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber() : message.version; if (message.owner_soid != null && message.hasOwnProperty("owner_soid")) object.owner_soid = $root.CMsgSOIDOwner.toObject(message.owner_soid, options); if (message.service_id != null && message.hasOwnProperty("service_id")) object.service_id = message.service_id; return object; }; /** * Converts this CMsgSOMultipleObjects to JSON. * @function toJSON * @memberof CMsgSOMultipleObjects * @instance * @returns {Object.<string,*>} JSON object */ CMsgSOMultipleObjects.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; CMsgSOMultipleObjects.SingleObject = (function() { /** * Properties of a SingleObject. * @memberof CMsgSOMultipleObjects * @interface ISingleObject * @property {number|null} [type_id] SingleObject type_id * @property {Uint8Array|null} [object_data] SingleObject object_data */ /** * Constructs a new SingleObject. * @memberof CMsgSOMultipleObjects * @classdesc Represents a SingleObject. * @implements ISingleObject * @constructor * @param {CMsgSOMultipleObjects.ISingleObject=} [properties] Properties to set */ function SingleObject(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]]; } /** * SingleObject type_id. * @member {number} type_id * @memberof CMsgSOMultipleObjects.SingleObject * @instance */ SingleObject.prototype.type_id = 0; /** * SingleObject object_data. * @member {Uint8Array} object_data * @memberof CMsgSOMultipleObjects.SingleObject * @instance */ SingleObject.prototype.object_data = $util.newBuffer([]); /** * Creates a new SingleObject instance using the specified properties. * @function create * @memberof CMsgSOMultipleObjects.SingleObject * @static * @param {CMsgSOMultipleObjects.ISingleObject=} [properties] Properties to set * @returns {CMsgSOMultipleObjects.SingleObject} SingleObject instance */ SingleObject.create = function create(properties) { return new SingleObject(properties); }; /** * Encodes the specified SingleObject message. Does not implicitly {@link CMsgSOMultipleObjects.SingleObject.verify|verify} messages. * @function encode * @memberof CMsgSOMultipleObjects.SingleObject * @static * @param {CMsgSOMultipleObjects.ISingleObject} message SingleObject message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SingleObject.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.type_id != null && message.hasOwnProperty("type_id")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type_id); if (message.object_data != null && message.hasOwnProperty("object_data")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.object_data); return writer; }; /** * Encodes the specified SingleObject message, length delimited. Does not implicitly {@link CMsgSOMultipleObjects.SingleObject.verify|verify} messages. * @function encodeDelimited * @memberof CMsgSOMultipleObjects.SingleObject * @static * @param {CMsgSOMultipleObjects.ISingleObject} message SingleObject message or plain object to encode * @param {$proto