Bundle.js 88 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751
  1. /*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
  2. (function(global, factory) { /* global define, require, module */
  3. /* AMD */ if (typeof define === 'function' && define.amd)
  4. define(["protobufjs/minimal"], factory);
  5. /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
  6. module.exports = factory(require("protobufjs/minimal"));
  7. })(this, function($protobuf) {
  8. "use strict";
  9. // Common aliases
  10. var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
  11. // Exported root namespace
  12. var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
  13. $root.tutorial = (function() {
  14. /**
  15. * Namespace tutorial.
  16. * @exports tutorial
  17. * @namespace
  18. */
  19. var tutorial = {};
  20. tutorial.Message = (function() {
  21. /**
  22. * Properties of a Message.
  23. * @memberof tutorial
  24. * @interface IMessage
  25. * @property {tutorial.Message.Type|null} [type] Message type
  26. * @property {tutorial.Message.IDataMessage|null} [dataMessage] Message dataMessage
  27. * @property {tutorial.Message.INotificationMessage|null} [notificationMessage] Message notificationMessage
  28. * @property {tutorial.Message.IRoleOptMessage|null} [roleOptMessage] Message roleOptMessage
  29. * @property {tutorial.Message.IReportData|null} [reportData] Message reportData
  30. * @property {string|null} [msg] Message msg
  31. */
  32. /**
  33. * Constructs a new Message.
  34. * @memberof tutorial
  35. * @classdesc Represents a Message.
  36. * @implements IMessage
  37. * @constructor
  38. * @param {tutorial.IMessage=} [properties] Properties to set
  39. */
  40. function Message(properties) {
  41. if (properties)
  42. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  43. if (properties[keys[i]] != null)
  44. this[keys[i]] = properties[keys[i]];
  45. }
  46. /**
  47. * Message type.
  48. * @member {tutorial.Message.Type} type
  49. * @memberof tutorial.Message
  50. * @instance
  51. */
  52. Message.prototype.type = 0;
  53. /**
  54. * Message dataMessage.
  55. * @member {tutorial.Message.IDataMessage|null|undefined} dataMessage
  56. * @memberof tutorial.Message
  57. * @instance
  58. */
  59. Message.prototype.dataMessage = null;
  60. /**
  61. * Message notificationMessage.
  62. * @member {tutorial.Message.INotificationMessage|null|undefined} notificationMessage
  63. * @memberof tutorial.Message
  64. * @instance
  65. */
  66. Message.prototype.notificationMessage = null;
  67. /**
  68. * Message roleOptMessage.
  69. * @member {tutorial.Message.IRoleOptMessage|null|undefined} roleOptMessage
  70. * @memberof tutorial.Message
  71. * @instance
  72. */
  73. Message.prototype.roleOptMessage = null;
  74. /**
  75. * Message reportData.
  76. * @member {tutorial.Message.IReportData|null|undefined} reportData
  77. * @memberof tutorial.Message
  78. * @instance
  79. */
  80. Message.prototype.reportData = null;
  81. /**
  82. * Message msg.
  83. * @member {string} msg
  84. * @memberof tutorial.Message
  85. * @instance
  86. */
  87. Message.prototype.msg = "";
  88. /**
  89. * Creates a new Message instance using the specified properties.
  90. * @function create
  91. * @memberof tutorial.Message
  92. * @static
  93. * @param {tutorial.IMessage=} [properties] Properties to set
  94. * @returns {tutorial.Message} Message instance
  95. */
  96. Message.create = function create(properties) {
  97. return new Message(properties);
  98. };
  99. /**
  100. * Encodes the specified Message message. Does not implicitly {@link tutorial.Message.verify|verify} messages.
  101. * @function encode
  102. * @memberof tutorial.Message
  103. * @static
  104. * @param {tutorial.IMessage} message Message message or plain object to encode
  105. * @param {$protobuf.Writer} [writer] Writer to encode to
  106. * @returns {$protobuf.Writer} Writer
  107. */
  108. Message.encode = function encode(message, writer) {
  109. if (!writer)
  110. writer = $Writer.create();
  111. if (message.type != null && message.hasOwnProperty("type"))
  112. writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type);
  113. if (message.dataMessage != null && message.hasOwnProperty("dataMessage"))
  114. $root.tutorial.Message.DataMessage.encode(message.dataMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
  115. if (message.notificationMessage != null && message.hasOwnProperty("notificationMessage"))
  116. $root.tutorial.Message.NotificationMessage.encode(message.notificationMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
  117. if (message.roleOptMessage != null && message.hasOwnProperty("roleOptMessage"))
  118. $root.tutorial.Message.RoleOptMessage.encode(message.roleOptMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
  119. if (message.reportData != null && message.hasOwnProperty("reportData"))
  120. $root.tutorial.Message.ReportData.encode(message.reportData, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
  121. if (message.msg != null && message.hasOwnProperty("msg"))
  122. writer.uint32(/* id 6, wireType 2 =*/50).string(message.msg);
  123. return writer;
  124. };
  125. /**
  126. * Encodes the specified Message message, length delimited. Does not implicitly {@link tutorial.Message.verify|verify} messages.
  127. * @function encodeDelimited
  128. * @memberof tutorial.Message
  129. * @static
  130. * @param {tutorial.IMessage} message Message message or plain object to encode
  131. * @param {$protobuf.Writer} [writer] Writer to encode to
  132. * @returns {$protobuf.Writer} Writer
  133. */
  134. Message.encodeDelimited = function encodeDelimited(message, writer) {
  135. return this.encode(message, writer).ldelim();
  136. };
  137. /**
  138. * Decodes a Message message from the specified reader or buffer.
  139. * @function decode
  140. * @memberof tutorial.Message
  141. * @static
  142. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  143. * @param {number} [length] Message length if known beforehand
  144. * @returns {tutorial.Message} Message
  145. * @throws {Error} If the payload is not a reader or valid buffer
  146. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  147. */
  148. Message.decode = function decode(reader, length) {
  149. if (!(reader instanceof $Reader))
  150. reader = $Reader.create(reader);
  151. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message();
  152. while (reader.pos < end) {
  153. var tag = reader.uint32();
  154. switch (tag >>> 3) {
  155. case 1:
  156. message.type = reader.int32();
  157. break;
  158. case 2:
  159. message.dataMessage = $root.tutorial.Message.DataMessage.decode(reader, reader.uint32());
  160. break;
  161. case 3:
  162. message.notificationMessage = $root.tutorial.Message.NotificationMessage.decode(reader, reader.uint32());
  163. break;
  164. case 4:
  165. message.roleOptMessage = $root.tutorial.Message.RoleOptMessage.decode(reader, reader.uint32());
  166. break;
  167. case 5:
  168. message.reportData = $root.tutorial.Message.ReportData.decode(reader, reader.uint32());
  169. break;
  170. case 6:
  171. message.msg = reader.string();
  172. break;
  173. default:
  174. reader.skipType(tag & 7);
  175. break;
  176. }
  177. }
  178. return message;
  179. };
  180. /**
  181. * Decodes a Message message from the specified reader or buffer, length delimited.
  182. * @function decodeDelimited
  183. * @memberof tutorial.Message
  184. * @static
  185. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  186. * @returns {tutorial.Message} Message
  187. * @throws {Error} If the payload is not a reader or valid buffer
  188. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  189. */
  190. Message.decodeDelimited = function decodeDelimited(reader) {
  191. if (!(reader instanceof $Reader))
  192. reader = new $Reader(reader);
  193. return this.decode(reader, reader.uint32());
  194. };
  195. /**
  196. * Verifies a Message message.
  197. * @function verify
  198. * @memberof tutorial.Message
  199. * @static
  200. * @param {Object.<string,*>} message Plain object to verify
  201. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  202. */
  203. Message.verify = function verify(message) {
  204. if (typeof message !== "object" || message === null)
  205. return "object expected";
  206. if (message.type != null && message.hasOwnProperty("type"))
  207. switch (message.type) {
  208. default:
  209. return "type: enum value expected";
  210. case 0:
  211. case 1:
  212. case 2:
  213. case 3:
  214. case 4:
  215. break;
  216. }
  217. if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) {
  218. var error = $root.tutorial.Message.DataMessage.verify(message.dataMessage);
  219. if (error)
  220. return "dataMessage." + error;
  221. }
  222. if (message.notificationMessage != null && message.hasOwnProperty("notificationMessage")) {
  223. var error = $root.tutorial.Message.NotificationMessage.verify(message.notificationMessage);
  224. if (error)
  225. return "notificationMessage." + error;
  226. }
  227. if (message.roleOptMessage != null && message.hasOwnProperty("roleOptMessage")) {
  228. var error = $root.tutorial.Message.RoleOptMessage.verify(message.roleOptMessage);
  229. if (error)
  230. return "roleOptMessage." + error;
  231. }
  232. if (message.reportData != null && message.hasOwnProperty("reportData")) {
  233. var error = $root.tutorial.Message.ReportData.verify(message.reportData);
  234. if (error)
  235. return "reportData." + error;
  236. }
  237. if (message.msg != null && message.hasOwnProperty("msg"))
  238. if (!$util.isString(message.msg))
  239. return "msg: string expected";
  240. return null;
  241. };
  242. /**
  243. * Creates a Message message from a plain object. Also converts values to their respective internal types.
  244. * @function fromObject
  245. * @memberof tutorial.Message
  246. * @static
  247. * @param {Object.<string,*>} object Plain object
  248. * @returns {tutorial.Message} Message
  249. */
  250. Message.fromObject = function fromObject(object) {
  251. if (object instanceof $root.tutorial.Message)
  252. return object;
  253. var message = new $root.tutorial.Message();
  254. switch (object.type) {
  255. case "SELF":
  256. case 0:
  257. message.type = 0;
  258. break;
  259. case "DATA":
  260. case 1:
  261. message.type = 1;
  262. break;
  263. case "NOTIFY":
  264. case 2:
  265. message.type = 2;
  266. break;
  267. case "ROLEOPT":
  268. case 3:
  269. message.type = 3;
  270. break;
  271. case "REPORT":
  272. case 4:
  273. message.type = 4;
  274. break;
  275. }
  276. if (object.dataMessage != null) {
  277. if (typeof object.dataMessage !== "object")
  278. throw TypeError(".tutorial.Message.dataMessage: object expected");
  279. message.dataMessage = $root.tutorial.Message.DataMessage.fromObject(object.dataMessage);
  280. }
  281. if (object.notificationMessage != null) {
  282. if (typeof object.notificationMessage !== "object")
  283. throw TypeError(".tutorial.Message.notificationMessage: object expected");
  284. message.notificationMessage = $root.tutorial.Message.NotificationMessage.fromObject(object.notificationMessage);
  285. }
  286. if (object.roleOptMessage != null) {
  287. if (typeof object.roleOptMessage !== "object")
  288. throw TypeError(".tutorial.Message.roleOptMessage: object expected");
  289. message.roleOptMessage = $root.tutorial.Message.RoleOptMessage.fromObject(object.roleOptMessage);
  290. }
  291. if (object.reportData != null) {
  292. if (typeof object.reportData !== "object")
  293. throw TypeError(".tutorial.Message.reportData: object expected");
  294. message.reportData = $root.tutorial.Message.ReportData.fromObject(object.reportData);
  295. }
  296. if (object.msg != null)
  297. message.msg = String(object.msg);
  298. return message;
  299. };
  300. /**
  301. * Creates a plain object from a Message message. Also converts values to other types if specified.
  302. * @function toObject
  303. * @memberof tutorial.Message
  304. * @static
  305. * @param {tutorial.Message} message Message
  306. * @param {$protobuf.IConversionOptions} [options] Conversion options
  307. * @returns {Object.<string,*>} Plain object
  308. */
  309. Message.toObject = function toObject(message, options) {
  310. if (!options)
  311. options = {};
  312. var object = {};
  313. if (options.defaults) {
  314. object.type = options.enums === String ? "SELF" : 0;
  315. object.dataMessage = null;
  316. object.notificationMessage = null;
  317. object.roleOptMessage = null;
  318. object.reportData = null;
  319. object.msg = "";
  320. }
  321. if (message.type != null && message.hasOwnProperty("type"))
  322. object.type = options.enums === String ? $root.tutorial.Message.Type[message.type] : message.type;
  323. if (message.dataMessage != null && message.hasOwnProperty("dataMessage"))
  324. object.dataMessage = $root.tutorial.Message.DataMessage.toObject(message.dataMessage, options);
  325. if (message.notificationMessage != null && message.hasOwnProperty("notificationMessage"))
  326. object.notificationMessage = $root.tutorial.Message.NotificationMessage.toObject(message.notificationMessage, options);
  327. if (message.roleOptMessage != null && message.hasOwnProperty("roleOptMessage"))
  328. object.roleOptMessage = $root.tutorial.Message.RoleOptMessage.toObject(message.roleOptMessage, options);
  329. if (message.reportData != null && message.hasOwnProperty("reportData"))
  330. object.reportData = $root.tutorial.Message.ReportData.toObject(message.reportData, options);
  331. if (message.msg != null && message.hasOwnProperty("msg"))
  332. object.msg = message.msg;
  333. return object;
  334. };
  335. /**
  336. * Converts this Message to JSON.
  337. * @function toJSON
  338. * @memberof tutorial.Message
  339. * @instance
  340. * @returns {Object.<string,*>} JSON object
  341. */
  342. Message.prototype.toJSON = function toJSON() {
  343. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  344. };
  345. /**
  346. * Type enum.
  347. * @name tutorial.Message.Type
  348. * @enum {string}
  349. * @property {number} SELF=0 SELF value
  350. * @property {number} DATA=1 DATA value
  351. * @property {number} NOTIFY=2 NOTIFY value
  352. * @property {number} ROLEOPT=3 ROLEOPT value
  353. * @property {number} REPORT=4 REPORT value
  354. */
  355. Message.Type = (function() {
  356. var valuesById = {}, values = Object.create(valuesById);
  357. values[valuesById[0] = "SELF"] = 0;
  358. values[valuesById[1] = "DATA"] = 1;
  359. values[valuesById[2] = "NOTIFY"] = 2;
  360. values[valuesById[3] = "ROLEOPT"] = 3;
  361. values[valuesById[4] = "REPORT"] = 4;
  362. return values;
  363. })();
  364. Message.DataMessage = (function() {
  365. /**
  366. * Properties of a DataMessage.
  367. * @memberof tutorial.Message
  368. * @interface IDataMessage
  369. * @property {number|null} [code] DataMessage code
  370. * @property {number|null} [result] DataMessage result
  371. * @property {string|null} [data] DataMessage data
  372. * @property {string|null} [msg] DataMessage msg
  373. */
  374. /**
  375. * Constructs a new DataMessage.
  376. * @memberof tutorial.Message
  377. * @classdesc Represents a DataMessage.
  378. * @implements IDataMessage
  379. * @constructor
  380. * @param {tutorial.Message.IDataMessage=} [properties] Properties to set
  381. */
  382. function DataMessage(properties) {
  383. if (properties)
  384. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  385. if (properties[keys[i]] != null)
  386. this[keys[i]] = properties[keys[i]];
  387. }
  388. /**
  389. * DataMessage code.
  390. * @member {number} code
  391. * @memberof tutorial.Message.DataMessage
  392. * @instance
  393. */
  394. DataMessage.prototype.code = 0;
  395. /**
  396. * DataMessage result.
  397. * @member {number} result
  398. * @memberof tutorial.Message.DataMessage
  399. * @instance
  400. */
  401. DataMessage.prototype.result = 0;
  402. /**
  403. * DataMessage data.
  404. * @member {string} data
  405. * @memberof tutorial.Message.DataMessage
  406. * @instance
  407. */
  408. DataMessage.prototype.data = "";
  409. /**
  410. * DataMessage msg.
  411. * @member {string} msg
  412. * @memberof tutorial.Message.DataMessage
  413. * @instance
  414. */
  415. DataMessage.prototype.msg = "";
  416. /**
  417. * Creates a new DataMessage instance using the specified properties.
  418. * @function create
  419. * @memberof tutorial.Message.DataMessage
  420. * @static
  421. * @param {tutorial.Message.IDataMessage=} [properties] Properties to set
  422. * @returns {tutorial.Message.DataMessage} DataMessage instance
  423. */
  424. DataMessage.create = function create(properties) {
  425. return new DataMessage(properties);
  426. };
  427. /**
  428. * Encodes the specified DataMessage message. Does not implicitly {@link tutorial.Message.DataMessage.verify|verify} messages.
  429. * @function encode
  430. * @memberof tutorial.Message.DataMessage
  431. * @static
  432. * @param {tutorial.Message.IDataMessage} message DataMessage message or plain object to encode
  433. * @param {$protobuf.Writer} [writer] Writer to encode to
  434. * @returns {$protobuf.Writer} Writer
  435. */
  436. DataMessage.encode = function encode(message, writer) {
  437. if (!writer)
  438. writer = $Writer.create();
  439. if (message.code != null && message.hasOwnProperty("code"))
  440. writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
  441. if (message.result != null && message.hasOwnProperty("result"))
  442. writer.uint32(/* id 2, wireType 0 =*/16).int32(message.result);
  443. if (message.data != null && message.hasOwnProperty("data"))
  444. writer.uint32(/* id 3, wireType 2 =*/26).string(message.data);
  445. if (message.msg != null && message.hasOwnProperty("msg"))
  446. writer.uint32(/* id 4, wireType 2 =*/34).string(message.msg);
  447. return writer;
  448. };
  449. /**
  450. * Encodes the specified DataMessage message, length delimited. Does not implicitly {@link tutorial.Message.DataMessage.verify|verify} messages.
  451. * @function encodeDelimited
  452. * @memberof tutorial.Message.DataMessage
  453. * @static
  454. * @param {tutorial.Message.IDataMessage} message DataMessage message or plain object to encode
  455. * @param {$protobuf.Writer} [writer] Writer to encode to
  456. * @returns {$protobuf.Writer} Writer
  457. */
  458. DataMessage.encodeDelimited = function encodeDelimited(message, writer) {
  459. return this.encode(message, writer).ldelim();
  460. };
  461. /**
  462. * Decodes a DataMessage message from the specified reader or buffer.
  463. * @function decode
  464. * @memberof tutorial.Message.DataMessage
  465. * @static
  466. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  467. * @param {number} [length] Message length if known beforehand
  468. * @returns {tutorial.Message.DataMessage} DataMessage
  469. * @throws {Error} If the payload is not a reader or valid buffer
  470. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  471. */
  472. DataMessage.decode = function decode(reader, length) {
  473. if (!(reader instanceof $Reader))
  474. reader = $Reader.create(reader);
  475. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.DataMessage();
  476. while (reader.pos < end) {
  477. var tag = reader.uint32();
  478. switch (tag >>> 3) {
  479. case 1:
  480. message.code = reader.int32();
  481. break;
  482. case 2:
  483. message.result = reader.int32();
  484. break;
  485. case 3:
  486. message.data = reader.string();
  487. break;
  488. case 4:
  489. message.msg = reader.string();
  490. break;
  491. default:
  492. reader.skipType(tag & 7);
  493. break;
  494. }
  495. }
  496. return message;
  497. };
  498. /**
  499. * Decodes a DataMessage message from the specified reader or buffer, length delimited.
  500. * @function decodeDelimited
  501. * @memberof tutorial.Message.DataMessage
  502. * @static
  503. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  504. * @returns {tutorial.Message.DataMessage} DataMessage
  505. * @throws {Error} If the payload is not a reader or valid buffer
  506. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  507. */
  508. DataMessage.decodeDelimited = function decodeDelimited(reader) {
  509. if (!(reader instanceof $Reader))
  510. reader = new $Reader(reader);
  511. return this.decode(reader, reader.uint32());
  512. };
  513. /**
  514. * Verifies a DataMessage message.
  515. * @function verify
  516. * @memberof tutorial.Message.DataMessage
  517. * @static
  518. * @param {Object.<string,*>} message Plain object to verify
  519. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  520. */
  521. DataMessage.verify = function verify(message) {
  522. if (typeof message !== "object" || message === null)
  523. return "object expected";
  524. if (message.code != null && message.hasOwnProperty("code"))
  525. if (!$util.isInteger(message.code))
  526. return "code: integer expected";
  527. if (message.result != null && message.hasOwnProperty("result"))
  528. if (!$util.isInteger(message.result))
  529. return "result: integer expected";
  530. if (message.data != null && message.hasOwnProperty("data"))
  531. if (!$util.isString(message.data))
  532. return "data: string expected";
  533. if (message.msg != null && message.hasOwnProperty("msg"))
  534. if (!$util.isString(message.msg))
  535. return "msg: string expected";
  536. return null;
  537. };
  538. /**
  539. * Creates a DataMessage message from a plain object. Also converts values to their respective internal types.
  540. * @function fromObject
  541. * @memberof tutorial.Message.DataMessage
  542. * @static
  543. * @param {Object.<string,*>} object Plain object
  544. * @returns {tutorial.Message.DataMessage} DataMessage
  545. */
  546. DataMessage.fromObject = function fromObject(object) {
  547. if (object instanceof $root.tutorial.Message.DataMessage)
  548. return object;
  549. var message = new $root.tutorial.Message.DataMessage();
  550. if (object.code != null)
  551. message.code = object.code | 0;
  552. if (object.result != null)
  553. message.result = object.result | 0;
  554. if (object.data != null)
  555. message.data = String(object.data);
  556. if (object.msg != null)
  557. message.msg = String(object.msg);
  558. return message;
  559. };
  560. /**
  561. * Creates a plain object from a DataMessage message. Also converts values to other types if specified.
  562. * @function toObject
  563. * @memberof tutorial.Message.DataMessage
  564. * @static
  565. * @param {tutorial.Message.DataMessage} message DataMessage
  566. * @param {$protobuf.IConversionOptions} [options] Conversion options
  567. * @returns {Object.<string,*>} Plain object
  568. */
  569. DataMessage.toObject = function toObject(message, options) {
  570. if (!options)
  571. options = {};
  572. var object = {};
  573. if (options.defaults) {
  574. object.code = 0;
  575. object.result = 0;
  576. object.data = "";
  577. object.msg = "";
  578. }
  579. if (message.code != null && message.hasOwnProperty("code"))
  580. object.code = message.code;
  581. if (message.result != null && message.hasOwnProperty("result"))
  582. object.result = message.result;
  583. if (message.data != null && message.hasOwnProperty("data"))
  584. object.data = message.data;
  585. if (message.msg != null && message.hasOwnProperty("msg"))
  586. object.msg = message.msg;
  587. return object;
  588. };
  589. /**
  590. * Converts this DataMessage to JSON.
  591. * @function toJSON
  592. * @memberof tutorial.Message.DataMessage
  593. * @instance
  594. * @returns {Object.<string,*>} JSON object
  595. */
  596. DataMessage.prototype.toJSON = function toJSON() {
  597. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  598. };
  599. return DataMessage;
  600. })();
  601. Message.NotificationMessage = (function() {
  602. /**
  603. * Properties of a NotificationMessage.
  604. * @memberof tutorial.Message
  605. * @interface INotificationMessage
  606. * @property {number|null} [nType] NotificationMessage nType
  607. */
  608. /**
  609. * Constructs a new NotificationMessage.
  610. * @memberof tutorial.Message
  611. * @classdesc Represents a NotificationMessage.
  612. * @implements INotificationMessage
  613. * @constructor
  614. * @param {tutorial.Message.INotificationMessage=} [properties] Properties to set
  615. */
  616. function NotificationMessage(properties) {
  617. if (properties)
  618. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  619. if (properties[keys[i]] != null)
  620. this[keys[i]] = properties[keys[i]];
  621. }
  622. /**
  623. * NotificationMessage nType.
  624. * @member {number} nType
  625. * @memberof tutorial.Message.NotificationMessage
  626. * @instance
  627. */
  628. NotificationMessage.prototype.nType = 0;
  629. /**
  630. * Creates a new NotificationMessage instance using the specified properties.
  631. * @function create
  632. * @memberof tutorial.Message.NotificationMessage
  633. * @static
  634. * @param {tutorial.Message.INotificationMessage=} [properties] Properties to set
  635. * @returns {tutorial.Message.NotificationMessage} NotificationMessage instance
  636. */
  637. NotificationMessage.create = function create(properties) {
  638. return new NotificationMessage(properties);
  639. };
  640. /**
  641. * Encodes the specified NotificationMessage message. Does not implicitly {@link tutorial.Message.NotificationMessage.verify|verify} messages.
  642. * @function encode
  643. * @memberof tutorial.Message.NotificationMessage
  644. * @static
  645. * @param {tutorial.Message.INotificationMessage} message NotificationMessage message or plain object to encode
  646. * @param {$protobuf.Writer} [writer] Writer to encode to
  647. * @returns {$protobuf.Writer} Writer
  648. */
  649. NotificationMessage.encode = function encode(message, writer) {
  650. if (!writer)
  651. writer = $Writer.create();
  652. if (message.nType != null && message.hasOwnProperty("nType"))
  653. writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nType);
  654. return writer;
  655. };
  656. /**
  657. * Encodes the specified NotificationMessage message, length delimited. Does not implicitly {@link tutorial.Message.NotificationMessage.verify|verify} messages.
  658. * @function encodeDelimited
  659. * @memberof tutorial.Message.NotificationMessage
  660. * @static
  661. * @param {tutorial.Message.INotificationMessage} message NotificationMessage message or plain object to encode
  662. * @param {$protobuf.Writer} [writer] Writer to encode to
  663. * @returns {$protobuf.Writer} Writer
  664. */
  665. NotificationMessage.encodeDelimited = function encodeDelimited(message, writer) {
  666. return this.encode(message, writer).ldelim();
  667. };
  668. /**
  669. * Decodes a NotificationMessage message from the specified reader or buffer.
  670. * @function decode
  671. * @memberof tutorial.Message.NotificationMessage
  672. * @static
  673. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  674. * @param {number} [length] Message length if known beforehand
  675. * @returns {tutorial.Message.NotificationMessage} NotificationMessage
  676. * @throws {Error} If the payload is not a reader or valid buffer
  677. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  678. */
  679. NotificationMessage.decode = function decode(reader, length) {
  680. if (!(reader instanceof $Reader))
  681. reader = $Reader.create(reader);
  682. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.NotificationMessage();
  683. while (reader.pos < end) {
  684. var tag = reader.uint32();
  685. switch (tag >>> 3) {
  686. case 1:
  687. message.nType = reader.int32();
  688. break;
  689. default:
  690. reader.skipType(tag & 7);
  691. break;
  692. }
  693. }
  694. return message;
  695. };
  696. /**
  697. * Decodes a NotificationMessage message from the specified reader or buffer, length delimited.
  698. * @function decodeDelimited
  699. * @memberof tutorial.Message.NotificationMessage
  700. * @static
  701. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  702. * @returns {tutorial.Message.NotificationMessage} NotificationMessage
  703. * @throws {Error} If the payload is not a reader or valid buffer
  704. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  705. */
  706. NotificationMessage.decodeDelimited = function decodeDelimited(reader) {
  707. if (!(reader instanceof $Reader))
  708. reader = new $Reader(reader);
  709. return this.decode(reader, reader.uint32());
  710. };
  711. /**
  712. * Verifies a NotificationMessage message.
  713. * @function verify
  714. * @memberof tutorial.Message.NotificationMessage
  715. * @static
  716. * @param {Object.<string,*>} message Plain object to verify
  717. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  718. */
  719. NotificationMessage.verify = function verify(message) {
  720. if (typeof message !== "object" || message === null)
  721. return "object expected";
  722. if (message.nType != null && message.hasOwnProperty("nType"))
  723. if (!$util.isInteger(message.nType))
  724. return "nType: integer expected";
  725. return null;
  726. };
  727. /**
  728. * Creates a NotificationMessage message from a plain object. Also converts values to their respective internal types.
  729. * @function fromObject
  730. * @memberof tutorial.Message.NotificationMessage
  731. * @static
  732. * @param {Object.<string,*>} object Plain object
  733. * @returns {tutorial.Message.NotificationMessage} NotificationMessage
  734. */
  735. NotificationMessage.fromObject = function fromObject(object) {
  736. if (object instanceof $root.tutorial.Message.NotificationMessage)
  737. return object;
  738. var message = new $root.tutorial.Message.NotificationMessage();
  739. if (object.nType != null)
  740. message.nType = object.nType | 0;
  741. return message;
  742. };
  743. /**
  744. * Creates a plain object from a NotificationMessage message. Also converts values to other types if specified.
  745. * @function toObject
  746. * @memberof tutorial.Message.NotificationMessage
  747. * @static
  748. * @param {tutorial.Message.NotificationMessage} message NotificationMessage
  749. * @param {$protobuf.IConversionOptions} [options] Conversion options
  750. * @returns {Object.<string,*>} Plain object
  751. */
  752. NotificationMessage.toObject = function toObject(message, options) {
  753. if (!options)
  754. options = {};
  755. var object = {};
  756. if (options.defaults)
  757. object.nType = 0;
  758. if (message.nType != null && message.hasOwnProperty("nType"))
  759. object.nType = message.nType;
  760. return object;
  761. };
  762. /**
  763. * Converts this NotificationMessage to JSON.
  764. * @function toJSON
  765. * @memberof tutorial.Message.NotificationMessage
  766. * @instance
  767. * @returns {Object.<string,*>} JSON object
  768. */
  769. NotificationMessage.prototype.toJSON = function toJSON() {
  770. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  771. };
  772. return NotificationMessage;
  773. })();
  774. Message.RoleOptMessage = (function() {
  775. /**
  776. * Properties of a RoleOptMessage.
  777. * @memberof tutorial.Message
  778. * @interface IRoleOptMessage
  779. * @property {number|Long|null} [targetUid] RoleOptMessage targetUid
  780. * @property {number|Long|null} [exBossUid] RoleOptMessage exBossUid
  781. * @property {number|null} [opt] RoleOptMessage opt
  782. */
  783. /**
  784. * Constructs a new RoleOptMessage.
  785. * @memberof tutorial.Message
  786. * @classdesc Represents a RoleOptMessage.
  787. * @implements IRoleOptMessage
  788. * @constructor
  789. * @param {tutorial.Message.IRoleOptMessage=} [properties] Properties to set
  790. */
  791. function RoleOptMessage(properties) {
  792. if (properties)
  793. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  794. if (properties[keys[i]] != null)
  795. this[keys[i]] = properties[keys[i]];
  796. }
  797. /**
  798. * RoleOptMessage targetUid.
  799. * @member {number|Long} targetUid
  800. * @memberof tutorial.Message.RoleOptMessage
  801. * @instance
  802. */
  803. RoleOptMessage.prototype.targetUid = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  804. /**
  805. * RoleOptMessage exBossUid.
  806. * @member {number|Long} exBossUid
  807. * @memberof tutorial.Message.RoleOptMessage
  808. * @instance
  809. */
  810. RoleOptMessage.prototype.exBossUid = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  811. /**
  812. * RoleOptMessage opt.
  813. * @member {number} opt
  814. * @memberof tutorial.Message.RoleOptMessage
  815. * @instance
  816. */
  817. RoleOptMessage.prototype.opt = 0;
  818. /**
  819. * Creates a new RoleOptMessage instance using the specified properties.
  820. * @function create
  821. * @memberof tutorial.Message.RoleOptMessage
  822. * @static
  823. * @param {tutorial.Message.IRoleOptMessage=} [properties] Properties to set
  824. * @returns {tutorial.Message.RoleOptMessage} RoleOptMessage instance
  825. */
  826. RoleOptMessage.create = function create(properties) {
  827. return new RoleOptMessage(properties);
  828. };
  829. /**
  830. * Encodes the specified RoleOptMessage message. Does not implicitly {@link tutorial.Message.RoleOptMessage.verify|verify} messages.
  831. * @function encode
  832. * @memberof tutorial.Message.RoleOptMessage
  833. * @static
  834. * @param {tutorial.Message.IRoleOptMessage} message RoleOptMessage message or plain object to encode
  835. * @param {$protobuf.Writer} [writer] Writer to encode to
  836. * @returns {$protobuf.Writer} Writer
  837. */
  838. RoleOptMessage.encode = function encode(message, writer) {
  839. if (!writer)
  840. writer = $Writer.create();
  841. if (message.targetUid != null && message.hasOwnProperty("targetUid"))
  842. writer.uint32(/* id 1, wireType 0 =*/8).int64(message.targetUid);
  843. if (message.exBossUid != null && message.hasOwnProperty("exBossUid"))
  844. writer.uint32(/* id 2, wireType 0 =*/16).int64(message.exBossUid);
  845. if (message.opt != null && message.hasOwnProperty("opt"))
  846. writer.uint32(/* id 3, wireType 0 =*/24).int32(message.opt);
  847. return writer;
  848. };
  849. /**
  850. * Encodes the specified RoleOptMessage message, length delimited. Does not implicitly {@link tutorial.Message.RoleOptMessage.verify|verify} messages.
  851. * @function encodeDelimited
  852. * @memberof tutorial.Message.RoleOptMessage
  853. * @static
  854. * @param {tutorial.Message.IRoleOptMessage} message RoleOptMessage message or plain object to encode
  855. * @param {$protobuf.Writer} [writer] Writer to encode to
  856. * @returns {$protobuf.Writer} Writer
  857. */
  858. RoleOptMessage.encodeDelimited = function encodeDelimited(message, writer) {
  859. return this.encode(message, writer).ldelim();
  860. };
  861. /**
  862. * Decodes a RoleOptMessage message from the specified reader or buffer.
  863. * @function decode
  864. * @memberof tutorial.Message.RoleOptMessage
  865. * @static
  866. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  867. * @param {number} [length] Message length if known beforehand
  868. * @returns {tutorial.Message.RoleOptMessage} RoleOptMessage
  869. * @throws {Error} If the payload is not a reader or valid buffer
  870. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  871. */
  872. RoleOptMessage.decode = function decode(reader, length) {
  873. if (!(reader instanceof $Reader))
  874. reader = $Reader.create(reader);
  875. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.RoleOptMessage();
  876. while (reader.pos < end) {
  877. var tag = reader.uint32();
  878. switch (tag >>> 3) {
  879. case 1:
  880. message.targetUid = reader.int64();
  881. break;
  882. case 2:
  883. message.exBossUid = reader.int64();
  884. break;
  885. case 3:
  886. message.opt = reader.int32();
  887. break;
  888. default:
  889. reader.skipType(tag & 7);
  890. break;
  891. }
  892. }
  893. return message;
  894. };
  895. /**
  896. * Decodes a RoleOptMessage message from the specified reader or buffer, length delimited.
  897. * @function decodeDelimited
  898. * @memberof tutorial.Message.RoleOptMessage
  899. * @static
  900. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  901. * @returns {tutorial.Message.RoleOptMessage} RoleOptMessage
  902. * @throws {Error} If the payload is not a reader or valid buffer
  903. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  904. */
  905. RoleOptMessage.decodeDelimited = function decodeDelimited(reader) {
  906. if (!(reader instanceof $Reader))
  907. reader = new $Reader(reader);
  908. return this.decode(reader, reader.uint32());
  909. };
  910. /**
  911. * Verifies a RoleOptMessage message.
  912. * @function verify
  913. * @memberof tutorial.Message.RoleOptMessage
  914. * @static
  915. * @param {Object.<string,*>} message Plain object to verify
  916. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  917. */
  918. RoleOptMessage.verify = function verify(message) {
  919. if (typeof message !== "object" || message === null)
  920. return "object expected";
  921. if (message.targetUid != null && message.hasOwnProperty("targetUid"))
  922. if (!$util.isInteger(message.targetUid) && !(message.targetUid && $util.isInteger(message.targetUid.low) && $util.isInteger(message.targetUid.high)))
  923. return "targetUid: integer|Long expected";
  924. if (message.exBossUid != null && message.hasOwnProperty("exBossUid"))
  925. if (!$util.isInteger(message.exBossUid) && !(message.exBossUid && $util.isInteger(message.exBossUid.low) && $util.isInteger(message.exBossUid.high)))
  926. return "exBossUid: integer|Long expected";
  927. if (message.opt != null && message.hasOwnProperty("opt"))
  928. if (!$util.isInteger(message.opt))
  929. return "opt: integer expected";
  930. return null;
  931. };
  932. /**
  933. * Creates a RoleOptMessage message from a plain object. Also converts values to their respective internal types.
  934. * @function fromObject
  935. * @memberof tutorial.Message.RoleOptMessage
  936. * @static
  937. * @param {Object.<string,*>} object Plain object
  938. * @returns {tutorial.Message.RoleOptMessage} RoleOptMessage
  939. */
  940. RoleOptMessage.fromObject = function fromObject(object) {
  941. if (object instanceof $root.tutorial.Message.RoleOptMessage)
  942. return object;
  943. var message = new $root.tutorial.Message.RoleOptMessage();
  944. if (object.targetUid != null)
  945. if ($util.Long)
  946. (message.targetUid = $util.Long.fromValue(object.targetUid)).unsigned = false;
  947. else if (typeof object.targetUid === "string")
  948. message.targetUid = parseInt(object.targetUid, 10);
  949. else if (typeof object.targetUid === "number")
  950. message.targetUid = object.targetUid;
  951. else if (typeof object.targetUid === "object")
  952. message.targetUid = new $util.LongBits(object.targetUid.low >>> 0, object.targetUid.high >>> 0).toNumber();
  953. if (object.exBossUid != null)
  954. if ($util.Long)
  955. (message.exBossUid = $util.Long.fromValue(object.exBossUid)).unsigned = false;
  956. else if (typeof object.exBossUid === "string")
  957. message.exBossUid = parseInt(object.exBossUid, 10);
  958. else if (typeof object.exBossUid === "number")
  959. message.exBossUid = object.exBossUid;
  960. else if (typeof object.exBossUid === "object")
  961. message.exBossUid = new $util.LongBits(object.exBossUid.low >>> 0, object.exBossUid.high >>> 0).toNumber();
  962. if (object.opt != null)
  963. message.opt = object.opt | 0;
  964. return message;
  965. };
  966. /**
  967. * Creates a plain object from a RoleOptMessage message. Also converts values to other types if specified.
  968. * @function toObject
  969. * @memberof tutorial.Message.RoleOptMessage
  970. * @static
  971. * @param {tutorial.Message.RoleOptMessage} message RoleOptMessage
  972. * @param {$protobuf.IConversionOptions} [options] Conversion options
  973. * @returns {Object.<string,*>} Plain object
  974. */
  975. RoleOptMessage.toObject = function toObject(message, options) {
  976. if (!options)
  977. options = {};
  978. var object = {};
  979. if (options.defaults) {
  980. if ($util.Long) {
  981. var long = new $util.Long(0, 0, false);
  982. object.targetUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  983. } else
  984. object.targetUid = options.longs === String ? "0" : 0;
  985. if ($util.Long) {
  986. var long = new $util.Long(0, 0, false);
  987. object.exBossUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  988. } else
  989. object.exBossUid = options.longs === String ? "0" : 0;
  990. object.opt = 0;
  991. }
  992. if (message.targetUid != null && message.hasOwnProperty("targetUid"))
  993. if (typeof message.targetUid === "number")
  994. object.targetUid = options.longs === String ? String(message.targetUid) : message.targetUid;
  995. else
  996. 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;
  997. if (message.exBossUid != null && message.hasOwnProperty("exBossUid"))
  998. if (typeof message.exBossUid === "number")
  999. object.exBossUid = options.longs === String ? String(message.exBossUid) : message.exBossUid;
  1000. else
  1001. 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;
  1002. if (message.opt != null && message.hasOwnProperty("opt"))
  1003. object.opt = message.opt;
  1004. return object;
  1005. };
  1006. /**
  1007. * Converts this RoleOptMessage to JSON.
  1008. * @function toJSON
  1009. * @memberof tutorial.Message.RoleOptMessage
  1010. * @instance
  1011. * @returns {Object.<string,*>} JSON object
  1012. */
  1013. RoleOptMessage.prototype.toJSON = function toJSON() {
  1014. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  1015. };
  1016. return RoleOptMessage;
  1017. })();
  1018. Message.ReportData = (function() {
  1019. /**
  1020. * Properties of a ReportData.
  1021. * @memberof tutorial.Message
  1022. * @interface IReportData
  1023. * @property {number|null} [seq] * 上报序号,每次重新获取时重置
  1024. * @property {number|Long|null} [t] 时间戳
  1025. * @property {number|null} [cmd] @see com.duowan.allstar.model.enumeration.Cmd
  1026. * @property {number|Long|null} [gi] grossIncome
  1027. * @property {number|Long|null} [s] @see com.duowan.allstar.model.home.UserExtra#stars
  1028. * @property {Array.<tutorial.Message.IBuildingInfo>|null} [b] @see BuildingInfoForm
  1029. * @property {Array.<tutorial.Message.IBuildingInfo>|null} [ub] 未解锁建筑
  1030. */
  1031. /**
  1032. * Constructs a new ReportData.
  1033. * @memberof tutorial.Message
  1034. * @classdesc Represents a ReportData.
  1035. * @implements IReportData
  1036. * @constructor
  1037. * @param {tutorial.Message.IReportData=} [properties] Properties to set
  1038. */
  1039. function ReportData(properties) {
  1040. this.b = [];
  1041. this.ub = [];
  1042. if (properties)
  1043. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  1044. if (properties[keys[i]] != null)
  1045. this[keys[i]] = properties[keys[i]];
  1046. }
  1047. /**
  1048. * * 上报序号,每次重新获取时重置
  1049. * @member {number} seq
  1050. * @memberof tutorial.Message.ReportData
  1051. * @instance
  1052. */
  1053. ReportData.prototype.seq = 0;
  1054. /**
  1055. * 时间戳
  1056. * @member {number|Long} t
  1057. * @memberof tutorial.Message.ReportData
  1058. * @instance
  1059. */
  1060. ReportData.prototype.t = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  1061. /**
  1062. * @see com.duowan.allstar.model.enumeration.Cmd
  1063. * @member {number} cmd
  1064. * @memberof tutorial.Message.ReportData
  1065. * @instance
  1066. */
  1067. ReportData.prototype.cmd = 0;
  1068. /**
  1069. * grossIncome
  1070. * @member {number|Long} gi
  1071. * @memberof tutorial.Message.ReportData
  1072. * @instance
  1073. */
  1074. ReportData.prototype.gi = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  1075. /**
  1076. * @see com.duowan.allstar.model.home.UserExtra#stars
  1077. * @member {number|Long} s
  1078. * @memberof tutorial.Message.ReportData
  1079. * @instance
  1080. */
  1081. ReportData.prototype.s = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  1082. /**
  1083. * @see BuildingInfoForm
  1084. * @member {Array.<tutorial.Message.IBuildingInfo>} b
  1085. * @memberof tutorial.Message.ReportData
  1086. * @instance
  1087. */
  1088. ReportData.prototype.b = $util.emptyArray;
  1089. /**
  1090. * 未解锁建筑
  1091. * @member {Array.<tutorial.Message.IBuildingInfo>} ub
  1092. * @memberof tutorial.Message.ReportData
  1093. * @instance
  1094. */
  1095. ReportData.prototype.ub = $util.emptyArray;
  1096. /**
  1097. * Creates a new ReportData instance using the specified properties.
  1098. * @function create
  1099. * @memberof tutorial.Message.ReportData
  1100. * @static
  1101. * @param {tutorial.Message.IReportData=} [properties] Properties to set
  1102. * @returns {tutorial.Message.ReportData} ReportData instance
  1103. */
  1104. ReportData.create = function create(properties) {
  1105. return new ReportData(properties);
  1106. };
  1107. /**
  1108. * Encodes the specified ReportData message. Does not implicitly {@link tutorial.Message.ReportData.verify|verify} messages.
  1109. * @function encode
  1110. * @memberof tutorial.Message.ReportData
  1111. * @static
  1112. * @param {tutorial.Message.IReportData} message ReportData message or plain object to encode
  1113. * @param {$protobuf.Writer} [writer] Writer to encode to
  1114. * @returns {$protobuf.Writer} Writer
  1115. */
  1116. ReportData.encode = function encode(message, writer) {
  1117. if (!writer)
  1118. writer = $Writer.create();
  1119. if (message.seq != null && message.hasOwnProperty("seq"))
  1120. writer.uint32(/* id 1, wireType 0 =*/8).int32(message.seq);
  1121. if (message.t != null && message.hasOwnProperty("t"))
  1122. writer.uint32(/* id 2, wireType 0 =*/16).int64(message.t);
  1123. if (message.cmd != null && message.hasOwnProperty("cmd"))
  1124. writer.uint32(/* id 3, wireType 0 =*/24).int32(message.cmd);
  1125. if (message.gi != null && message.hasOwnProperty("gi"))
  1126. writer.uint32(/* id 4, wireType 0 =*/32).int64(message.gi);
  1127. if (message.s != null && message.hasOwnProperty("s"))
  1128. writer.uint32(/* id 5, wireType 0 =*/40).int64(message.s);
  1129. if (message.b != null && message.b.length)
  1130. for (var i = 0; i < message.b.length; ++i)
  1131. $root.tutorial.Message.BuildingInfo.encode(message.b[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
  1132. if (message.ub != null && message.ub.length)
  1133. for (var i = 0; i < message.ub.length; ++i)
  1134. $root.tutorial.Message.BuildingInfo.encode(message.ub[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
  1135. return writer;
  1136. };
  1137. /**
  1138. * Encodes the specified ReportData message, length delimited. Does not implicitly {@link tutorial.Message.ReportData.verify|verify} messages.
  1139. * @function encodeDelimited
  1140. * @memberof tutorial.Message.ReportData
  1141. * @static
  1142. * @param {tutorial.Message.IReportData} message ReportData message or plain object to encode
  1143. * @param {$protobuf.Writer} [writer] Writer to encode to
  1144. * @returns {$protobuf.Writer} Writer
  1145. */
  1146. ReportData.encodeDelimited = function encodeDelimited(message, writer) {
  1147. return this.encode(message, writer).ldelim();
  1148. };
  1149. /**
  1150. * Decodes a ReportData message from the specified reader or buffer.
  1151. * @function decode
  1152. * @memberof tutorial.Message.ReportData
  1153. * @static
  1154. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1155. * @param {number} [length] Message length if known beforehand
  1156. * @returns {tutorial.Message.ReportData} ReportData
  1157. * @throws {Error} If the payload is not a reader or valid buffer
  1158. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1159. */
  1160. ReportData.decode = function decode(reader, length) {
  1161. if (!(reader instanceof $Reader))
  1162. reader = $Reader.create(reader);
  1163. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.ReportData();
  1164. while (reader.pos < end) {
  1165. var tag = reader.uint32();
  1166. switch (tag >>> 3) {
  1167. case 1:
  1168. message.seq = reader.int32();
  1169. break;
  1170. case 2:
  1171. message.t = reader.int64();
  1172. break;
  1173. case 3:
  1174. message.cmd = reader.int32();
  1175. break;
  1176. case 4:
  1177. message.gi = reader.int64();
  1178. break;
  1179. case 5:
  1180. message.s = reader.int64();
  1181. break;
  1182. case 6:
  1183. if (!(message.b && message.b.length))
  1184. message.b = [];
  1185. message.b.push($root.tutorial.Message.BuildingInfo.decode(reader, reader.uint32()));
  1186. break;
  1187. case 7:
  1188. if (!(message.ub && message.ub.length))
  1189. message.ub = [];
  1190. message.ub.push($root.tutorial.Message.BuildingInfo.decode(reader, reader.uint32()));
  1191. break;
  1192. default:
  1193. reader.skipType(tag & 7);
  1194. break;
  1195. }
  1196. }
  1197. return message;
  1198. };
  1199. /**
  1200. * Decodes a ReportData message from the specified reader or buffer, length delimited.
  1201. * @function decodeDelimited
  1202. * @memberof tutorial.Message.ReportData
  1203. * @static
  1204. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1205. * @returns {tutorial.Message.ReportData} ReportData
  1206. * @throws {Error} If the payload is not a reader or valid buffer
  1207. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1208. */
  1209. ReportData.decodeDelimited = function decodeDelimited(reader) {
  1210. if (!(reader instanceof $Reader))
  1211. reader = new $Reader(reader);
  1212. return this.decode(reader, reader.uint32());
  1213. };
  1214. /**
  1215. * Verifies a ReportData message.
  1216. * @function verify
  1217. * @memberof tutorial.Message.ReportData
  1218. * @static
  1219. * @param {Object.<string,*>} message Plain object to verify
  1220. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  1221. */
  1222. ReportData.verify = function verify(message) {
  1223. if (typeof message !== "object" || message === null)
  1224. return "object expected";
  1225. if (message.seq != null && message.hasOwnProperty("seq"))
  1226. if (!$util.isInteger(message.seq))
  1227. return "seq: integer expected";
  1228. if (message.t != null && message.hasOwnProperty("t"))
  1229. if (!$util.isInteger(message.t) && !(message.t && $util.isInteger(message.t.low) && $util.isInteger(message.t.high)))
  1230. return "t: integer|Long expected";
  1231. if (message.cmd != null && message.hasOwnProperty("cmd"))
  1232. if (!$util.isInteger(message.cmd))
  1233. return "cmd: integer expected";
  1234. if (message.gi != null && message.hasOwnProperty("gi"))
  1235. if (!$util.isInteger(message.gi) && !(message.gi && $util.isInteger(message.gi.low) && $util.isInteger(message.gi.high)))
  1236. return "gi: integer|Long expected";
  1237. if (message.s != null && message.hasOwnProperty("s"))
  1238. if (!$util.isInteger(message.s) && !(message.s && $util.isInteger(message.s.low) && $util.isInteger(message.s.high)))
  1239. return "s: integer|Long expected";
  1240. if (message.b != null && message.hasOwnProperty("b")) {
  1241. if (!Array.isArray(message.b))
  1242. return "b: array expected";
  1243. for (var i = 0; i < message.b.length; ++i) {
  1244. var error = $root.tutorial.Message.BuildingInfo.verify(message.b[i]);
  1245. if (error)
  1246. return "b." + error;
  1247. }
  1248. }
  1249. if (message.ub != null && message.hasOwnProperty("ub")) {
  1250. if (!Array.isArray(message.ub))
  1251. return "ub: array expected";
  1252. for (var i = 0; i < message.ub.length; ++i) {
  1253. var error = $root.tutorial.Message.BuildingInfo.verify(message.ub[i]);
  1254. if (error)
  1255. return "ub." + error;
  1256. }
  1257. }
  1258. return null;
  1259. };
  1260. /**
  1261. * Creates a ReportData message from a plain object. Also converts values to their respective internal types.
  1262. * @function fromObject
  1263. * @memberof tutorial.Message.ReportData
  1264. * @static
  1265. * @param {Object.<string,*>} object Plain object
  1266. * @returns {tutorial.Message.ReportData} ReportData
  1267. */
  1268. ReportData.fromObject = function fromObject(object) {
  1269. if (object instanceof $root.tutorial.Message.ReportData)
  1270. return object;
  1271. var message = new $root.tutorial.Message.ReportData();
  1272. if (object.seq != null)
  1273. message.seq = object.seq | 0;
  1274. if (object.t != null)
  1275. if ($util.Long)
  1276. (message.t = $util.Long.fromValue(object.t)).unsigned = false;
  1277. else if (typeof object.t === "string")
  1278. message.t = parseInt(object.t, 10);
  1279. else if (typeof object.t === "number")
  1280. message.t = object.t;
  1281. else if (typeof object.t === "object")
  1282. message.t = new $util.LongBits(object.t.low >>> 0, object.t.high >>> 0).toNumber();
  1283. if (object.cmd != null)
  1284. message.cmd = object.cmd | 0;
  1285. if (object.gi != null)
  1286. if ($util.Long)
  1287. (message.gi = $util.Long.fromValue(object.gi)).unsigned = false;
  1288. else if (typeof object.gi === "string")
  1289. message.gi = parseInt(object.gi, 10);
  1290. else if (typeof object.gi === "number")
  1291. message.gi = object.gi;
  1292. else if (typeof object.gi === "object")
  1293. message.gi = new $util.LongBits(object.gi.low >>> 0, object.gi.high >>> 0).toNumber();
  1294. if (object.s != null)
  1295. if ($util.Long)
  1296. (message.s = $util.Long.fromValue(object.s)).unsigned = false;
  1297. else if (typeof object.s === "string")
  1298. message.s = parseInt(object.s, 10);
  1299. else if (typeof object.s === "number")
  1300. message.s = object.s;
  1301. else if (typeof object.s === "object")
  1302. message.s = new $util.LongBits(object.s.low >>> 0, object.s.high >>> 0).toNumber();
  1303. if (object.b) {
  1304. if (!Array.isArray(object.b))
  1305. throw TypeError(".tutorial.Message.ReportData.b: array expected");
  1306. message.b = [];
  1307. for (var i = 0; i < object.b.length; ++i) {
  1308. if (typeof object.b[i] !== "object")
  1309. throw TypeError(".tutorial.Message.ReportData.b: object expected");
  1310. message.b[i] = $root.tutorial.Message.BuildingInfo.fromObject(object.b[i]);
  1311. }
  1312. }
  1313. if (object.ub) {
  1314. if (!Array.isArray(object.ub))
  1315. throw TypeError(".tutorial.Message.ReportData.ub: array expected");
  1316. message.ub = [];
  1317. for (var i = 0; i < object.ub.length; ++i) {
  1318. if (typeof object.ub[i] !== "object")
  1319. throw TypeError(".tutorial.Message.ReportData.ub: object expected");
  1320. message.ub[i] = $root.tutorial.Message.BuildingInfo.fromObject(object.ub[i]);
  1321. }
  1322. }
  1323. return message;
  1324. };
  1325. /**
  1326. * Creates a plain object from a ReportData message. Also converts values to other types if specified.
  1327. * @function toObject
  1328. * @memberof tutorial.Message.ReportData
  1329. * @static
  1330. * @param {tutorial.Message.ReportData} message ReportData
  1331. * @param {$protobuf.IConversionOptions} [options] Conversion options
  1332. * @returns {Object.<string,*>} Plain object
  1333. */
  1334. ReportData.toObject = function toObject(message, options) {
  1335. if (!options)
  1336. options = {};
  1337. var object = {};
  1338. if (options.arrays || options.defaults) {
  1339. object.b = [];
  1340. object.ub = [];
  1341. }
  1342. if (options.defaults) {
  1343. object.seq = 0;
  1344. if ($util.Long) {
  1345. var long = new $util.Long(0, 0, false);
  1346. object.t = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  1347. } else
  1348. object.t = options.longs === String ? "0" : 0;
  1349. object.cmd = 0;
  1350. if ($util.Long) {
  1351. var long = new $util.Long(0, 0, false);
  1352. object.gi = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  1353. } else
  1354. object.gi = options.longs === String ? "0" : 0;
  1355. if ($util.Long) {
  1356. var long = new $util.Long(0, 0, false);
  1357. object.s = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  1358. } else
  1359. object.s = options.longs === String ? "0" : 0;
  1360. }
  1361. if (message.seq != null && message.hasOwnProperty("seq"))
  1362. object.seq = message.seq;
  1363. if (message.t != null && message.hasOwnProperty("t"))
  1364. if (typeof message.t === "number")
  1365. object.t = options.longs === String ? String(message.t) : message.t;
  1366. else
  1367. 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;
  1368. if (message.cmd != null && message.hasOwnProperty("cmd"))
  1369. object.cmd = message.cmd;
  1370. if (message.gi != null && message.hasOwnProperty("gi"))
  1371. if (typeof message.gi === "number")
  1372. object.gi = options.longs === String ? String(message.gi) : message.gi;
  1373. else
  1374. 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;
  1375. if (message.s != null && message.hasOwnProperty("s"))
  1376. if (typeof message.s === "number")
  1377. object.s = options.longs === String ? String(message.s) : message.s;
  1378. else
  1379. 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;
  1380. if (message.b && message.b.length) {
  1381. object.b = [];
  1382. for (var j = 0; j < message.b.length; ++j)
  1383. object.b[j] = $root.tutorial.Message.BuildingInfo.toObject(message.b[j], options);
  1384. }
  1385. if (message.ub && message.ub.length) {
  1386. object.ub = [];
  1387. for (var j = 0; j < message.ub.length; ++j)
  1388. object.ub[j] = $root.tutorial.Message.BuildingInfo.toObject(message.ub[j], options);
  1389. }
  1390. return object;
  1391. };
  1392. /**
  1393. * Converts this ReportData to JSON.
  1394. * @function toJSON
  1395. * @memberof tutorial.Message.ReportData
  1396. * @instance
  1397. * @returns {Object.<string,*>} JSON object
  1398. */
  1399. ReportData.prototype.toJSON = function toJSON() {
  1400. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  1401. };
  1402. return ReportData;
  1403. })();
  1404. Message.BuildingInfo = (function() {
  1405. /**
  1406. * Properties of a BuildingInfo.
  1407. * @memberof tutorial.Message
  1408. * @interface IBuildingInfo
  1409. * @property {number|Long|null} [id] BuildingInfo id
  1410. * @property {number|null} [l] BuildingInfo l
  1411. * @property {number|null} [cc] BuildingInfo cc
  1412. */
  1413. /**
  1414. * Constructs a new BuildingInfo.
  1415. * @memberof tutorial.Message
  1416. * @classdesc Represents a BuildingInfo.
  1417. * @implements IBuildingInfo
  1418. * @constructor
  1419. * @param {tutorial.Message.IBuildingInfo=} [properties] Properties to set
  1420. */
  1421. function BuildingInfo(properties) {
  1422. if (properties)
  1423. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  1424. if (properties[keys[i]] != null)
  1425. this[keys[i]] = properties[keys[i]];
  1426. }
  1427. /**
  1428. * BuildingInfo id.
  1429. * @member {number|Long} id
  1430. * @memberof tutorial.Message.BuildingInfo
  1431. * @instance
  1432. */
  1433. BuildingInfo.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  1434. /**
  1435. * BuildingInfo l.
  1436. * @member {number} l
  1437. * @memberof tutorial.Message.BuildingInfo
  1438. * @instance
  1439. */
  1440. BuildingInfo.prototype.l = 0;
  1441. /**
  1442. * BuildingInfo cc.
  1443. * @member {number} cc
  1444. * @memberof tutorial.Message.BuildingInfo
  1445. * @instance
  1446. */
  1447. BuildingInfo.prototype.cc = 0;
  1448. /**
  1449. * Creates a new BuildingInfo instance using the specified properties.
  1450. * @function create
  1451. * @memberof tutorial.Message.BuildingInfo
  1452. * @static
  1453. * @param {tutorial.Message.IBuildingInfo=} [properties] Properties to set
  1454. * @returns {tutorial.Message.BuildingInfo} BuildingInfo instance
  1455. */
  1456. BuildingInfo.create = function create(properties) {
  1457. return new BuildingInfo(properties);
  1458. };
  1459. /**
  1460. * Encodes the specified BuildingInfo message. Does not implicitly {@link tutorial.Message.BuildingInfo.verify|verify} messages.
  1461. * @function encode
  1462. * @memberof tutorial.Message.BuildingInfo
  1463. * @static
  1464. * @param {tutorial.Message.IBuildingInfo} message BuildingInfo message or plain object to encode
  1465. * @param {$protobuf.Writer} [writer] Writer to encode to
  1466. * @returns {$protobuf.Writer} Writer
  1467. */
  1468. BuildingInfo.encode = function encode(message, writer) {
  1469. if (!writer)
  1470. writer = $Writer.create();
  1471. if (message.id != null && message.hasOwnProperty("id"))
  1472. writer.uint32(/* id 1, wireType 0 =*/8).int64(message.id);
  1473. if (message.l != null && message.hasOwnProperty("l"))
  1474. writer.uint32(/* id 2, wireType 0 =*/16).int32(message.l);
  1475. if (message.cc != null && message.hasOwnProperty("cc"))
  1476. writer.uint32(/* id 3, wireType 0 =*/24).int32(message.cc);
  1477. return writer;
  1478. };
  1479. /**
  1480. * Encodes the specified BuildingInfo message, length delimited. Does not implicitly {@link tutorial.Message.BuildingInfo.verify|verify} messages.
  1481. * @function encodeDelimited
  1482. * @memberof tutorial.Message.BuildingInfo
  1483. * @static
  1484. * @param {tutorial.Message.IBuildingInfo} message BuildingInfo message or plain object to encode
  1485. * @param {$protobuf.Writer} [writer] Writer to encode to
  1486. * @returns {$protobuf.Writer} Writer
  1487. */
  1488. BuildingInfo.encodeDelimited = function encodeDelimited(message, writer) {
  1489. return this.encode(message, writer).ldelim();
  1490. };
  1491. /**
  1492. * Decodes a BuildingInfo message from the specified reader or buffer.
  1493. * @function decode
  1494. * @memberof tutorial.Message.BuildingInfo
  1495. * @static
  1496. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1497. * @param {number} [length] Message length if known beforehand
  1498. * @returns {tutorial.Message.BuildingInfo} BuildingInfo
  1499. * @throws {Error} If the payload is not a reader or valid buffer
  1500. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1501. */
  1502. BuildingInfo.decode = function decode(reader, length) {
  1503. if (!(reader instanceof $Reader))
  1504. reader = $Reader.create(reader);
  1505. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tutorial.Message.BuildingInfo();
  1506. while (reader.pos < end) {
  1507. var tag = reader.uint32();
  1508. switch (tag >>> 3) {
  1509. case 1:
  1510. message.id = reader.int64();
  1511. break;
  1512. case 2:
  1513. message.l = reader.int32();
  1514. break;
  1515. case 3:
  1516. message.cc = reader.int32();
  1517. break;
  1518. default:
  1519. reader.skipType(tag & 7);
  1520. break;
  1521. }
  1522. }
  1523. return message;
  1524. };
  1525. /**
  1526. * Decodes a BuildingInfo message from the specified reader or buffer, length delimited.
  1527. * @function decodeDelimited
  1528. * @memberof tutorial.Message.BuildingInfo
  1529. * @static
  1530. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  1531. * @returns {tutorial.Message.BuildingInfo} BuildingInfo
  1532. * @throws {Error} If the payload is not a reader or valid buffer
  1533. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1534. */
  1535. BuildingInfo.decodeDelimited = function decodeDelimited(reader) {
  1536. if (!(reader instanceof $Reader))
  1537. reader = new $Reader(reader);
  1538. return this.decode(reader, reader.uint32());
  1539. };
  1540. /**
  1541. * Verifies a BuildingInfo message.
  1542. * @function verify
  1543. * @memberof tutorial.Message.BuildingInfo
  1544. * @static
  1545. * @param {Object.<string,*>} message Plain object to verify
  1546. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  1547. */
  1548. BuildingInfo.verify = function verify(message) {
  1549. if (typeof message !== "object" || message === null)
  1550. return "object expected";
  1551. if (message.id != null && message.hasOwnProperty("id"))
  1552. if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
  1553. return "id: integer|Long expected";
  1554. if (message.l != null && message.hasOwnProperty("l"))
  1555. if (!$util.isInteger(message.l))
  1556. return "l: integer expected";
  1557. if (message.cc != null && message.hasOwnProperty("cc"))
  1558. if (!$util.isInteger(message.cc))
  1559. return "cc: integer expected";
  1560. return null;
  1561. };
  1562. /**
  1563. * Creates a BuildingInfo message from a plain object. Also converts values to their respective internal types.
  1564. * @function fromObject
  1565. * @memberof tutorial.Message.BuildingInfo
  1566. * @static
  1567. * @param {Object.<string,*>} object Plain object
  1568. * @returns {tutorial.Message.BuildingInfo} BuildingInfo
  1569. */
  1570. BuildingInfo.fromObject = function fromObject(object) {
  1571. if (object instanceof $root.tutorial.Message.BuildingInfo)
  1572. return object;
  1573. var message = new $root.tutorial.Message.BuildingInfo();
  1574. if (object.id != null)
  1575. if ($util.Long)
  1576. (message.id = $util.Long.fromValue(object.id)).unsigned = false;
  1577. else if (typeof object.id === "string")
  1578. message.id = parseInt(object.id, 10);
  1579. else if (typeof object.id === "number")
  1580. message.id = object.id;
  1581. else if (typeof object.id === "object")
  1582. message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber();
  1583. if (object.l != null)
  1584. message.l = object.l | 0;
  1585. if (object.cc != null)
  1586. message.cc = object.cc | 0;
  1587. return message;
  1588. };
  1589. /**
  1590. * Creates a plain object from a BuildingInfo message. Also converts values to other types if specified.
  1591. * @function toObject
  1592. * @memberof tutorial.Message.BuildingInfo
  1593. * @static
  1594. * @param {tutorial.Message.BuildingInfo} message BuildingInfo
  1595. * @param {$protobuf.IConversionOptions} [options] Conversion options
  1596. * @returns {Object.<string,*>} Plain object
  1597. */
  1598. BuildingInfo.toObject = function toObject(message, options) {
  1599. if (!options)
  1600. options = {};
  1601. var object = {};
  1602. if (options.defaults) {
  1603. if ($util.Long) {
  1604. var long = new $util.Long(0, 0, false);
  1605. object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  1606. } else
  1607. object.id = options.longs === String ? "0" : 0;
  1608. object.l = 0;
  1609. object.cc = 0;
  1610. }
  1611. if (message.id != null && message.hasOwnProperty("id"))
  1612. if (typeof message.id === "number")
  1613. object.id = options.longs === String ? String(message.id) : message.id;
  1614. else
  1615. 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;
  1616. if (message.l != null && message.hasOwnProperty("l"))
  1617. object.l = message.l;
  1618. if (message.cc != null && message.hasOwnProperty("cc"))
  1619. object.cc = message.cc;
  1620. return object;
  1621. };
  1622. /**
  1623. * Converts this BuildingInfo to JSON.
  1624. * @function toJSON
  1625. * @memberof tutorial.Message.BuildingInfo
  1626. * @instance
  1627. * @returns {Object.<string,*>} JSON object
  1628. */
  1629. BuildingInfo.prototype.toJSON = function toJSON() {
  1630. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  1631. };
  1632. return BuildingInfo;
  1633. })();
  1634. return Message;
  1635. })();
  1636. return tutorial;
  1637. })();
  1638. return $root;
  1639. });