1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245 |
- /*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
- (function(global, factory) { /* global define, require, module */
- /* AMD */ if (typeof define === 'function' && define.amd)
- define(["protobufjs/minimal"], factory);
- /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
- module.exports = factory(require("protobufjs/minimal"));
- })(this, function($protobuf) {
- "use strict";
- // Common aliases
- var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
-
- // Exported root namespace
- var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
-
- $root.tutorial = (function() {
-
- /**
- * Namespace tutorial.
- * @exports tutorial
- * @namespace
- */
- var tutorial = {};
-
- tutorial.Message = (function() {
-
- /**
- * Properties of a Message.
- * @memberof tutorial
- * @interface IMessage
- * @property {tutorial.Message.Type|null} [type] Message type
- * @property {tutorial.Message.IDataMessage|null} [dataMessage] Message dataMessage
- * @property {tutorial.Message.INotificationMessage|null} [notificationMessage] Message notificationMessage
- * @property {tutorial.Message.IRoleOptMessage|null} [roleOptMessage] Message roleOptMessage
- * @property {tutorial.Message.IReportData|null} [reportData] Message reportData
- * @property {string|null} [msg] Message msg
- * @property {tutorial.Message.IBuildingItems|null} [buildingItems] Message buildingItems
- */
-
- /**
- * Constructs a new Message.
- * @memberof tutorial
- * @classdesc Represents a Message.
- * @implements IMessage
- * @constructor
- * @param {tutorial.IMessage=} [properties] Properties to set
- */
- function Message(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]];
- }
-
- /**
- * Message type.
- * @member {tutorial.Message.Type} type
- * @memberof tutorial.Message
- * @instance
- */
- Message.prototype.type = 0;
-
- /**
- * Message dataMessage.
- * @member {tutorial.Message.IDataMessage|null|undefined} dataMessage
- * @memberof tutorial.Message
- * @instance
- */
- Message.prototype.dataMessage = null;
-
- /**
- * Message notificationMessage.
- * @member {tutorial.Message.INotificationMessage|null|undefined} notificationMessage
- * @memberof tutorial.Message
- * @instance
- */
- Message.prototype.notificationMessage = null;
-
- /**
- * Message roleOptMessage.
- * @member {tutorial.Message.IRoleOptMessage|null|undefined} roleOptMessage
- * @memberof tutorial.Message
- * @instance
- */
- Message.prototype.roleOptMessage = null;
-
- /**
- * Message reportData.
- * @member {tutorial.Message.IReportData|null|undefined} reportData
- * @memberof tutorial.Message
- * @instance
- */
- Message.prototype.reportData = null;
-
- /**
- * Message msg.
- * @member {string} msg
- * @memberof tutorial.Message
- * @instance
- */
- Message.prototype.msg = "";
-
- /**
- * Message buildingItems.
- * @member {tutorial.Message.IBuildingItems|null|undefined} buildingItems
- * @memberof tutorial.Message
- * @instance
- */
- Message.prototype.buildingItems = null;
-
- /**
- * Creates a new Message instance using the specified properties.
- * @function create
- * @memberof tutorial.Message
- * @static
- * @param {tutorial.IMessage=} [properties] Properties to set
- * @returns {tutorial.Message} Message instance
- */
- Message.create = function create(properties) {
- return new Message(properties);
- };
-
- /**
- * Encodes the specified Message message. Does not implicitly {@link tutorial.Message.verify|verify} messages.
- * @function encode
- * @memberof tutorial.Message
- * @static
- * @param {tutorial.IMessage} message Message message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- Message.encode = function encode(message, writer) {
- if (!writer)
- writer = $Writer.create();
- if (message.type != null && message.hasOwnProperty("type"))
- writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type);
- if (message.dataMessage != null && message.hasOwnProperty("dataMessage"))
- $root.tutorial.Message.DataMessage.encode(message.dataMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
- if (message.notificationMessage != null && message.hasOwnProperty("notificationMessage"))
- $root.tutorial.Message.NotificationMessage.encode(message.notificationMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
- if (message.roleOptMessage != null && message.hasOwnProperty("roleOptMessage"))
- $root.tutorial.Message.RoleOptMessage.encode(message.roleOptMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
- if (message.reportData != null && message.hasOwnProperty("reportData"))
- $root.tutorial.Message.ReportData.encode(message.reportData, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
- if (message.msg != null && message.hasOwnProperty("msg"))
- writer.uint32(/* id 6, wireType 2 =*/50).string(message.msg);
- if (message.buildingItems != null && message.hasOwnProperty("buildingItems"))
- $root.tutorial.Message.BuildingItems.encode(message.buildingItems, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
- return writer;
- };
-
- /**
- * Encodes the specified Message message, length delimited. Does not implicitly {@link tutorial.Message.verify|verify} messages.
- * @function encodeDelimited
- * @memberof tutorial.Message
- * @static
- * @param {tutorial.IMessage} message Message message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- Message.encodeDelimited = function encodeDelimited(message, writer) {
- return this.encode(message, writer).ldelim();
- };
-
- /**
- * Decodes a Message message from the specified reader or buffer.
- * @function decode
- * @memberof tutorial.Message
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @param {number} [length] Message length if known beforehand
- * @returns {tutorial.Message} Message
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- Message.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.tutorial.Message();
- while (reader.pos < end) {
- var tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.type = reader.int32();
- break;
- case 2:
- message.dataMessage = $root.tutorial.Message.DataMessage.decode(reader, reader.uint32());
- break;
- case 3:
- message.notificationMessage = $root.tutorial.Message.NotificationMessage.decode(reader, reader.uint32());
- break;
- case 4:
- message.roleOptMessage = $root.tutorial.Message.RoleOptMessage.decode(reader, reader.uint32());
- break;
- case 5:
- message.reportData = $root.tutorial.Message.ReportData.decode(reader, reader.uint32());
- break;
- case 6:
- message.msg = reader.string();
- break;
- case 7:
- message.buildingItems = $root.tutorial.Message.BuildingItems.decode(reader, reader.uint32());
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- };
-
- /**
- * Decodes a Message message from the specified reader or buffer, length delimited.
- * @function decodeDelimited
- * @memberof tutorial.Message
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {tutorial.Message} Message
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- Message.decodeDelimited = function decodeDelimited(reader) {
- if (!(reader instanceof $Reader))
- reader = new $Reader(reader);
- return this.decode(reader, reader.uint32());
- };
-
- /**
- * Verifies a Message message.
- * @function verify
- * @memberof tutorial.Message
- * @static
- * @param {Object.<string,*>} message Plain object to verify
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
- */
- Message.verify = function verify(message) {
- if (typeof message !== "object" || message === null)
- return "object expected";
- if (message.type != null && message.hasOwnProperty("type"))
- switch (message.type) {
- default:
- return "type: enum value expected";
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- break;
- }
- if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) {
- var error = $root.tutorial.Message.DataMessage.verify(message.dataMessage);
- if (error)
- return "dataMessage." + error;
- }
- if (message.notificationMessage != null && message.hasOwnProperty("notificationMessage")) {
- var error = $root.tutorial.Message.NotificationMessage.verify(message.notificationMessage);
- if (error)
- return "notificationMessage." + error;
- }
- if (message.roleOptMessage != null && message.hasOwnProperty("roleOptMessage")) {
- var error = $root.tutorial.Message.RoleOptMessage.verify(message.roleOptMessage);
- if (error)
- return "roleOptMessage." + error;
- }
- if (message.reportData != null && message.hasOwnProperty("reportData")) {
- var error = $root.tutorial.Message.ReportData.verify(message.reportData);
- if (error)
- return "reportData." + error;
- }
- if (message.msg != null && message.hasOwnProperty("msg"))
- if (!$util.isString(message.msg))
- return "msg: string expected";
- if (message.buildingItems != null && message.hasOwnProperty("buildingItems")) {
- var error = $root.tutorial.Message.BuildingItems.verify(message.buildingItems);
- if (error)
- return "buildingItems." + error;
- }
- return null;
- };
-
- /**
- * Creates a Message message from a plain object. Also converts values to their respective internal types.
- * @function fromObject
- * @memberof tutorial.Message
- * @static
- * @param {Object.<string,*>} object Plain object
- * @returns {tutorial.Message} Message
- */
- Message.fromObject = function fromObject(object) {
- if (object instanceof $root.tutorial.Message)
- return object;
- var message = new $root.tutorial.Message();
- switch (object.type) {
- case "SELF":
- case 0:
- message.type = 0;
- break;
- case "DATA":
- case 1:
- message.type = 1;
- break;
- case "NOTIFY":
- case 2:
- message.type = 2;
- break;
- case "ROLEOPT":
- case 3:
- message.type = 3;
- break;
- case "REPORT":
- case 4:
- message.type = 4;
- break;
- case "BD_ITEM":
- case 5:
- message.type = 5;
- break;
- case "HB":
- case 6:
- message.type = 6;
- break;
- }
- if (object.dataMessage != null) {
- if (typeof object.dataMessage !== "object")
- throw TypeError(".tutorial.Message.dataMessage: object expected");
- message.dataMessage = $root.tutorial.Message.DataMessage.fromObject(object.dataMessage);
- }
- if (object.notificationMessage != null) {
- if (typeof object.notificationMessage !== "object")
- throw TypeError(".tutorial.Message.notificationMessage: object expected");
- message.notificationMessage = $root.tutorial.Message.NotificationMessage.fromObject(object.notificationMessage);
- }
- if (object.roleOptMessage != null) {
- if (typeof object.roleOptMessage !== "object")
- throw TypeError(".tutorial.Message.roleOptMessage: object expected");
- message.roleOptMessage = $root.tutorial.Message.RoleOptMessage.fromObject(object.roleOptMessage);
- }
- if (object.reportData != null) {
- if (typeof object.reportData !== "object")
- throw TypeError(".tutorial.Message.reportData: object expected");
- message.reportData = $root.tutorial.Message.ReportData.fromObject(object.reportData);
- }
- if (object.msg != null)
- message.msg = String(object.msg);
- if (object.buildingItems != null) {
- if (typeof object.buildingItems !== "object")
- throw TypeError(".tutorial.Message.buildingItems: object expected");
- message.buildingItems = $root.tutorial.Message.BuildingItems.fromObject(object.buildingItems);
- }
- return message;
- };
-
- /**
- * Creates a plain object from a Message message. Also converts values to other types if specified.
- * @function toObject
- * @memberof tutorial.Message
- * @static
- * @param {tutorial.Message} message Message
- * @param {$protobuf.IConversionOptions} [options] Conversion options
- * @returns {Object.<string,*>} Plain object
- */
- Message.toObject = function toObject(message, options) {
- if (!options)
- options = {};
- var object = {};
- if (options.defaults) {
- object.type = options.enums === String ? "SELF" : 0;
- object.dataMessage = null;
- object.notificationMessage = null;
- object.roleOptMessage = null;
- object.reportData = null;
- object.msg = "";
- object.buildingItems = null;
- }
- if (message.type != null && message.hasOwnProperty("type"))
- object.type = options.enums === String ? $root.tutorial.Message.Type[message.type] : message.type;
- if (message.dataMessage != null && message.hasOwnProperty("dataMessage"))
- object.dataMessage = $root.tutorial.Message.DataMessage.toObject(message.dataMessage, options);
- if (message.notificationMessage != null && message.hasOwnProperty("notificationMessage"))
- object.notificationMessage = $root.tutorial.Message.NotificationMessage.toObject(message.notificationMessage, options);
- if (message.roleOptMessage != null && message.hasOwnProperty("roleOptMessage"))
- object.roleOptMessage = $root.tutorial.Message.RoleOptMessage.toObject(message.roleOptMessage, options);
- if (message.reportData != null && message.hasOwnProperty("reportData"))
- object.reportData = $root.tutorial.Message.ReportData.toObject(message.reportData, options);
- if (message.msg != null && message.hasOwnProperty("msg"))
- object.msg = message.msg;
- if (message.buildingItems != null && message.hasOwnProperty("buildingItems"))
- object.buildingItems = $root.tutorial.Message.BuildingItems.toObject(message.buildingItems, options);
- return object;
- };
-
- /**
- * Converts this Message to JSON.
- * @function toJSON
- * @memberof tutorial.Message
- * @instance
- * @returns {Object.<string,*>} JSON object
- */
- Message.prototype.toJSON = function toJSON() {
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
- };
-
- /**
- * Type enum.
- * @name tutorial.Message.Type
- * @enum {string}
- * @property {number} SELF=0 SELF value
- * @property {number} DATA=1 DATA value
- * @property {number} NOTIFY=2 NOTIFY value
- * @property {number} ROLEOPT=3 ROLEOPT value
- * @property {number} REPORT=4 REPORT value
- * @property {number} BD_ITEM=5 BD_ITEM value
- * @property {number} HB=6 HB value
- */
- Message.Type = (function() {
- var valuesById = {}, values = Object.create(valuesById);
- values[valuesById[0] = "SELF"] = 0;
- values[valuesById[1] = "DATA"] = 1;
- values[valuesById[2] = "NOTIFY"] = 2;
- values[valuesById[3] = "ROLEOPT"] = 3;
- values[valuesById[4] = "REPORT"] = 4;
- values[valuesById[5] = "BD_ITEM"] = 5;
- values[valuesById[6] = "HB"] = 6;
- return values;
- })();
-
- Message.DataMessage = (function() {
-
- /**
- * Properties of a DataMessage.
- * @memberof tutorial.Message
- * @interface IDataMessage
- * @property {number|null} [code] DataMessage code
- * @property {number|null} [result] DataMessage result
- * @property {string|null} [data] DataMessage data
- * @property {string|null} [msg] DataMessage msg
- */
-
- /**
- * Constructs a new DataMessage.
- * @memberof tutorial.Message
- * @classdesc Represents a DataMessage.
- * @implements IDataMessage
- * @constructor
- * @param {tutorial.Message.IDataMessage=} [properties] Properties to set
- */
- function DataMessage(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]];
- }
-
- /**
- * DataMessage code.
- * @member {number} code
- * @memberof tutorial.Message.DataMessage
- * @instance
- */
- DataMessage.prototype.code = 0;
-
- /**
- * DataMessage result.
- * @member {number} result
- * @memberof tutorial.Message.DataMessage
- * @instance
- */
- DataMessage.prototype.result = 0;
-
- /**
- * DataMessage data.
- * @member {string} data
- * @memberof tutorial.Message.DataMessage
- * @instance
- */
- DataMessage.prototype.data = "";
-
- /**
- * DataMessage msg.
- * @member {string} msg
- * @memberof tutorial.Message.DataMessage
- * @instance
- */
- DataMessage.prototype.msg = "";
-
- /**
- * Creates a new DataMessage instance using the specified properties.
- * @function create
- * @memberof tutorial.Message.DataMessage
- * @static
- * @param {tutorial.Message.IDataMessage=} [properties] Properties to set
- * @returns {tutorial.Message.DataMessage} DataMessage instance
- */
- DataMessage.create = function create(properties) {
- return new DataMessage(properties);
- };
-
- /**
- * Encodes the specified DataMessage message. Does not implicitly {@link tutorial.Message.DataMessage.verify|verify} messages.
- * @function encode
- * @memberof tutorial.Message.DataMessage
- * @static
- * @param {tutorial.Message.IDataMessage} message DataMessage message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- DataMessage.encode = function encode(message, writer) {
- if (!writer)
- writer = $Writer.create();
- if (message.code != null && message.hasOwnProperty("code"))
- writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
- if (message.result != null && message.hasOwnProperty("result"))
- writer.uint32(/* id 2, wireType 0 =*/16).int32(message.result);
- if (message.data != null && message.hasOwnProperty("data"))
- writer.uint32(/* id 3, wireType 2 =*/26).string(message.data);
- if (message.msg != null && message.hasOwnProperty("msg"))
- writer.uint32(/* id 4, wireType 2 =*/34).string(message.msg);
- return writer;
- };
-
- /**
- * Encodes the specified DataMessage message, length delimited. Does not implicitly {@link tutorial.Message.DataMessage.verify|verify} messages.
- * @function encodeDelimited
- * @memberof tutorial.Message.DataMessage
- * @static
- * @param {tutorial.Message.IDataMessage} message DataMessage message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- DataMessage.encodeDelimited = function encodeDelimited(message, writer) {
- return this.encode(message, writer).ldelim();
- };
-
- /**
- * Decodes a DataMessage message from the specified reader or buffer.
- * @function decode
- * @memberof tutorial.Message.DataMessage
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @param {number} [length] Message length if known beforehand
- * @returns {tutorial.Message.DataMessage} DataMessage
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- DataMessage.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.tutorial.Message.DataMessage();
- while (reader.pos < end) {
- var tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.code = reader.int32();
- break;
- case 2:
- message.result = reader.int32();
- break;
- case 3:
- message.data = reader.string();
- break;
- case 4:
- message.msg = reader.string();
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- };
-
- /**
- * Decodes a DataMessage message from the specified reader or buffer, length delimited.
- * @function decodeDelimited
- * @memberof tutorial.Message.DataMessage
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {tutorial.Message.DataMessage} DataMessage
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- DataMessage.decodeDelimited = function decodeDelimited(reader) {
- if (!(reader instanceof $Reader))
- reader = new $Reader(reader);
- return this.decode(reader, reader.uint32());
- };
-
- /**
- * Verifies a DataMessage message.
- * @function verify
- * @memberof tutorial.Message.DataMessage
- * @static
- * @param {Object.<string,*>} message Plain object to verify
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
- */
- DataMessage.verify = function verify(message) {
- if (typeof message !== "object" || message === null)
- return "object expected";
- if (message.code != null && message.hasOwnProperty("code"))
- if (!$util.isInteger(message.code))
- return "code: integer expected";
- if (message.result != null && message.hasOwnProperty("result"))
- if (!$util.isInteger(message.result))
- return "result: integer expected";
- if (message.data != null && message.hasOwnProperty("data"))
- if (!$util.isString(message.data))
- return "data: string expected";
- if (message.msg != null && message.hasOwnProperty("msg"))
- if (!$util.isString(message.msg))
- return "msg: string expected";
- return null;
- };
-
- /**
- * Creates a DataMessage message from a plain object. Also converts values to their respective internal types.
- * @function fromObject
- * @memberof tutorial.Message.DataMessage
- * @static
- * @param {Object.<string,*>} object Plain object
- * @returns {tutorial.Message.DataMessage} DataMessage
- */
- DataMessage.fromObject = function fromObject(object) {
- if (object instanceof $root.tutorial.Message.DataMessage)
- return object;
- var message = new $root.tutorial.Message.DataMessage();
- if (object.code != null)
- message.code = object.code | 0;
- if (object.result != null)
- message.result = object.result | 0;
- if (object.data != null)
- message.data = String(object.data);
- if (object.msg != null)
- message.msg = String(object.msg);
- return message;
- };
-
- /**
- * Creates a plain object from a DataMessage message. Also converts values to other types if specified.
- * @function toObject
- * @memberof tutorial.Message.DataMessage
- * @static
- * @param {tutorial.Message.DataMessage} message DataMessage
- * @param {$protobuf.IConversionOptions} [options] Conversion options
- * @returns {Object.<string,*>} Plain object
- */
- DataMessage.toObject = function toObject(message, options) {
- if (!options)
- options = {};
- var object = {};
- if (options.defaults) {
- object.code = 0;
- object.result = 0;
- object.data = "";
- object.msg = "";
- }
- if (message.code != null && message.hasOwnProperty("code"))
- object.code = message.code;
- if (message.result != null && message.hasOwnProperty("result"))
- object.result = message.result;
- if (message.data != null && message.hasOwnProperty("data"))
- object.data = message.data;
- if (message.msg != null && message.hasOwnProperty("msg"))
- object.msg = message.msg;
- return object;
- };
-
- /**
- * Converts this DataMessage to JSON.
- * @function toJSON
- * @memberof tutorial.Message.DataMessage
- * @instance
- * @returns {Object.<string,*>} JSON object
- */
- DataMessage.prototype.toJSON = function toJSON() {
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
- };
-
- return DataMessage;
- })();
-
- Message.NotificationMessage = (function() {
-
- /**
- * Properties of a NotificationMessage.
- * @memberof tutorial.Message
- * @interface INotificationMessage
- * @property {number|null} [nType] NotificationMessage nType
- */
-
- /**
- * Constructs a new NotificationMessage.
- * @memberof tutorial.Message
- * @classdesc Represents a NotificationMessage.
- * @implements INotificationMessage
- * @constructor
- * @param {tutorial.Message.INotificationMessage=} [properties] Properties to set
- */
- function NotificationMessage(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]];
- }
-
- /**
- * NotificationMessage nType.
- * @member {number} nType
- * @memberof tutorial.Message.NotificationMessage
- * @instance
- */
- NotificationMessage.prototype.nType = 0;
-
- /**
- * Creates a new NotificationMessage instance using the specified properties.
- * @function create
- * @memberof tutorial.Message.NotificationMessage
- * @static
- * @param {tutorial.Message.INotificationMessage=} [properties] Properties to set
- * @returns {tutorial.Message.NotificationMessage} NotificationMessage instance
- */
- NotificationMessage.create = function create(properties) {
- return new NotificationMessage(properties);
- };
-
- /**
- * Encodes the specified NotificationMessage message. Does not implicitly {@link tutorial.Message.NotificationMessage.verify|verify} messages.
- * @function encode
- * @memberof tutorial.Message.NotificationMessage
- * @static
- * @param {tutorial.Message.INotificationMessage} message NotificationMessage message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- NotificationMessage.encode = function encode(message, writer) {
- if (!writer)
- writer = $Writer.create();
- if (message.nType != null && message.hasOwnProperty("nType"))
- writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nType);
- return writer;
- };
-
- /**
- * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link tutorial.Message.NotificationMessage.verify|verify} messages.
- * @function encodeDelimited
- * @memberof tutorial.Message.NotificationMessage
- * @static
- * @param {tutorial.Message.INotificationMessage} message NotificationMessage message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) {
- return this.encode(message, writer).ldelim();
- };
-
- /**
- * Decodes a NotificationMessage message from the specified reader or buffer.
- * @function decode
- * @memberof tutorial.Message.NotificationMessage
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @param {number} [length] Message length if known beforehand
- * @returns {tutorial.Message.NotificationMessage} NotificationMessage
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- NotificationMessage.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.tutorial.Message.NotificationMessage();
- while (reader.pos < end) {
- var tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.nType = reader.int32();
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- };
-
- /**
- * Decodes a NotificationMessage message from the specified reader or buffer, length delimited.
- * @function decodeDelimited
- * @memberof tutorial.Message.NotificationMessage
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {tutorial.Message.NotificationMessage} NotificationMessage
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- NotificationMessage.decodeDelimited = function decodeDelimited(reader) {
- if (!(reader instanceof $Reader))
- reader = new $Reader(reader);
- return this.decode(reader, reader.uint32());
- };
-
- /**
- * Verifies a NotificationMessage message.
- * @function verify
- * @memberof tutorial.Message.NotificationMessage
- * @static
- * @param {Object.<string,*>} message Plain object to verify
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
- */
- NotificationMessage.verify = function verify(message) {
- if (typeof message !== "object" || message === null)
- return "object expected";
- if (message.nType != null && message.hasOwnProperty("nType"))
- if (!$util.isInteger(message.nType))
- return "nType: integer expected";
- return null;
- };
-
- /**
- * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types.
- * @function fromObject
- * @memberof tutorial.Message.NotificationMessage
- * @static
- * @param {Object.<string,*>} object Plain object
- * @returns {tutorial.Message.NotificationMessage} NotificationMessage
- */
- NotificationMessage.fromObject = function fromObject(object) {
- if (object instanceof $root.tutorial.Message.NotificationMessage)
- return object;
- var message = new $root.tutorial.Message.NotificationMessage();
- if (object.nType != null)
- message.nType = object.nType | 0;
- return message;
- };
-
- /**
- * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified.
- * @function toObject
- * @memberof tutorial.Message.NotificationMessage
- * @static
- * @param {tutorial.Message.NotificationMessage} message NotificationMessage
- * @param {$protobuf.IConversionOptions} [options] Conversion options
- * @returns {Object.<string,*>} Plain object
- */
- NotificationMessage.toObject = function toObject(message, options) {
- if (!options)
- options = {};
- var object = {};
- if (options.defaults)
- object.nType = 0;
- if (message.nType != null && message.hasOwnProperty("nType"))
- object.nType = message.nType;
- return object;
- };
-
- /**
- * Converts this NotificationMessage to JSON.
- * @function toJSON
- * @memberof tutorial.Message.NotificationMessage
- * @instance
- * @returns {Object.<string,*>} JSON object
- */
- NotificationMessage.prototype.toJSON = function toJSON() {
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
- };
-
- return NotificationMessage;
- })();
-
- Message.RoleOptMessage = (function() {
-
- /**
- * Properties of a RoleOptMessage.
- * @memberof tutorial.Message
- * @interface IRoleOptMessage
- * @property {number|Long|null} [targetUid] RoleOptMessage targetUid
- * @property {number|Long|null} [exBossUid] RoleOptMessage exBossUid
- * @property {number|null} [opt] RoleOptMessage opt
- */
-
- /**
- * Constructs a new RoleOptMessage.
- * @memberof tutorial.Message
- * @classdesc Represents a RoleOptMessage.
- * @implements IRoleOptMessage
- * @constructor
- * @param {tutorial.Message.IRoleOptMessage=} [properties] Properties to set
- */
- function RoleOptMessage(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]];
- }
-
- /**
- * RoleOptMessage targetUid.
- * @member {number|Long} targetUid
- * @memberof tutorial.Message.RoleOptMessage
- * @instance
- */
- RoleOptMessage.prototype.targetUid = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
-
- /**
- * RoleOptMessage exBossUid.
- * @member {number|Long} exBossUid
- * @memberof tutorial.Message.RoleOptMessage
- * @instance
- */
- RoleOptMessage.prototype.exBossUid = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
-
- /**
- * RoleOptMessage opt.
- * @member {number} opt
- * @memberof tutorial.Message.RoleOptMessage
- * @instance
- */
- RoleOptMessage.prototype.opt = 0;
-
- /**
- * Creates a new RoleOptMessage instance using the specified properties.
- * @function create
- * @memberof tutorial.Message.RoleOptMessage
- * @static
- * @param {tutorial.Message.IRoleOptMessage=} [properties] Properties to set
- * @returns {tutorial.Message.RoleOptMessage} RoleOptMessage instance
- */
- RoleOptMessage.create = function create(properties) {
- return new RoleOptMessage(properties);
- };
-
- /**
- * Encodes the specified RoleOptMessage message. Does not implicitly {@link tutorial.Message.RoleOptMessage.verify|verify} messages.
- * @function encode
- * @memberof tutorial.Message.RoleOptMessage
- * @static
- * @param {tutorial.Message.IRoleOptMessage} message RoleOptMessage message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- RoleOptMessage.encode = function encode(message, writer) {
- if (!writer)
- writer = $Writer.create();
- if (message.targetUid != null && message.hasOwnProperty("targetUid"))
- writer.uint32(/* id 1, wireType 0 =*/8).int64(message.targetUid);
- if (message.exBossUid != null && message.hasOwnProperty("exBossUid"))
- writer.uint32(/* id 2, wireType 0 =*/16).int64(message.exBossUid);
- if (message.opt != null && message.hasOwnProperty("opt"))
- writer.uint32(/* id 3, wireType 0 =*/24).int32(message.opt);
- return writer;
- };
-
- /**
- * Encodes the specified RoleOptMessage message, length delimited. Does not implicitly {@link tutorial.Message.RoleOptMessage.verify|verify} messages.
- * @function encodeDelimited
- * @memberof tutorial.Message.RoleOptMessage
- * @static
- * @param {tutorial.Message.IRoleOptMessage} message RoleOptMessage message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- RoleOptMessage.encodeDelimited = function encodeDelimited(message, writer) {
- return this.encode(message, writer).ldelim();
- };
-
- /**
- * Decodes a RoleOptMessage message from the specified reader or buffer.
- * @function decode
- * @memberof tutorial.Message.RoleOptMessage
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @param {number} [length] Message length if known beforehand
- * @returns {tutorial.Message.RoleOptMessage} RoleOptMessage
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- RoleOptMessage.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.tutorial.Message.RoleOptMessage();
- while (reader.pos < end) {
- var tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.targetUid = reader.int64();
- break;
- case 2:
- message.exBossUid = reader.int64();
- break;
- case 3:
- message.opt = reader.int32();
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- };
-
- /**
- * Decodes a RoleOptMessage message from the specified reader or buffer, length delimited.
- * @function decodeDelimited
- * @memberof tutorial.Message.RoleOptMessage
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {tutorial.Message.RoleOptMessage} RoleOptMessage
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- RoleOptMessage.decodeDelimited = function decodeDelimited(reader) {
- if (!(reader instanceof $Reader))
- reader = new $Reader(reader);
- return this.decode(reader, reader.uint32());
- };
-
- /**
- * Verifies a RoleOptMessage message.
- * @function verify
- * @memberof tutorial.Message.RoleOptMessage
- * @static
- * @param {Object.<string,*>} message Plain object to verify
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
- */
- RoleOptMessage.verify = function verify(message) {
- if (typeof message !== "object" || message === null)
- return "object expected";
- if (message.targetUid != null && message.hasOwnProperty("targetUid"))
- if (!$util.isInteger(message.targetUid) && !(message.targetUid && $util.isInteger(message.targetUid.low) && $util.isInteger(message.targetUid.high)))
- return "targetUid: integer|Long expected";
- if (message.exBossUid != null && message.hasOwnProperty("exBossUid"))
- if (!$util.isInteger(message.exBossUid) && !(message.exBossUid && $util.isInteger(message.exBossUid.low) && $util.isInteger(message.exBossUid.high)))
- return "exBossUid: integer|Long expected";
- if (message.opt != null && message.hasOwnProperty("opt"))
- if (!$util.isInteger(message.opt))
- return "opt: integer expected";
- return null;
- };
-
- /**
- * Creates a RoleOptMessage message from a plain object. Also converts values to their respective internal types.
- * @function fromObject
- * @memberof tutorial.Message.RoleOptMessage
- * @static
- * @param {Object.<string,*>} object Plain object
- * @returns {tutorial.Message.RoleOptMessage} RoleOptMessage
- */
- RoleOptMessage.fromObject = function fromObject(object) {
- if (object instanceof $root.tutorial.Message.RoleOptMessage)
- return object;
- var message = new $root.tutorial.Message.RoleOptMessage();
- if (object.targetUid != null)
- if ($util.Long)
- (message.targetUid = $util.Long.fromValue(object.targetUid)).unsigned = false;
- else if (typeof object.targetUid === "string")
- message.targetUid = parseInt(object.targetUid, 10);
- else if (typeof object.targetUid === "number")
- message.targetUid = object.targetUid;
- else if (typeof object.targetUid === "object")
- message.targetUid = new $util.LongBits(object.targetUid.low >>> 0, object.targetUid.high >>> 0).toNumber();
- if (object.exBossUid != null)
- if ($util.Long)
- (message.exBossUid = $util.Long.fromValue(object.exBossUid)).unsigned = false;
- else if (typeof object.exBossUid === "string")
- message.exBossUid = parseInt(object.exBossUid, 10);
- else if (typeof object.exBossUid === "number")
- message.exBossUid = object.exBossUid;
- else if (typeof object.exBossUid === "object")
- message.exBossUid = new $util.LongBits(object.exBossUid.low >>> 0, object.exBossUid.high >>> 0).toNumber();
- if (object.opt != null)
- message.opt = object.opt | 0;
- return message;
- };
-
- /**
- * Creates a plain object from a RoleOptMessage message. Also converts values to other types if specified.
- * @function toObject
- * @memberof tutorial.Message.RoleOptMessage
- * @static
- * @param {tutorial.Message.RoleOptMessage} message RoleOptMessage
- * @param {$protobuf.IConversionOptions} [options] Conversion options
- * @returns {Object.<string,*>} Plain object
- */
- RoleOptMessage.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.targetUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
- } else
- object.targetUid = options.longs === String ? "0" : 0;
- if ($util.Long) {
- var long = new $util.Long(0, 0, false);
- object.exBossUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
- } else
- object.exBossUid = options.longs === String ? "0" : 0;
- object.opt = 0;
- }
- if (message.targetUid != null && message.hasOwnProperty("targetUid"))
- if (typeof message.targetUid === "number")
- object.targetUid = options.longs === String ? String(message.targetUid) : message.targetUid;
- else
- object.targetUid = options.longs === String ? $util.Long.prototype.toString.call(message.targetUid) : options.longs === Number ? new $util.LongBits(message.targetUid.low >>> 0, message.targetUid.high >>> 0).toNumber() : message.targetUid;
- if (message.exBossUid != null && message.hasOwnProperty("exBossUid"))
- if (typeof message.exBossUid === "number")
- object.exBossUid = options.longs === String ? String(message.exBossUid) : message.exBossUid;
- else
- object.exBossUid = options.longs === String ? $util.Long.prototype.toString.call(message.exBossUid) : options.longs === Number ? new $util.LongBits(message.exBossUid.low >>> 0, message.exBossUid.high >>> 0).toNumber() : message.exBossUid;
- if (message.opt != null && message.hasOwnProperty("opt"))
- object.opt = message.opt;
- return object;
- };
-
- /**
- * Converts this RoleOptMessage to JSON.
- * @function toJSON
- * @memberof tutorial.Message.RoleOptMessage
- * @instance
- * @returns {Object.<string,*>} JSON object
- */
- RoleOptMessage.prototype.toJSON = function toJSON() {
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
- };
-
- return RoleOptMessage;
- })();
-
- Message.ReportData = (function() {
-
- /**
- * Properties of a ReportData.
- * @memberof tutorial.Message
- * @interface IReportData
- * @property {number|null} [seq] * 上报序号,每次重新获取时重置
- * @property {number|Long|null} [t] 时间戳
- * @property {number|null} [cmd] @see com.duowan.allstar.model.enumeration.Cmd
- * @property {number|Long|null} [gi] grossIncome
- * @property {number|Long|null} [s] @see com.duowan.allstar.model.home.UserExtra#stars
- * @property {Array.<tutorial.Message.IBuildingInfo>|null} [b] @see BuildingInfoForm
- * @property {Array.<tutorial.Message.IBuildingInfo>|null} [ub] 未解锁建筑
- */
-
- /**
- * Constructs a new ReportData.
- * @memberof tutorial.Message
- * @classdesc Represents a ReportData.
- * @implements IReportData
- * @constructor
- * @param {tutorial.Message.IReportData=} [properties] Properties to set
- */
- function ReportData(properties) {
- this.b = [];
- this.ub = [];
- 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]];
- }
-
- /**
- * * 上报序号,每次重新获取时重置
- * @member {number} seq
- * @memberof tutorial.Message.ReportData
- * @instance
- */
- ReportData.prototype.seq = 0;
-
- /**
- * 时间戳
- * @member {number|Long} t
- * @memberof tutorial.Message.ReportData
- * @instance
- */
- ReportData.prototype.t = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
-
- /**
- * @see com.duowan.allstar.model.enumeration.Cmd
- * @member {number} cmd
- * @memberof tutorial.Message.ReportData
- * @instance
- */
- ReportData.prototype.cmd = 0;
-
- /**
- * grossIncome
- * @member {number|Long} gi
- * @memberof tutorial.Message.ReportData
- * @instance
- */
- ReportData.prototype.gi = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
-
- /**
- * @see com.duowan.allstar.model.home.UserExtra#stars
- * @member {number|Long} s
- * @memberof tutorial.Message.ReportData
- * @instance
- */
- ReportData.prototype.s = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
-
- /**
- * @see BuildingInfoForm
- * @member {Array.<tutorial.Message.IBuildingInfo>} b
- * @memberof tutorial.Message.ReportData
- * @instance
- */
- ReportData.prototype.b = $util.emptyArray;
-
- /**
- * 未解锁建筑
- * @member {Array.<tutorial.Message.IBuildingInfo>} ub
- * @memberof tutorial.Message.ReportData
- * @instance
- */
- ReportData.prototype.ub = $util.emptyArray;
-
- /**
- * Creates a new ReportData instance using the specified properties.
- * @function create
- * @memberof tutorial.Message.ReportData
- * @static
- * @param {tutorial.Message.IReportData=} [properties] Properties to set
- * @returns {tutorial.Message.ReportData} ReportData instance
- */
- ReportData.create = function create(properties) {
- return new ReportData(properties);
- };
-
- /**
- * Encodes the specified ReportData message. Does not implicitly {@link tutorial.Message.ReportData.verify|verify} messages.
- * @function encode
- * @memberof tutorial.Message.ReportData
- * @static
- * @param {tutorial.Message.IReportData} message ReportData message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- ReportData.encode = function encode(message, writer) {
- if (!writer)
- writer = $Writer.create();
- if (message.seq != null && message.hasOwnProperty("seq"))
- writer.uint32(/* id 1, wireType 0 =*/8).int32(message.seq);
- if (message.t != null && message.hasOwnProperty("t"))
- writer.uint32(/* id 2, wireType 0 =*/16).int64(message.t);
- if (message.cmd != null && message.hasOwnProperty("cmd"))
- writer.uint32(/* id 3, wireType 0 =*/24).int32(message.cmd);
- if (message.gi != null && message.hasOwnProperty("gi"))
- writer.uint32(/* id 4, wireType 0 =*/32).int64(message.gi);
- if (message.s != null && message.hasOwnProperty("s"))
- writer.uint32(/* id 5, wireType 0 =*/40).int64(message.s);
- if (message.b != null && message.b.length)
- for (var i = 0; i < message.b.length; ++i)
- $root.tutorial.Message.BuildingInfo.encode(message.b[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
- if (message.ub != null && message.ub.length)
- for (var i = 0; i < message.ub.length; ++i)
- $root.tutorial.Message.BuildingInfo.encode(message.ub[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
- return writer;
- };
-
- /**
- * Encodes the specified ReportData message, length delimited. Does not implicitly {@link tutorial.Message.ReportData.verify|verify} messages.
- * @function encodeDelimited
- * @memberof tutorial.Message.ReportData
- * @static
- * @param {tutorial.Message.IReportData} message ReportData message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- ReportData.encodeDelimited = function encodeDelimited(message, writer) {
- return this.encode(message, writer).ldelim();
- };
-
- /**
- * Decodes a ReportData message from the specified reader or buffer.
- * @function decode
- * @memberof tutorial.Message.ReportData
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @param {number} [length] Message length if known beforehand
- * @returns {tutorial.Message.ReportData} ReportData
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- ReportData.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.tutorial.Message.ReportData();
- while (reader.pos < end) {
- var tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.seq = reader.int32();
- break;
- case 2:
- message.t = reader.int64();
- break;
- case 3:
- message.cmd = reader.int32();
- break;
- case 4:
- message.gi = reader.int64();
- break;
- case 5:
- message.s = reader.int64();
- break;
- case 6:
- if (!(message.b && message.b.length))
- message.b = [];
- message.b.push($root.tutorial.Message.BuildingInfo.decode(reader, reader.uint32()));
- break;
- case 7:
- if (!(message.ub && message.ub.length))
- message.ub = [];
- message.ub.push($root.tutorial.Message.BuildingInfo.decode(reader, reader.uint32()));
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- };
-
- /**
- * Decodes a ReportData message from the specified reader or buffer, length delimited.
- * @function decodeDelimited
- * @memberof tutorial.Message.ReportData
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {tutorial.Message.ReportData} ReportData
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- ReportData.decodeDelimited = function decodeDelimited(reader) {
- if (!(reader instanceof $Reader))
- reader = new $Reader(reader);
- return this.decode(reader, reader.uint32());
- };
-
- /**
- * Verifies a ReportData message.
- * @function verify
- * @memberof tutorial.Message.ReportData
- * @static
- * @param {Object.<string,*>} message Plain object to verify
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
- */
- ReportData.verify = function verify(message) {
- if (typeof message !== "object" || message === null)
- return "object expected";
- if (message.seq != null && message.hasOwnProperty("seq"))
- if (!$util.isInteger(message.seq))
- return "seq: integer expected";
- if (message.t != null && message.hasOwnProperty("t"))
- if (!$util.isInteger(message.t) && !(message.t && $util.isInteger(message.t.low) && $util.isInteger(message.t.high)))
- return "t: integer|Long expected";
- if (message.cmd != null && message.hasOwnProperty("cmd"))
- if (!$util.isInteger(message.cmd))
- return "cmd: integer expected";
- if (message.gi != null && message.hasOwnProperty("gi"))
- if (!$util.isInteger(message.gi) && !(message.gi && $util.isInteger(message.gi.low) && $util.isInteger(message.gi.high)))
- return "gi: integer|Long expected";
- if (message.s != null && message.hasOwnProperty("s"))
- if (!$util.isInteger(message.s) && !(message.s && $util.isInteger(message.s.low) && $util.isInteger(message.s.high)))
- return "s: integer|Long expected";
- if (message.b != null && message.hasOwnProperty("b")) {
- if (!Array.isArray(message.b))
- return "b: array expected";
- for (var i = 0; i < message.b.length; ++i) {
- var error = $root.tutorial.Message.BuildingInfo.verify(message.b[i]);
- if (error)
- return "b." + error;
- }
- }
- if (message.ub != null && message.hasOwnProperty("ub")) {
- if (!Array.isArray(message.ub))
- return "ub: array expected";
- for (var i = 0; i < message.ub.length; ++i) {
- var error = $root.tutorial.Message.BuildingInfo.verify(message.ub[i]);
- if (error)
- return "ub." + error;
- }
- }
- return null;
- };
-
- /**
- * Creates a ReportData message from a plain object. Also converts values to their respective internal types.
- * @function fromObject
- * @memberof tutorial.Message.ReportData
- * @static
- * @param {Object.<string,*>} object Plain object
- * @returns {tutorial.Message.ReportData} ReportData
- */
- ReportData.fromObject = function fromObject(object) {
- if (object instanceof $root.tutorial.Message.ReportData)
- return object;
- var message = new $root.tutorial.Message.ReportData();
- if (object.seq != null)
- message.seq = object.seq | 0;
- if (object.t != null)
- if ($util.Long)
- (message.t = $util.Long.fromValue(object.t)).unsigned = false;
- else if (typeof object.t === "string")
- message.t = parseInt(object.t, 10);
- else if (typeof object.t === "number")
- message.t = object.t;
- else if (typeof object.t === "object")
- message.t = new $util.LongBits(object.t.low >>> 0, object.t.high >>> 0).toNumber();
- if (object.cmd != null)
- message.cmd = object.cmd | 0;
- if (object.gi != null)
- if ($util.Long)
- (message.gi = $util.Long.fromValue(object.gi)).unsigned = false;
- else if (typeof object.gi === "string")
- message.gi = parseInt(object.gi, 10);
- else if (typeof object.gi === "number")
- message.gi = object.gi;
- else if (typeof object.gi === "object")
- message.gi = new $util.LongBits(object.gi.low >>> 0, object.gi.high >>> 0).toNumber();
- if (object.s != null)
- if ($util.Long)
- (message.s = $util.Long.fromValue(object.s)).unsigned = false;
- else if (typeof object.s === "string")
- message.s = parseInt(object.s, 10);
- else if (typeof object.s === "number")
- message.s = object.s;
- else if (typeof object.s === "object")
- message.s = new $util.LongBits(object.s.low >>> 0, object.s.high >>> 0).toNumber();
- if (object.b) {
- if (!Array.isArray(object.b))
- throw TypeError(".tutorial.Message.ReportData.b: array expected");
- message.b = [];
- for (var i = 0; i < object.b.length; ++i) {
- if (typeof object.b[i] !== "object")
- throw TypeError(".tutorial.Message.ReportData.b: object expected");
- message.b[i] = $root.tutorial.Message.BuildingInfo.fromObject(object.b[i]);
- }
- }
- if (object.ub) {
- if (!Array.isArray(object.ub))
- throw TypeError(".tutorial.Message.ReportData.ub: array expected");
- message.ub = [];
- for (var i = 0; i < object.ub.length; ++i) {
- if (typeof object.ub[i] !== "object")
- throw TypeError(".tutorial.Message.ReportData.ub: object expected");
- message.ub[i] = $root.tutorial.Message.BuildingInfo.fromObject(object.ub[i]);
- }
- }
- return message;
- };
-
- /**
- * Creates a plain object from a ReportData message. Also converts values to other types if specified.
- * @function toObject
- * @memberof tutorial.Message.ReportData
- * @static
- * @param {tutorial.Message.ReportData} message ReportData
- * @param {$protobuf.IConversionOptions} [options] Conversion options
- * @returns {Object.<string,*>} Plain object
- */
- ReportData.toObject = function toObject(message, options) {
- if (!options)
- options = {};
- var object = {};
- if (options.arrays || options.defaults) {
- object.b = [];
- object.ub = [];
- }
- if (options.defaults) {
- object.seq = 0;
- if ($util.Long) {
- var long = new $util.Long(0, 0, false);
- object.t = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
- } else
- object.t = options.longs === String ? "0" : 0;
- object.cmd = 0;
- if ($util.Long) {
- var long = new $util.Long(0, 0, false);
- object.gi = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
- } else
- object.gi = options.longs === String ? "0" : 0;
- if ($util.Long) {
- var long = new $util.Long(0, 0, false);
- object.s = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
- } else
- object.s = options.longs === String ? "0" : 0;
- }
- if (message.seq != null && message.hasOwnProperty("seq"))
- object.seq = message.seq;
- if (message.t != null && message.hasOwnProperty("t"))
- if (typeof message.t === "number")
- object.t = options.longs === String ? String(message.t) : message.t;
- else
- object.t = options.longs === String ? $util.Long.prototype.toString.call(message.t) : options.longs === Number ? new $util.LongBits(message.t.low >>> 0, message.t.high >>> 0).toNumber() : message.t;
- if (message.cmd != null && message.hasOwnProperty("cmd"))
- object.cmd = message.cmd;
- if (message.gi != null && message.hasOwnProperty("gi"))
- if (typeof message.gi === "number")
- object.gi = options.longs === String ? String(message.gi) : message.gi;
- else
- object.gi = options.longs === String ? $util.Long.prototype.toString.call(message.gi) : options.longs === Number ? new $util.LongBits(message.gi.low >>> 0, message.gi.high >>> 0).toNumber() : message.gi;
- if (message.s != null && message.hasOwnProperty("s"))
- if (typeof message.s === "number")
- object.s = options.longs === String ? String(message.s) : message.s;
- else
- object.s = options.longs === String ? $util.Long.prototype.toString.call(message.s) : options.longs === Number ? new $util.LongBits(message.s.low >>> 0, message.s.high >>> 0).toNumber() : message.s;
- if (message.b && message.b.length) {
- object.b = [];
- for (var j = 0; j < message.b.length; ++j)
- object.b[j] = $root.tutorial.Message.BuildingInfo.toObject(message.b[j], options);
- }
- if (message.ub && message.ub.length) {
- object.ub = [];
- for (var j = 0; j < message.ub.length; ++j)
- object.ub[j] = $root.tutorial.Message.BuildingInfo.toObject(message.ub[j], options);
- }
- return object;
- };
-
- /**
- * Converts this ReportData to JSON.
- * @function toJSON
- * @memberof tutorial.Message.ReportData
- * @instance
- * @returns {Object.<string,*>} JSON object
- */
- ReportData.prototype.toJSON = function toJSON() {
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
- };
-
- return ReportData;
- })();
-
- Message.BuildingInfo = (function() {
-
- /**
- * Properties of a BuildingInfo.
- * @memberof tutorial.Message
- * @interface IBuildingInfo
- * @property {number|Long|null} [id] BuildingInfo id
- * @property {number|null} [l] BuildingInfo l
- * @property {number|null} [cc] BuildingInfo cc
- */
-
- /**
- * Constructs a new BuildingInfo.
- * @memberof tutorial.Message
- * @classdesc Represents a BuildingInfo.
- * @implements IBuildingInfo
- * @constructor
- * @param {tutorial.Message.IBuildingInfo=} [properties] Properties to set
- */
- function BuildingInfo(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]];
- }
-
- /**
- * BuildingInfo id.
- * @member {number|Long} id
- * @memberof tutorial.Message.BuildingInfo
- * @instance
- */
- BuildingInfo.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
-
- /**
- * BuildingInfo l.
- * @member {number} l
- * @memberof tutorial.Message.BuildingInfo
- * @instance
- */
- BuildingInfo.prototype.l = 0;
-
- /**
- * BuildingInfo cc.
- * @member {number} cc
- * @memberof tutorial.Message.BuildingInfo
- * @instance
- */
- BuildingInfo.prototype.cc = 0;
-
- /**
- * Creates a new BuildingInfo instance using the specified properties.
- * @function create
- * @memberof tutorial.Message.BuildingInfo
- * @static
- * @param {tutorial.Message.IBuildingInfo=} [properties] Properties to set
- * @returns {tutorial.Message.BuildingInfo} BuildingInfo instance
- */
- BuildingInfo.create = function create(properties) {
- return new BuildingInfo(properties);
- };
-
- /**
- * Encodes the specified BuildingInfo message. Does not implicitly {@link tutorial.Message.BuildingInfo.verify|verify} messages.
- * @function encode
- * @memberof tutorial.Message.BuildingInfo
- * @static
- * @param {tutorial.Message.IBuildingInfo} message BuildingInfo message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- BuildingInfo.encode = function encode(message, writer) {
- if (!writer)
- writer = $Writer.create();
- if (message.id != null && message.hasOwnProperty("id"))
- writer.uint32(/* id 1, wireType 0 =*/8).int64(message.id);
- if (message.l != null && message.hasOwnProperty("l"))
- writer.uint32(/* id 2, wireType 0 =*/16).int32(message.l);
- if (message.cc != null && message.hasOwnProperty("cc"))
- writer.uint32(/* id 3, wireType 0 =*/24).int32(message.cc);
- return writer;
- };
-
- /**
- * Encodes the specified BuildingInfo message, length delimited. Does not implicitly {@link tutorial.Message.BuildingInfo.verify|verify} messages.
- * @function encodeDelimited
- * @memberof tutorial.Message.BuildingInfo
- * @static
- * @param {tutorial.Message.IBuildingInfo} message BuildingInfo message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- BuildingInfo.encodeDelimited = function encodeDelimited(message, writer) {
- return this.encode(message, writer).ldelim();
- };
-
- /**
- * Decodes a BuildingInfo message from the specified reader or buffer.
- * @function decode
- * @memberof tutorial.Message.BuildingInfo
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @param {number} [length] Message length if known beforehand
- * @returns {tutorial.Message.BuildingInfo} BuildingInfo
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- BuildingInfo.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.tutorial.Message.BuildingInfo();
- while (reader.pos < end) {
- var tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.id = reader.int64();
- break;
- case 2:
- message.l = reader.int32();
- break;
- case 3:
- message.cc = reader.int32();
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- };
-
- /**
- * Decodes a BuildingInfo message from the specified reader or buffer, length delimited.
- * @function decodeDelimited
- * @memberof tutorial.Message.BuildingInfo
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {tutorial.Message.BuildingInfo} BuildingInfo
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- BuildingInfo.decodeDelimited = function decodeDelimited(reader) {
- if (!(reader instanceof $Reader))
- reader = new $Reader(reader);
- return this.decode(reader, reader.uint32());
- };
-
- /**
- * Verifies a BuildingInfo message.
- * @function verify
- * @memberof tutorial.Message.BuildingInfo
- * @static
- * @param {Object.<string,*>} message Plain object to verify
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
- */
- BuildingInfo.verify = function verify(message) {
- if (typeof message !== "object" || message === null)
- return "object expected";
- if (message.id != null && message.hasOwnProperty("id"))
- if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
- return "id: integer|Long expected";
- if (message.l != null && message.hasOwnProperty("l"))
- if (!$util.isInteger(message.l))
- return "l: integer expected";
- if (message.cc != null && message.hasOwnProperty("cc"))
- if (!$util.isInteger(message.cc))
- return "cc: integer expected";
- return null;
- };
-
- /**
- * Creates a BuildingInfo message from a plain object. Also converts values to their respective internal types.
- * @function fromObject
- * @memberof tutorial.Message.BuildingInfo
- * @static
- * @param {Object.<string,*>} object Plain object
- * @returns {tutorial.Message.BuildingInfo} BuildingInfo
- */
- BuildingInfo.fromObject = function fromObject(object) {
- if (object instanceof $root.tutorial.Message.BuildingInfo)
- return object;
- var message = new $root.tutorial.Message.BuildingInfo();
- if (object.id != null)
- if ($util.Long)
- (message.id = $util.Long.fromValue(object.id)).unsigned = false;
- 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();
- if (object.l != null)
- message.l = object.l | 0;
- if (object.cc != null)
- message.cc = object.cc | 0;
- return message;
- };
-
- /**
- * Creates a plain object from a BuildingInfo message. Also converts values to other types if specified.
- * @function toObject
- * @memberof tutorial.Message.BuildingInfo
- * @static
- * @param {tutorial.Message.BuildingInfo} message BuildingInfo
- * @param {$protobuf.IConversionOptions} [options] Conversion options
- * @returns {Object.<string,*>} Plain object
- */
- BuildingInfo.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.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
- } else
- object.id = options.longs === String ? "0" : 0;
- object.l = 0;
- object.cc = 0;
- }
- 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() : message.id;
- if (message.l != null && message.hasOwnProperty("l"))
- object.l = message.l;
- if (message.cc != null && message.hasOwnProperty("cc"))
- object.cc = message.cc;
- return object;
- };
-
- /**
- * Converts this BuildingInfo to JSON.
- * @function toJSON
- * @memberof tutorial.Message.BuildingInfo
- * @instance
- * @returns {Object.<string,*>} JSON object
- */
- BuildingInfo.prototype.toJSON = function toJSON() {
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
- };
-
- return BuildingInfo;
- })();
-
- Message.BuildingItems = (function() {
-
- /**
- * Properties of a BuildingItems.
- * @memberof tutorial.Message
- * @interface IBuildingItems
- * @property {number|Long|null} [buildingId] BuildingItems buildingId
- * @property {tutorial.Message.IItem|null} [item] BuildingItems item
- */
-
- /**
- * Constructs a new BuildingItems.
- * @memberof tutorial.Message
- * @classdesc Represents a BuildingItems.
- * @implements IBuildingItems
- * @constructor
- * @param {tutorial.Message.IBuildingItems=} [properties] Properties to set
- */
- function BuildingItems(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]];
- }
-
- /**
- * BuildingItems buildingId.
- * @member {number|Long} buildingId
- * @memberof tutorial.Message.BuildingItems
- * @instance
- */
- BuildingItems.prototype.buildingId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
-
- /**
- * BuildingItems item.
- * @member {tutorial.Message.IItem|null|undefined} item
- * @memberof tutorial.Message.BuildingItems
- * @instance
- */
- BuildingItems.prototype.item = null;
-
- /**
- * Creates a new BuildingItems instance using the specified properties.
- * @function create
- * @memberof tutorial.Message.BuildingItems
- * @static
- * @param {tutorial.Message.IBuildingItems=} [properties] Properties to set
- * @returns {tutorial.Message.BuildingItems} BuildingItems instance
- */
- BuildingItems.create = function create(properties) {
- return new BuildingItems(properties);
- };
-
- /**
- * Encodes the specified BuildingItems message. Does not implicitly {@link tutorial.Message.BuildingItems.verify|verify} messages.
- * @function encode
- * @memberof tutorial.Message.BuildingItems
- * @static
- * @param {tutorial.Message.IBuildingItems} message BuildingItems message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- BuildingItems.encode = function encode(message, writer) {
- if (!writer)
- writer = $Writer.create();
- if (message.buildingId != null && message.hasOwnProperty("buildingId"))
- writer.uint32(/* id 1, wireType 0 =*/8).int64(message.buildingId);
- if (message.item != null && message.hasOwnProperty("item"))
- $root.tutorial.Message.Item.encode(message.item, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
- return writer;
- };
-
- /**
- * Encodes the specified BuildingItems message, length delimited. Does not implicitly {@link tutorial.Message.BuildingItems.verify|verify} messages.
- * @function encodeDelimited
- * @memberof tutorial.Message.BuildingItems
- * @static
- * @param {tutorial.Message.IBuildingItems} message BuildingItems message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- BuildingItems.encodeDelimited = function encodeDelimited(message, writer) {
- return this.encode(message, writer).ldelim();
- };
-
- /**
- * Decodes a BuildingItems message from the specified reader or buffer.
- * @function decode
- * @memberof tutorial.Message.BuildingItems
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @param {number} [length] Message length if known beforehand
- * @returns {tutorial.Message.BuildingItems} BuildingItems
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- BuildingItems.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.tutorial.Message.BuildingItems();
- while (reader.pos < end) {
- var tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.buildingId = reader.int64();
- break;
- case 2:
- message.item = $root.tutorial.Message.Item.decode(reader, reader.uint32());
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- };
-
- /**
- * Decodes a BuildingItems message from the specified reader or buffer, length delimited.
- * @function decodeDelimited
- * @memberof tutorial.Message.BuildingItems
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {tutorial.Message.BuildingItems} BuildingItems
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- BuildingItems.decodeDelimited = function decodeDelimited(reader) {
- if (!(reader instanceof $Reader))
- reader = new $Reader(reader);
- return this.decode(reader, reader.uint32());
- };
-
- /**
- * Verifies a BuildingItems message.
- * @function verify
- * @memberof tutorial.Message.BuildingItems
- * @static
- * @param {Object.<string,*>} message Plain object to verify
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
- */
- BuildingItems.verify = function verify(message) {
- if (typeof message !== "object" || message === null)
- return "object expected";
- if (message.buildingId != null && message.hasOwnProperty("buildingId"))
- if (!$util.isInteger(message.buildingId) && !(message.buildingId && $util.isInteger(message.buildingId.low) && $util.isInteger(message.buildingId.high)))
- return "buildingId: integer|Long expected";
- if (message.item != null && message.hasOwnProperty("item")) {
- var error = $root.tutorial.Message.Item.verify(message.item);
- if (error)
- return "item." + error;
- }
- return null;
- };
-
- /**
- * Creates a BuildingItems message from a plain object. Also converts values to their respective internal types.
- * @function fromObject
- * @memberof tutorial.Message.BuildingItems
- * @static
- * @param {Object.<string,*>} object Plain object
- * @returns {tutorial.Message.BuildingItems} BuildingItems
- */
- BuildingItems.fromObject = function fromObject(object) {
- if (object instanceof $root.tutorial.Message.BuildingItems)
- return object;
- var message = new $root.tutorial.Message.BuildingItems();
- if (object.buildingId != null)
- if ($util.Long)
- (message.buildingId = $util.Long.fromValue(object.buildingId)).unsigned = false;
- else if (typeof object.buildingId === "string")
- message.buildingId = parseInt(object.buildingId, 10);
- else if (typeof object.buildingId === "number")
- message.buildingId = object.buildingId;
- else if (typeof object.buildingId === "object")
- message.buildingId = new $util.LongBits(object.buildingId.low >>> 0, object.buildingId.high >>> 0).toNumber();
- if (object.item != null) {
- if (typeof object.item !== "object")
- throw TypeError(".tutorial.Message.BuildingItems.item: object expected");
- message.item = $root.tutorial.Message.Item.fromObject(object.item);
- }
- return message;
- };
-
- /**
- * Creates a plain object from a BuildingItems message. Also converts values to other types if specified.
- * @function toObject
- * @memberof tutorial.Message.BuildingItems
- * @static
- * @param {tutorial.Message.BuildingItems} message BuildingItems
- * @param {$protobuf.IConversionOptions} [options] Conversion options
- * @returns {Object.<string,*>} Plain object
- */
- BuildingItems.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.buildingId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
- } else
- object.buildingId = options.longs === String ? "0" : 0;
- object.item = null;
- }
- if (message.buildingId != null && message.hasOwnProperty("buildingId"))
- if (typeof message.buildingId === "number")
- object.buildingId = options.longs === String ? String(message.buildingId) : message.buildingId;
- else
- object.buildingId = options.longs === String ? $util.Long.prototype.toString.call(message.buildingId) : options.longs === Number ? new $util.LongBits(message.buildingId.low >>> 0, message.buildingId.high >>> 0).toNumber() : message.buildingId;
- if (message.item != null && message.hasOwnProperty("item"))
- object.item = $root.tutorial.Message.Item.toObject(message.item, options);
- return object;
- };
-
- /**
- * Converts this BuildingItems to JSON.
- * @function toJSON
- * @memberof tutorial.Message.BuildingItems
- * @instance
- * @returns {Object.<string,*>} JSON object
- */
- BuildingItems.prototype.toJSON = function toJSON() {
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
- };
-
- return BuildingItems;
- })();
-
- Message.Item = (function() {
-
- /**
- * Properties of an Item.
- * @memberof tutorial.Message
- * @interface IItem
- * @property {number|Long|null} [id] Item id
- * @property {number|null} [count] Item count
- */
-
- /**
- * Constructs a new Item.
- * @memberof tutorial.Message
- * @classdesc Represents an Item.
- * @implements IItem
- * @constructor
- * @param {tutorial.Message.IItem=} [properties] Properties to set
- */
- function Item(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]];
- }
-
- /**
- * Item id.
- * @member {number|Long} id
- * @memberof tutorial.Message.Item
- * @instance
- */
- Item.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
-
- /**
- * Item count.
- * @member {number} count
- * @memberof tutorial.Message.Item
- * @instance
- */
- Item.prototype.count = 0;
-
- /**
- * Creates a new Item instance using the specified properties.
- * @function create
- * @memberof tutorial.Message.Item
- * @static
- * @param {tutorial.Message.IItem=} [properties] Properties to set
- * @returns {tutorial.Message.Item} Item instance
- */
- Item.create = function create(properties) {
- return new Item(properties);
- };
-
- /**
- * Encodes the specified Item message. Does not implicitly {@link tutorial.Message.Item.verify|verify} messages.
- * @function encode
- * @memberof tutorial.Message.Item
- * @static
- * @param {tutorial.Message.IItem} message Item message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- Item.encode = function encode(message, writer) {
- if (!writer)
- writer = $Writer.create();
- if (message.id != null && message.hasOwnProperty("id"))
- writer.uint32(/* id 1, wireType 0 =*/8).int64(message.id);
- if (message.count != null && message.hasOwnProperty("count"))
- writer.uint32(/* id 2, wireType 0 =*/16).int32(message.count);
- return writer;
- };
-
- /**
- * Encodes the specified Item message, length delimited. Does not implicitly {@link tutorial.Message.Item.verify|verify} messages.
- * @function encodeDelimited
- * @memberof tutorial.Message.Item
- * @static
- * @param {tutorial.Message.IItem} message Item message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- Item.encodeDelimited = function encodeDelimited(message, writer) {
- return this.encode(message, writer).ldelim();
- };
-
- /**
- * Decodes an Item message from the specified reader or buffer.
- * @function decode
- * @memberof tutorial.Message.Item
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @param {number} [length] Message length if known beforehand
- * @returns {tutorial.Message.Item} Item
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- Item.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.tutorial.Message.Item();
- while (reader.pos < end) {
- var tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.id = reader.int64();
- break;
- case 2:
- message.count = reader.int32();
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- };
-
- /**
- * Decodes an Item message from the specified reader or buffer, length delimited.
- * @function decodeDelimited
- * @memberof tutorial.Message.Item
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {tutorial.Message.Item} Item
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- Item.decodeDelimited = function decodeDelimited(reader) {
- if (!(reader instanceof $Reader))
- reader = new $Reader(reader);
- return this.decode(reader, reader.uint32());
- };
-
- /**
- * Verifies an Item message.
- * @function verify
- * @memberof tutorial.Message.Item
- * @static
- * @param {Object.<string,*>} message Plain object to verify
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
- */
- Item.verify = function verify(message) {
- if (typeof message !== "object" || message === null)
- return "object expected";
- if (message.id != null && message.hasOwnProperty("id"))
- if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
- return "id: integer|Long expected";
- if (message.count != null && message.hasOwnProperty("count"))
- if (!$util.isInteger(message.count))
- return "count: integer expected";
- return null;
- };
-
- /**
- * Creates an Item message from a plain object. Also converts values to their respective internal types.
- * @function fromObject
- * @memberof tutorial.Message.Item
- * @static
- * @param {Object.<string,*>} object Plain object
- * @returns {tutorial.Message.Item} Item
- */
- Item.fromObject = function fromObject(object) {
- if (object instanceof $root.tutorial.Message.Item)
- return object;
- var message = new $root.tutorial.Message.Item();
- if (object.id != null)
- if ($util.Long)
- (message.id = $util.Long.fromValue(object.id)).unsigned = false;
- 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();
- if (object.count != null)
- message.count = object.count | 0;
- return message;
- };
-
- /**
- * Creates a plain object from an Item message. Also converts values to other types if specified.
- * @function toObject
- * @memberof tutorial.Message.Item
- * @static
- * @param {tutorial.Message.Item} message Item
- * @param {$protobuf.IConversionOptions} [options] Conversion options
- * @returns {Object.<string,*>} Plain object
- */
- Item.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.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
- } else
- object.id = options.longs === String ? "0" : 0;
- object.count = 0;
- }
- 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() : message.id;
- if (message.count != null && message.hasOwnProperty("count"))
- object.count = message.count;
- return object;
- };
-
- /**
- * Converts this Item to JSON.
- * @function toJSON
- * @memberof tutorial.Message.Item
- * @instance
- * @returns {Object.<string,*>} JSON object
- */
- Item.prototype.toJSON = function toJSON() {
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
- };
-
- return Item;
- })();
-
- return Message;
- })();
-
- return tutorial;
- })();
- return $root;
- });
|