12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339 |
- /*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
- * @property {number|Long|null} [rUid] Message rUid
- */
-
- /**
- * 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;
-
- /**
- * Message rUid.
- * @member {number|Long} rUid
- * @memberof tutorial.Message
- * @instance
- */
- Message.prototype.rUid = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
-
- /**
- * 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();
- if (message.rUid != null && message.hasOwnProperty("rUid"))
- writer.uint32(/* id 8, wireType 0 =*/64).int64(message.rUid);
- 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;
- case 8:
- message.rUid = reader.int64();
- 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;
- }
- if (message.rUid != null && message.hasOwnProperty("rUid"))
- if (!$util.isInteger(message.rUid) && !(message.rUid && $util.isInteger(message.rUid.low) && $util.isInteger(message.rUid.high)))
- return "rUid: integer|Long expected";
- 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);
- }
- if (object.rUid != null)
- if ($util.Long)
- (message.rUid = $util.Long.fromValue(object.rUid)).unsigned = false;
- else if (typeof object.rUid === "string")
- message.rUid = parseInt(object.rUid, 10);
- else if (typeof object.rUid === "number")
- message.rUid = object.rUid;
- else if (typeof object.rUid === "object")
- message.rUid = new $util.LongBits(object.rUid.low >>> 0, object.rUid.high >>> 0).toNumber();
- 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 ($util.Long) {
- var long = new $util.Long(0, 0, false);
- object.rUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
- } else
- object.rUid = options.longs === String ? "0" : 0;
- }
- 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);
- if (message.rUid != null && message.hasOwnProperty("rUid"))
- if (typeof message.rUid === "number")
- object.rUid = options.longs === String ? String(message.rUid) : message.rUid;
- else
- object.rUid = options.longs === String ? $util.Long.prototype.toString.call(message.rUid) : options.longs === Number ? new $util.LongBits(message.rUid.low >>> 0, message.rUid.high >>> 0).toNumber() : message.rUid;
- 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
- * @property {string|null} [name] Item name
- * @property {number|Long|null} [picId] Item picId
- */
-
- /**
- * 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;
-
- /**
- * Item name.
- * @member {string} name
- * @memberof tutorial.Message.Item
- * @instance
- */
- Item.prototype.name = "";
-
- /**
- * Item picId.
- * @member {number|Long} picId
- * @memberof tutorial.Message.Item
- * @instance
- */
- Item.prototype.picId = $util.Long ? $util.Long.fromBits(0,0,false) : 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);
- if (message.name != null && message.hasOwnProperty("name"))
- writer.uint32(/* id 3, wireType 2 =*/26).string(message.name);
- if (message.picId != null && message.hasOwnProperty("picId"))
- writer.uint32(/* id 4, wireType 0 =*/32).int64(message.picId);
- 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;
- case 3:
- message.name = reader.string();
- break;
- case 4:
- message.picId = reader.int64();
- 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";
- if (message.name != null && message.hasOwnProperty("name"))
- if (!$util.isString(message.name))
- return "name: string expected";
- if (message.picId != null && message.hasOwnProperty("picId"))
- if (!$util.isInteger(message.picId) && !(message.picId && $util.isInteger(message.picId.low) && $util.isInteger(message.picId.high)))
- return "picId: integer|Long 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;
- if (object.name != null)
- message.name = String(object.name);
- if (object.picId != null)
- if ($util.Long)
- (message.picId = $util.Long.fromValue(object.picId)).unsigned = false;
- else if (typeof object.picId === "string")
- message.picId = parseInt(object.picId, 10);
- else if (typeof object.picId === "number")
- message.picId = object.picId;
- else if (typeof object.picId === "object")
- message.picId = new $util.LongBits(object.picId.low >>> 0, object.picId.high >>> 0).toNumber();
- 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;
- object.name = "";
- if ($util.Long) {
- var long = new $util.Long(0, 0, false);
- object.picId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
- } else
- object.picId = options.longs === String ? "0" : 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;
- if (message.name != null && message.hasOwnProperty("name"))
- object.name = message.name;
- if (message.picId != null && message.hasOwnProperty("picId"))
- if (typeof message.picId === "number")
- object.picId = options.longs === String ? String(message.picId) : message.picId;
- else
- object.picId = options.longs === String ? $util.Long.prototype.toString.call(message.picId) : options.longs === Number ? new $util.LongBits(message.picId.low >>> 0, message.picId.high >>> 0).toNumber() : message.picId;
- 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;
- });
|