protobuf-platform 1.2.241 → 1.2.243

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.2.241",
3
+ "version": "1.2.243",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,7 +23,9 @@ service Tournament {
23
23
  rpc getTournamentsForUser(PaginationRequest) returns (UserTournamentItemsResponse);
24
24
  rpc getSingleTournamentForUser(UserTournamentRequest) returns (UserTournamentItem);
25
25
  rpc getActiveUserTournaments(ActiveUserTournamentsRequest) returns (UserTournamentItemsResponse);
26
+ rpc getTournamentLeaderboard(GetTournamentLeaderboardRequest) returns (TournamentLeaderboardResponse);
26
27
  rpc attachUserToTournament(UserTournamentRequest) returns (TournamentStatusResponse);
28
+ rpc resolveAutoTournamentForGameSession(ResolveAutoTournamentForGameSessionRequest) returns (ResolveAutoTournamentForGameSessionResponse);
27
29
  }
28
30
  //Technical
29
31
  message PingRequest { string ping = 1; }
@@ -219,3 +221,31 @@ message ActiveUserTournamentsRequest {
219
221
  optional string currency = 3;
220
222
  optional string locale = 4;
221
223
  }
224
+
225
+ //Leaderboard
226
+ message GetTournamentLeaderboardRequest {
227
+ int32 tournament_id = 1;
228
+ optional int32 user_id = 2;
229
+ }
230
+
231
+ message TournamentLeaderboardUserItem {
232
+ int32 user_id = 1;
233
+ int32 rank = 2;
234
+ double score = 3;
235
+ optional string nickname = 4;
236
+ }
237
+
238
+ message TournamentLeaderboardResponse {
239
+ repeated TournamentLeaderboardUserItem top20 = 1;
240
+ optional TournamentLeaderboardUserItem my_position = 2;
241
+ }
242
+
243
+ message ResolveAutoTournamentForGameSessionRequest {
244
+ uint64 user_id = 1;
245
+ repeated uint64 tournament_ids = 2; // candidate tournaments for the game
246
+ }
247
+
248
+ message ResolveAutoTournamentForGameSessionResponse {
249
+ uint64 tournament_id = 1; // resolved tournamentId, or 0 when not eligible / ambiguous
250
+ bool is_eligible = 2; // true iff tournament_id > 0
251
+ }
@@ -37,6 +37,17 @@ function deserialize_tournament_GetFileRequest(buffer_arg) {
37
37
  return tournament_pb.GetFileRequest.deserializeBinary(new Uint8Array(buffer_arg));
38
38
  }
39
39
 
40
+ function serialize_tournament_GetTournamentLeaderboardRequest(arg) {
41
+ if (!(arg instanceof tournament_pb.GetTournamentLeaderboardRequest)) {
42
+ throw new Error('Expected argument of type tournament.GetTournamentLeaderboardRequest');
43
+ }
44
+ return Buffer.from(arg.serializeBinary());
45
+ }
46
+
47
+ function deserialize_tournament_GetTournamentLeaderboardRequest(buffer_arg) {
48
+ return tournament_pb.GetTournamentLeaderboardRequest.deserializeBinary(new Uint8Array(buffer_arg));
49
+ }
50
+
40
51
  function serialize_tournament_GetTournamentRequest(arg) {
41
52
  if (!(arg instanceof tournament_pb.GetTournamentRequest)) {
42
53
  throw new Error('Expected argument of type tournament.GetTournamentRequest');
@@ -92,6 +103,28 @@ function deserialize_tournament_PongResponse(buffer_arg) {
92
103
  return tournament_pb.PongResponse.deserializeBinary(new Uint8Array(buffer_arg));
93
104
  }
94
105
 
106
+ function serialize_tournament_ResolveAutoTournamentForGameSessionRequest(arg) {
107
+ if (!(arg instanceof tournament_pb.ResolveAutoTournamentForGameSessionRequest)) {
108
+ throw new Error('Expected argument of type tournament.ResolveAutoTournamentForGameSessionRequest');
109
+ }
110
+ return Buffer.from(arg.serializeBinary());
111
+ }
112
+
113
+ function deserialize_tournament_ResolveAutoTournamentForGameSessionRequest(buffer_arg) {
114
+ return tournament_pb.ResolveAutoTournamentForGameSessionRequest.deserializeBinary(new Uint8Array(buffer_arg));
115
+ }
116
+
117
+ function serialize_tournament_ResolveAutoTournamentForGameSessionResponse(arg) {
118
+ if (!(arg instanceof tournament_pb.ResolveAutoTournamentForGameSessionResponse)) {
119
+ throw new Error('Expected argument of type tournament.ResolveAutoTournamentForGameSessionResponse');
120
+ }
121
+ return Buffer.from(arg.serializeBinary());
122
+ }
123
+
124
+ function deserialize_tournament_ResolveAutoTournamentForGameSessionResponse(buffer_arg) {
125
+ return tournament_pb.ResolveAutoTournamentForGameSessionResponse.deserializeBinary(new Uint8Array(buffer_arg));
126
+ }
127
+
95
128
  function serialize_tournament_TournamentActivationRuleRequest(arg) {
96
129
  if (!(arg instanceof tournament_pb.TournamentActivationRuleRequest)) {
97
130
  throw new Error('Expected argument of type tournament.TournamentActivationRuleRequest');
@@ -136,6 +169,17 @@ function deserialize_tournament_TournamentItemsResponse(buffer_arg) {
136
169
  return tournament_pb.TournamentItemsResponse.deserializeBinary(new Uint8Array(buffer_arg));
137
170
  }
138
171
 
172
+ function serialize_tournament_TournamentLeaderboardResponse(arg) {
173
+ if (!(arg instanceof tournament_pb.TournamentLeaderboardResponse)) {
174
+ throw new Error('Expected argument of type tournament.TournamentLeaderboardResponse');
175
+ }
176
+ return Buffer.from(arg.serializeBinary());
177
+ }
178
+
179
+ function deserialize_tournament_TournamentLeaderboardResponse(buffer_arg) {
180
+ return tournament_pb.TournamentLeaderboardResponse.deserializeBinary(new Uint8Array(buffer_arg));
181
+ }
182
+
139
183
  function serialize_tournament_TournamentRequest(arg) {
140
184
  if (!(arg instanceof tournament_pb.TournamentRequest)) {
141
185
  throw new Error('Expected argument of type tournament.TournamentRequest');
@@ -437,6 +481,17 @@ readListTournamentStatuses: {
437
481
  responseSerialize: serialize_tournament_UserTournamentItemsResponse,
438
482
  responseDeserialize: deserialize_tournament_UserTournamentItemsResponse,
439
483
  },
484
+ getTournamentLeaderboard: {
485
+ path: '/tournament.Tournament/getTournamentLeaderboard',
486
+ requestStream: false,
487
+ responseStream: false,
488
+ requestType: tournament_pb.GetTournamentLeaderboardRequest,
489
+ responseType: tournament_pb.TournamentLeaderboardResponse,
490
+ requestSerialize: serialize_tournament_GetTournamentLeaderboardRequest,
491
+ requestDeserialize: deserialize_tournament_GetTournamentLeaderboardRequest,
492
+ responseSerialize: serialize_tournament_TournamentLeaderboardResponse,
493
+ responseDeserialize: deserialize_tournament_TournamentLeaderboardResponse,
494
+ },
440
495
  attachUserToTournament: {
441
496
  path: '/tournament.Tournament/attachUserToTournament',
442
497
  requestStream: false,
@@ -448,6 +503,17 @@ readListTournamentStatuses: {
448
503
  responseSerialize: serialize_tournament_TournamentStatusResponse,
449
504
  responseDeserialize: deserialize_tournament_TournamentStatusResponse,
450
505
  },
506
+ resolveAutoTournamentForGameSession: {
507
+ path: '/tournament.Tournament/resolveAutoTournamentForGameSession',
508
+ requestStream: false,
509
+ responseStream: false,
510
+ requestType: tournament_pb.ResolveAutoTournamentForGameSessionRequest,
511
+ responseType: tournament_pb.ResolveAutoTournamentForGameSessionResponse,
512
+ requestSerialize: serialize_tournament_ResolveAutoTournamentForGameSessionRequest,
513
+ requestDeserialize: deserialize_tournament_ResolveAutoTournamentForGameSessionRequest,
514
+ responseSerialize: serialize_tournament_ResolveAutoTournamentForGameSessionResponse,
515
+ responseDeserialize: deserialize_tournament_ResolveAutoTournamentForGameSessionResponse,
516
+ },
451
517
  };
452
518
 
453
519
  exports.TournamentClient = grpc.makeGenericClientConstructor(TournamentService, 'Tournament');
@@ -26,11 +26,14 @@ goog.exportSymbol('proto.tournament.ActiveUserTournamentsRequest', null, global)
26
26
  goog.exportSymbol('proto.tournament.ContentItem', null, global);
27
27
  goog.exportSymbol('proto.tournament.File', null, global);
28
28
  goog.exportSymbol('proto.tournament.GetFileRequest', null, global);
29
+ goog.exportSymbol('proto.tournament.GetTournamentLeaderboardRequest', null, global);
29
30
  goog.exportSymbol('proto.tournament.GetTournamentRequest', null, global);
30
31
  goog.exportSymbol('proto.tournament.ItemsBunchRequest', null, global);
31
32
  goog.exportSymbol('proto.tournament.PaginationRequest', null, global);
32
33
  goog.exportSymbol('proto.tournament.PingRequest', null, global);
33
34
  goog.exportSymbol('proto.tournament.PongResponse', null, global);
35
+ goog.exportSymbol('proto.tournament.ResolveAutoTournamentForGameSessionRequest', null, global);
36
+ goog.exportSymbol('proto.tournament.ResolveAutoTournamentForGameSessionResponse', null, global);
34
37
  goog.exportSymbol('proto.tournament.RewardItem', null, global);
35
38
  goog.exportSymbol('proto.tournament.ScoringRule', null, global);
36
39
  goog.exportSymbol('proto.tournament.SearchRequest', null, global);
@@ -40,6 +43,8 @@ goog.exportSymbol('proto.tournament.TournamentGamesRequest', null, global);
40
43
  goog.exportSymbol('proto.tournament.TournamentItem', null, global);
41
44
  goog.exportSymbol('proto.tournament.TournamentItemRequest', null, global);
42
45
  goog.exportSymbol('proto.tournament.TournamentItemsResponse', null, global);
46
+ goog.exportSymbol('proto.tournament.TournamentLeaderboardResponse', null, global);
47
+ goog.exportSymbol('proto.tournament.TournamentLeaderboardUserItem', null, global);
43
48
  goog.exportSymbol('proto.tournament.TournamentRequest', null, global);
44
49
  goog.exportSymbol('proto.tournament.TournamentRequest.RequestCase', null, global);
45
50
  goog.exportSymbol('proto.tournament.TournamentResponse', null, global);
@@ -682,6 +687,111 @@ if (goog.DEBUG && !COMPILED) {
682
687
  */
683
688
  proto.tournament.ActiveUserTournamentsRequest.displayName = 'proto.tournament.ActiveUserTournamentsRequest';
684
689
  }
690
+ /**
691
+ * Generated by JsPbCodeGenerator.
692
+ * @param {Array=} opt_data Optional initial data array, typically from a
693
+ * server response, or constructed directly in Javascript. The array is used
694
+ * in place and becomes part of the constructed object. It is not cloned.
695
+ * If no data is provided, the constructed object will be empty, but still
696
+ * valid.
697
+ * @extends {jspb.Message}
698
+ * @constructor
699
+ */
700
+ proto.tournament.GetTournamentLeaderboardRequest = function(opt_data) {
701
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
702
+ };
703
+ goog.inherits(proto.tournament.GetTournamentLeaderboardRequest, jspb.Message);
704
+ if (goog.DEBUG && !COMPILED) {
705
+ /**
706
+ * @public
707
+ * @override
708
+ */
709
+ proto.tournament.GetTournamentLeaderboardRequest.displayName = 'proto.tournament.GetTournamentLeaderboardRequest';
710
+ }
711
+ /**
712
+ * Generated by JsPbCodeGenerator.
713
+ * @param {Array=} opt_data Optional initial data array, typically from a
714
+ * server response, or constructed directly in Javascript. The array is used
715
+ * in place and becomes part of the constructed object. It is not cloned.
716
+ * If no data is provided, the constructed object will be empty, but still
717
+ * valid.
718
+ * @extends {jspb.Message}
719
+ * @constructor
720
+ */
721
+ proto.tournament.TournamentLeaderboardUserItem = function(opt_data) {
722
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
723
+ };
724
+ goog.inherits(proto.tournament.TournamentLeaderboardUserItem, jspb.Message);
725
+ if (goog.DEBUG && !COMPILED) {
726
+ /**
727
+ * @public
728
+ * @override
729
+ */
730
+ proto.tournament.TournamentLeaderboardUserItem.displayName = 'proto.tournament.TournamentLeaderboardUserItem';
731
+ }
732
+ /**
733
+ * Generated by JsPbCodeGenerator.
734
+ * @param {Array=} opt_data Optional initial data array, typically from a
735
+ * server response, or constructed directly in Javascript. The array is used
736
+ * in place and becomes part of the constructed object. It is not cloned.
737
+ * If no data is provided, the constructed object will be empty, but still
738
+ * valid.
739
+ * @extends {jspb.Message}
740
+ * @constructor
741
+ */
742
+ proto.tournament.TournamentLeaderboardResponse = function(opt_data) {
743
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.tournament.TournamentLeaderboardResponse.repeatedFields_, null);
744
+ };
745
+ goog.inherits(proto.tournament.TournamentLeaderboardResponse, jspb.Message);
746
+ if (goog.DEBUG && !COMPILED) {
747
+ /**
748
+ * @public
749
+ * @override
750
+ */
751
+ proto.tournament.TournamentLeaderboardResponse.displayName = 'proto.tournament.TournamentLeaderboardResponse';
752
+ }
753
+ /**
754
+ * Generated by JsPbCodeGenerator.
755
+ * @param {Array=} opt_data Optional initial data array, typically from a
756
+ * server response, or constructed directly in Javascript. The array is used
757
+ * in place and becomes part of the constructed object. It is not cloned.
758
+ * If no data is provided, the constructed object will be empty, but still
759
+ * valid.
760
+ * @extends {jspb.Message}
761
+ * @constructor
762
+ */
763
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest = function(opt_data) {
764
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.tournament.ResolveAutoTournamentForGameSessionRequest.repeatedFields_, null);
765
+ };
766
+ goog.inherits(proto.tournament.ResolveAutoTournamentForGameSessionRequest, jspb.Message);
767
+ if (goog.DEBUG && !COMPILED) {
768
+ /**
769
+ * @public
770
+ * @override
771
+ */
772
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.displayName = 'proto.tournament.ResolveAutoTournamentForGameSessionRequest';
773
+ }
774
+ /**
775
+ * Generated by JsPbCodeGenerator.
776
+ * @param {Array=} opt_data Optional initial data array, typically from a
777
+ * server response, or constructed directly in Javascript. The array is used
778
+ * in place and becomes part of the constructed object. It is not cloned.
779
+ * If no data is provided, the constructed object will be empty, but still
780
+ * valid.
781
+ * @extends {jspb.Message}
782
+ * @constructor
783
+ */
784
+ proto.tournament.ResolveAutoTournamentForGameSessionResponse = function(opt_data) {
785
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
786
+ };
787
+ goog.inherits(proto.tournament.ResolveAutoTournamentForGameSessionResponse, jspb.Message);
788
+ if (goog.DEBUG && !COMPILED) {
789
+ /**
790
+ * @public
791
+ * @override
792
+ */
793
+ proto.tournament.ResolveAutoTournamentForGameSessionResponse.displayName = 'proto.tournament.ResolveAutoTournamentForGameSessionResponse';
794
+ }
685
795
 
686
796
 
687
797
 
@@ -10168,4 +10278,979 @@ proto.tournament.ActiveUserTournamentsRequest.prototype.hasLocale = function() {
10168
10278
  };
10169
10279
 
10170
10280
 
10281
+
10282
+
10283
+
10284
+ if (jspb.Message.GENERATE_TO_OBJECT) {
10285
+ /**
10286
+ * Creates an object representation of this proto.
10287
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
10288
+ * Optional fields that are not set will be set to undefined.
10289
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
10290
+ * For the list of reserved names please see:
10291
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
10292
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
10293
+ * JSPB instance for transitional soy proto support:
10294
+ * http://goto/soy-param-migration
10295
+ * @return {!Object}
10296
+ */
10297
+ proto.tournament.GetTournamentLeaderboardRequest.prototype.toObject = function(opt_includeInstance) {
10298
+ return proto.tournament.GetTournamentLeaderboardRequest.toObject(opt_includeInstance, this);
10299
+ };
10300
+
10301
+
10302
+ /**
10303
+ * Static version of the {@see toObject} method.
10304
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
10305
+ * the JSPB instance for transitional soy proto support:
10306
+ * http://goto/soy-param-migration
10307
+ * @param {!proto.tournament.GetTournamentLeaderboardRequest} msg The msg instance to transform.
10308
+ * @return {!Object}
10309
+ * @suppress {unusedLocalVariables} f is only used for nested messages
10310
+ */
10311
+ proto.tournament.GetTournamentLeaderboardRequest.toObject = function(includeInstance, msg) {
10312
+ var f, obj = {
10313
+ tournamentId: jspb.Message.getFieldWithDefault(msg, 1, 0),
10314
+ userId: jspb.Message.getFieldWithDefault(msg, 2, 0)
10315
+ };
10316
+
10317
+ if (includeInstance) {
10318
+ obj.$jspbMessageInstance = msg;
10319
+ }
10320
+ return obj;
10321
+ };
10322
+ }
10323
+
10324
+
10325
+ /**
10326
+ * Deserializes binary data (in protobuf wire format).
10327
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
10328
+ * @return {!proto.tournament.GetTournamentLeaderboardRequest}
10329
+ */
10330
+ proto.tournament.GetTournamentLeaderboardRequest.deserializeBinary = function(bytes) {
10331
+ var reader = new jspb.BinaryReader(bytes);
10332
+ var msg = new proto.tournament.GetTournamentLeaderboardRequest;
10333
+ return proto.tournament.GetTournamentLeaderboardRequest.deserializeBinaryFromReader(msg, reader);
10334
+ };
10335
+
10336
+
10337
+ /**
10338
+ * Deserializes binary data (in protobuf wire format) from the
10339
+ * given reader into the given message object.
10340
+ * @param {!proto.tournament.GetTournamentLeaderboardRequest} msg The message object to deserialize into.
10341
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
10342
+ * @return {!proto.tournament.GetTournamentLeaderboardRequest}
10343
+ */
10344
+ proto.tournament.GetTournamentLeaderboardRequest.deserializeBinaryFromReader = function(msg, reader) {
10345
+ while (reader.nextField()) {
10346
+ if (reader.isEndGroup()) {
10347
+ break;
10348
+ }
10349
+ var field = reader.getFieldNumber();
10350
+ switch (field) {
10351
+ case 1:
10352
+ var value = /** @type {number} */ (reader.readInt32());
10353
+ msg.setTournamentId(value);
10354
+ break;
10355
+ case 2:
10356
+ var value = /** @type {number} */ (reader.readInt32());
10357
+ msg.setUserId(value);
10358
+ break;
10359
+ default:
10360
+ reader.skipField();
10361
+ break;
10362
+ }
10363
+ }
10364
+ return msg;
10365
+ };
10366
+
10367
+
10368
+ /**
10369
+ * Serializes the message to binary data (in protobuf wire format).
10370
+ * @return {!Uint8Array}
10371
+ */
10372
+ proto.tournament.GetTournamentLeaderboardRequest.prototype.serializeBinary = function() {
10373
+ var writer = new jspb.BinaryWriter();
10374
+ proto.tournament.GetTournamentLeaderboardRequest.serializeBinaryToWriter(this, writer);
10375
+ return writer.getResultBuffer();
10376
+ };
10377
+
10378
+
10379
+ /**
10380
+ * Serializes the given message to binary data (in protobuf wire
10381
+ * format), writing to the given BinaryWriter.
10382
+ * @param {!proto.tournament.GetTournamentLeaderboardRequest} message
10383
+ * @param {!jspb.BinaryWriter} writer
10384
+ * @suppress {unusedLocalVariables} f is only used for nested messages
10385
+ */
10386
+ proto.tournament.GetTournamentLeaderboardRequest.serializeBinaryToWriter = function(message, writer) {
10387
+ var f = undefined;
10388
+ f = message.getTournamentId();
10389
+ if (f !== 0) {
10390
+ writer.writeInt32(
10391
+ 1,
10392
+ f
10393
+ );
10394
+ }
10395
+ f = /** @type {number} */ (jspb.Message.getField(message, 2));
10396
+ if (f != null) {
10397
+ writer.writeInt32(
10398
+ 2,
10399
+ f
10400
+ );
10401
+ }
10402
+ };
10403
+
10404
+
10405
+ /**
10406
+ * optional int32 tournament_id = 1;
10407
+ * @return {number}
10408
+ */
10409
+ proto.tournament.GetTournamentLeaderboardRequest.prototype.getTournamentId = function() {
10410
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
10411
+ };
10412
+
10413
+
10414
+ /**
10415
+ * @param {number} value
10416
+ * @return {!proto.tournament.GetTournamentLeaderboardRequest} returns this
10417
+ */
10418
+ proto.tournament.GetTournamentLeaderboardRequest.prototype.setTournamentId = function(value) {
10419
+ return jspb.Message.setProto3IntField(this, 1, value);
10420
+ };
10421
+
10422
+
10423
+ /**
10424
+ * optional int32 user_id = 2;
10425
+ * @return {number}
10426
+ */
10427
+ proto.tournament.GetTournamentLeaderboardRequest.prototype.getUserId = function() {
10428
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
10429
+ };
10430
+
10431
+
10432
+ /**
10433
+ * @param {number} value
10434
+ * @return {!proto.tournament.GetTournamentLeaderboardRequest} returns this
10435
+ */
10436
+ proto.tournament.GetTournamentLeaderboardRequest.prototype.setUserId = function(value) {
10437
+ return jspb.Message.setField(this, 2, value);
10438
+ };
10439
+
10440
+
10441
+ /**
10442
+ * Clears the field making it undefined.
10443
+ * @return {!proto.tournament.GetTournamentLeaderboardRequest} returns this
10444
+ */
10445
+ proto.tournament.GetTournamentLeaderboardRequest.prototype.clearUserId = function() {
10446
+ return jspb.Message.setField(this, 2, undefined);
10447
+ };
10448
+
10449
+
10450
+ /**
10451
+ * Returns whether this field is set.
10452
+ * @return {boolean}
10453
+ */
10454
+ proto.tournament.GetTournamentLeaderboardRequest.prototype.hasUserId = function() {
10455
+ return jspb.Message.getField(this, 2) != null;
10456
+ };
10457
+
10458
+
10459
+
10460
+
10461
+
10462
+ if (jspb.Message.GENERATE_TO_OBJECT) {
10463
+ /**
10464
+ * Creates an object representation of this proto.
10465
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
10466
+ * Optional fields that are not set will be set to undefined.
10467
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
10468
+ * For the list of reserved names please see:
10469
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
10470
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
10471
+ * JSPB instance for transitional soy proto support:
10472
+ * http://goto/soy-param-migration
10473
+ * @return {!Object}
10474
+ */
10475
+ proto.tournament.TournamentLeaderboardUserItem.prototype.toObject = function(opt_includeInstance) {
10476
+ return proto.tournament.TournamentLeaderboardUserItem.toObject(opt_includeInstance, this);
10477
+ };
10478
+
10479
+
10480
+ /**
10481
+ * Static version of the {@see toObject} method.
10482
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
10483
+ * the JSPB instance for transitional soy proto support:
10484
+ * http://goto/soy-param-migration
10485
+ * @param {!proto.tournament.TournamentLeaderboardUserItem} msg The msg instance to transform.
10486
+ * @return {!Object}
10487
+ * @suppress {unusedLocalVariables} f is only used for nested messages
10488
+ */
10489
+ proto.tournament.TournamentLeaderboardUserItem.toObject = function(includeInstance, msg) {
10490
+ var f, obj = {
10491
+ userId: jspb.Message.getFieldWithDefault(msg, 1, 0),
10492
+ rank: jspb.Message.getFieldWithDefault(msg, 2, 0),
10493
+ score: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0),
10494
+ nickname: jspb.Message.getFieldWithDefault(msg, 4, "")
10495
+ };
10496
+
10497
+ if (includeInstance) {
10498
+ obj.$jspbMessageInstance = msg;
10499
+ }
10500
+ return obj;
10501
+ };
10502
+ }
10503
+
10504
+
10505
+ /**
10506
+ * Deserializes binary data (in protobuf wire format).
10507
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
10508
+ * @return {!proto.tournament.TournamentLeaderboardUserItem}
10509
+ */
10510
+ proto.tournament.TournamentLeaderboardUserItem.deserializeBinary = function(bytes) {
10511
+ var reader = new jspb.BinaryReader(bytes);
10512
+ var msg = new proto.tournament.TournamentLeaderboardUserItem;
10513
+ return proto.tournament.TournamentLeaderboardUserItem.deserializeBinaryFromReader(msg, reader);
10514
+ };
10515
+
10516
+
10517
+ /**
10518
+ * Deserializes binary data (in protobuf wire format) from the
10519
+ * given reader into the given message object.
10520
+ * @param {!proto.tournament.TournamentLeaderboardUserItem} msg The message object to deserialize into.
10521
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
10522
+ * @return {!proto.tournament.TournamentLeaderboardUserItem}
10523
+ */
10524
+ proto.tournament.TournamentLeaderboardUserItem.deserializeBinaryFromReader = function(msg, reader) {
10525
+ while (reader.nextField()) {
10526
+ if (reader.isEndGroup()) {
10527
+ break;
10528
+ }
10529
+ var field = reader.getFieldNumber();
10530
+ switch (field) {
10531
+ case 1:
10532
+ var value = /** @type {number} */ (reader.readInt32());
10533
+ msg.setUserId(value);
10534
+ break;
10535
+ case 2:
10536
+ var value = /** @type {number} */ (reader.readInt32());
10537
+ msg.setRank(value);
10538
+ break;
10539
+ case 3:
10540
+ var value = /** @type {number} */ (reader.readDouble());
10541
+ msg.setScore(value);
10542
+ break;
10543
+ case 4:
10544
+ var value = /** @type {string} */ (reader.readString());
10545
+ msg.setNickname(value);
10546
+ break;
10547
+ default:
10548
+ reader.skipField();
10549
+ break;
10550
+ }
10551
+ }
10552
+ return msg;
10553
+ };
10554
+
10555
+
10556
+ /**
10557
+ * Serializes the message to binary data (in protobuf wire format).
10558
+ * @return {!Uint8Array}
10559
+ */
10560
+ proto.tournament.TournamentLeaderboardUserItem.prototype.serializeBinary = function() {
10561
+ var writer = new jspb.BinaryWriter();
10562
+ proto.tournament.TournamentLeaderboardUserItem.serializeBinaryToWriter(this, writer);
10563
+ return writer.getResultBuffer();
10564
+ };
10565
+
10566
+
10567
+ /**
10568
+ * Serializes the given message to binary data (in protobuf wire
10569
+ * format), writing to the given BinaryWriter.
10570
+ * @param {!proto.tournament.TournamentLeaderboardUserItem} message
10571
+ * @param {!jspb.BinaryWriter} writer
10572
+ * @suppress {unusedLocalVariables} f is only used for nested messages
10573
+ */
10574
+ proto.tournament.TournamentLeaderboardUserItem.serializeBinaryToWriter = function(message, writer) {
10575
+ var f = undefined;
10576
+ f = message.getUserId();
10577
+ if (f !== 0) {
10578
+ writer.writeInt32(
10579
+ 1,
10580
+ f
10581
+ );
10582
+ }
10583
+ f = message.getRank();
10584
+ if (f !== 0) {
10585
+ writer.writeInt32(
10586
+ 2,
10587
+ f
10588
+ );
10589
+ }
10590
+ f = message.getScore();
10591
+ if (f !== 0.0) {
10592
+ writer.writeDouble(
10593
+ 3,
10594
+ f
10595
+ );
10596
+ }
10597
+ f = /** @type {string} */ (jspb.Message.getField(message, 4));
10598
+ if (f != null) {
10599
+ writer.writeString(
10600
+ 4,
10601
+ f
10602
+ );
10603
+ }
10604
+ };
10605
+
10606
+
10607
+ /**
10608
+ * optional int32 user_id = 1;
10609
+ * @return {number}
10610
+ */
10611
+ proto.tournament.TournamentLeaderboardUserItem.prototype.getUserId = function() {
10612
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
10613
+ };
10614
+
10615
+
10616
+ /**
10617
+ * @param {number} value
10618
+ * @return {!proto.tournament.TournamentLeaderboardUserItem} returns this
10619
+ */
10620
+ proto.tournament.TournamentLeaderboardUserItem.prototype.setUserId = function(value) {
10621
+ return jspb.Message.setProto3IntField(this, 1, value);
10622
+ };
10623
+
10624
+
10625
+ /**
10626
+ * optional int32 rank = 2;
10627
+ * @return {number}
10628
+ */
10629
+ proto.tournament.TournamentLeaderboardUserItem.prototype.getRank = function() {
10630
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
10631
+ };
10632
+
10633
+
10634
+ /**
10635
+ * @param {number} value
10636
+ * @return {!proto.tournament.TournamentLeaderboardUserItem} returns this
10637
+ */
10638
+ proto.tournament.TournamentLeaderboardUserItem.prototype.setRank = function(value) {
10639
+ return jspb.Message.setProto3IntField(this, 2, value);
10640
+ };
10641
+
10642
+
10643
+ /**
10644
+ * optional double score = 3;
10645
+ * @return {number}
10646
+ */
10647
+ proto.tournament.TournamentLeaderboardUserItem.prototype.getScore = function() {
10648
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0));
10649
+ };
10650
+
10651
+
10652
+ /**
10653
+ * @param {number} value
10654
+ * @return {!proto.tournament.TournamentLeaderboardUserItem} returns this
10655
+ */
10656
+ proto.tournament.TournamentLeaderboardUserItem.prototype.setScore = function(value) {
10657
+ return jspb.Message.setProto3FloatField(this, 3, value);
10658
+ };
10659
+
10660
+
10661
+ /**
10662
+ * optional string nickname = 4;
10663
+ * @return {string}
10664
+ */
10665
+ proto.tournament.TournamentLeaderboardUserItem.prototype.getNickname = function() {
10666
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
10667
+ };
10668
+
10669
+
10670
+ /**
10671
+ * @param {string} value
10672
+ * @return {!proto.tournament.TournamentLeaderboardUserItem} returns this
10673
+ */
10674
+ proto.tournament.TournamentLeaderboardUserItem.prototype.setNickname = function(value) {
10675
+ return jspb.Message.setField(this, 4, value);
10676
+ };
10677
+
10678
+
10679
+ /**
10680
+ * Clears the field making it undefined.
10681
+ * @return {!proto.tournament.TournamentLeaderboardUserItem} returns this
10682
+ */
10683
+ proto.tournament.TournamentLeaderboardUserItem.prototype.clearNickname = function() {
10684
+ return jspb.Message.setField(this, 4, undefined);
10685
+ };
10686
+
10687
+
10688
+ /**
10689
+ * Returns whether this field is set.
10690
+ * @return {boolean}
10691
+ */
10692
+ proto.tournament.TournamentLeaderboardUserItem.prototype.hasNickname = function() {
10693
+ return jspb.Message.getField(this, 4) != null;
10694
+ };
10695
+
10696
+
10697
+
10698
+ /**
10699
+ * List of repeated fields within this message type.
10700
+ * @private {!Array<number>}
10701
+ * @const
10702
+ */
10703
+ proto.tournament.TournamentLeaderboardResponse.repeatedFields_ = [1];
10704
+
10705
+
10706
+
10707
+ if (jspb.Message.GENERATE_TO_OBJECT) {
10708
+ /**
10709
+ * Creates an object representation of this proto.
10710
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
10711
+ * Optional fields that are not set will be set to undefined.
10712
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
10713
+ * For the list of reserved names please see:
10714
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
10715
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
10716
+ * JSPB instance for transitional soy proto support:
10717
+ * http://goto/soy-param-migration
10718
+ * @return {!Object}
10719
+ */
10720
+ proto.tournament.TournamentLeaderboardResponse.prototype.toObject = function(opt_includeInstance) {
10721
+ return proto.tournament.TournamentLeaderboardResponse.toObject(opt_includeInstance, this);
10722
+ };
10723
+
10724
+
10725
+ /**
10726
+ * Static version of the {@see toObject} method.
10727
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
10728
+ * the JSPB instance for transitional soy proto support:
10729
+ * http://goto/soy-param-migration
10730
+ * @param {!proto.tournament.TournamentLeaderboardResponse} msg The msg instance to transform.
10731
+ * @return {!Object}
10732
+ * @suppress {unusedLocalVariables} f is only used for nested messages
10733
+ */
10734
+ proto.tournament.TournamentLeaderboardResponse.toObject = function(includeInstance, msg) {
10735
+ var f, obj = {
10736
+ top20List: jspb.Message.toObjectList(msg.getTop20List(),
10737
+ proto.tournament.TournamentLeaderboardUserItem.toObject, includeInstance),
10738
+ myPosition: (f = msg.getMyPosition()) && proto.tournament.TournamentLeaderboardUserItem.toObject(includeInstance, f)
10739
+ };
10740
+
10741
+ if (includeInstance) {
10742
+ obj.$jspbMessageInstance = msg;
10743
+ }
10744
+ return obj;
10745
+ };
10746
+ }
10747
+
10748
+
10749
+ /**
10750
+ * Deserializes binary data (in protobuf wire format).
10751
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
10752
+ * @return {!proto.tournament.TournamentLeaderboardResponse}
10753
+ */
10754
+ proto.tournament.TournamentLeaderboardResponse.deserializeBinary = function(bytes) {
10755
+ var reader = new jspb.BinaryReader(bytes);
10756
+ var msg = new proto.tournament.TournamentLeaderboardResponse;
10757
+ return proto.tournament.TournamentLeaderboardResponse.deserializeBinaryFromReader(msg, reader);
10758
+ };
10759
+
10760
+
10761
+ /**
10762
+ * Deserializes binary data (in protobuf wire format) from the
10763
+ * given reader into the given message object.
10764
+ * @param {!proto.tournament.TournamentLeaderboardResponse} msg The message object to deserialize into.
10765
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
10766
+ * @return {!proto.tournament.TournamentLeaderboardResponse}
10767
+ */
10768
+ proto.tournament.TournamentLeaderboardResponse.deserializeBinaryFromReader = function(msg, reader) {
10769
+ while (reader.nextField()) {
10770
+ if (reader.isEndGroup()) {
10771
+ break;
10772
+ }
10773
+ var field = reader.getFieldNumber();
10774
+ switch (field) {
10775
+ case 1:
10776
+ var value = new proto.tournament.TournamentLeaderboardUserItem;
10777
+ reader.readMessage(value,proto.tournament.TournamentLeaderboardUserItem.deserializeBinaryFromReader);
10778
+ msg.addTop20(value);
10779
+ break;
10780
+ case 2:
10781
+ var value = new proto.tournament.TournamentLeaderboardUserItem;
10782
+ reader.readMessage(value,proto.tournament.TournamentLeaderboardUserItem.deserializeBinaryFromReader);
10783
+ msg.setMyPosition(value);
10784
+ break;
10785
+ default:
10786
+ reader.skipField();
10787
+ break;
10788
+ }
10789
+ }
10790
+ return msg;
10791
+ };
10792
+
10793
+
10794
+ /**
10795
+ * Serializes the message to binary data (in protobuf wire format).
10796
+ * @return {!Uint8Array}
10797
+ */
10798
+ proto.tournament.TournamentLeaderboardResponse.prototype.serializeBinary = function() {
10799
+ var writer = new jspb.BinaryWriter();
10800
+ proto.tournament.TournamentLeaderboardResponse.serializeBinaryToWriter(this, writer);
10801
+ return writer.getResultBuffer();
10802
+ };
10803
+
10804
+
10805
+ /**
10806
+ * Serializes the given message to binary data (in protobuf wire
10807
+ * format), writing to the given BinaryWriter.
10808
+ * @param {!proto.tournament.TournamentLeaderboardResponse} message
10809
+ * @param {!jspb.BinaryWriter} writer
10810
+ * @suppress {unusedLocalVariables} f is only used for nested messages
10811
+ */
10812
+ proto.tournament.TournamentLeaderboardResponse.serializeBinaryToWriter = function(message, writer) {
10813
+ var f = undefined;
10814
+ f = message.getTop20List();
10815
+ if (f.length > 0) {
10816
+ writer.writeRepeatedMessage(
10817
+ 1,
10818
+ f,
10819
+ proto.tournament.TournamentLeaderboardUserItem.serializeBinaryToWriter
10820
+ );
10821
+ }
10822
+ f = message.getMyPosition();
10823
+ if (f != null) {
10824
+ writer.writeMessage(
10825
+ 2,
10826
+ f,
10827
+ proto.tournament.TournamentLeaderboardUserItem.serializeBinaryToWriter
10828
+ );
10829
+ }
10830
+ };
10831
+
10832
+
10833
+ /**
10834
+ * repeated TournamentLeaderboardUserItem top20 = 1;
10835
+ * @return {!Array<!proto.tournament.TournamentLeaderboardUserItem>}
10836
+ */
10837
+ proto.tournament.TournamentLeaderboardResponse.prototype.getTop20List = function() {
10838
+ return /** @type{!Array<!proto.tournament.TournamentLeaderboardUserItem>} */ (
10839
+ jspb.Message.getRepeatedWrapperField(this, proto.tournament.TournamentLeaderboardUserItem, 1));
10840
+ };
10841
+
10842
+
10843
+ /**
10844
+ * @param {!Array<!proto.tournament.TournamentLeaderboardUserItem>} value
10845
+ * @return {!proto.tournament.TournamentLeaderboardResponse} returns this
10846
+ */
10847
+ proto.tournament.TournamentLeaderboardResponse.prototype.setTop20List = function(value) {
10848
+ return jspb.Message.setRepeatedWrapperField(this, 1, value);
10849
+ };
10850
+
10851
+
10852
+ /**
10853
+ * @param {!proto.tournament.TournamentLeaderboardUserItem=} opt_value
10854
+ * @param {number=} opt_index
10855
+ * @return {!proto.tournament.TournamentLeaderboardUserItem}
10856
+ */
10857
+ proto.tournament.TournamentLeaderboardResponse.prototype.addTop20 = function(opt_value, opt_index) {
10858
+ return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.tournament.TournamentLeaderboardUserItem, opt_index);
10859
+ };
10860
+
10861
+
10862
+ /**
10863
+ * Clears the list making it empty but non-null.
10864
+ * @return {!proto.tournament.TournamentLeaderboardResponse} returns this
10865
+ */
10866
+ proto.tournament.TournamentLeaderboardResponse.prototype.clearTop20List = function() {
10867
+ return this.setTop20List([]);
10868
+ };
10869
+
10870
+
10871
+ /**
10872
+ * optional TournamentLeaderboardUserItem my_position = 2;
10873
+ * @return {?proto.tournament.TournamentLeaderboardUserItem}
10874
+ */
10875
+ proto.tournament.TournamentLeaderboardResponse.prototype.getMyPosition = function() {
10876
+ return /** @type{?proto.tournament.TournamentLeaderboardUserItem} */ (
10877
+ jspb.Message.getWrapperField(this, proto.tournament.TournamentLeaderboardUserItem, 2));
10878
+ };
10879
+
10880
+
10881
+ /**
10882
+ * @param {?proto.tournament.TournamentLeaderboardUserItem|undefined} value
10883
+ * @return {!proto.tournament.TournamentLeaderboardResponse} returns this
10884
+ */
10885
+ proto.tournament.TournamentLeaderboardResponse.prototype.setMyPosition = function(value) {
10886
+ return jspb.Message.setWrapperField(this, 2, value);
10887
+ };
10888
+
10889
+
10890
+ /**
10891
+ * Clears the message field making it undefined.
10892
+ * @return {!proto.tournament.TournamentLeaderboardResponse} returns this
10893
+ */
10894
+ proto.tournament.TournamentLeaderboardResponse.prototype.clearMyPosition = function() {
10895
+ return this.setMyPosition(undefined);
10896
+ };
10897
+
10898
+
10899
+ /**
10900
+ * Returns whether this field is set.
10901
+ * @return {boolean}
10902
+ */
10903
+ proto.tournament.TournamentLeaderboardResponse.prototype.hasMyPosition = function() {
10904
+ return jspb.Message.getField(this, 2) != null;
10905
+ };
10906
+
10907
+
10908
+
10909
+ /**
10910
+ * List of repeated fields within this message type.
10911
+ * @private {!Array<number>}
10912
+ * @const
10913
+ */
10914
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.repeatedFields_ = [2];
10915
+
10916
+
10917
+
10918
+ if (jspb.Message.GENERATE_TO_OBJECT) {
10919
+ /**
10920
+ * Creates an object representation of this proto.
10921
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
10922
+ * Optional fields that are not set will be set to undefined.
10923
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
10924
+ * For the list of reserved names please see:
10925
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
10926
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
10927
+ * JSPB instance for transitional soy proto support:
10928
+ * http://goto/soy-param-migration
10929
+ * @return {!Object}
10930
+ */
10931
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.prototype.toObject = function(opt_includeInstance) {
10932
+ return proto.tournament.ResolveAutoTournamentForGameSessionRequest.toObject(opt_includeInstance, this);
10933
+ };
10934
+
10935
+
10936
+ /**
10937
+ * Static version of the {@see toObject} method.
10938
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
10939
+ * the JSPB instance for transitional soy proto support:
10940
+ * http://goto/soy-param-migration
10941
+ * @param {!proto.tournament.ResolveAutoTournamentForGameSessionRequest} msg The msg instance to transform.
10942
+ * @return {!Object}
10943
+ * @suppress {unusedLocalVariables} f is only used for nested messages
10944
+ */
10945
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.toObject = function(includeInstance, msg) {
10946
+ var f, obj = {
10947
+ userId: jspb.Message.getFieldWithDefault(msg, 1, 0),
10948
+ tournamentIdsList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f
10949
+ };
10950
+
10951
+ if (includeInstance) {
10952
+ obj.$jspbMessageInstance = msg;
10953
+ }
10954
+ return obj;
10955
+ };
10956
+ }
10957
+
10958
+
10959
+ /**
10960
+ * Deserializes binary data (in protobuf wire format).
10961
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
10962
+ * @return {!proto.tournament.ResolveAutoTournamentForGameSessionRequest}
10963
+ */
10964
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.deserializeBinary = function(bytes) {
10965
+ var reader = new jspb.BinaryReader(bytes);
10966
+ var msg = new proto.tournament.ResolveAutoTournamentForGameSessionRequest;
10967
+ return proto.tournament.ResolveAutoTournamentForGameSessionRequest.deserializeBinaryFromReader(msg, reader);
10968
+ };
10969
+
10970
+
10971
+ /**
10972
+ * Deserializes binary data (in protobuf wire format) from the
10973
+ * given reader into the given message object.
10974
+ * @param {!proto.tournament.ResolveAutoTournamentForGameSessionRequest} msg The message object to deserialize into.
10975
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
10976
+ * @return {!proto.tournament.ResolveAutoTournamentForGameSessionRequest}
10977
+ */
10978
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.deserializeBinaryFromReader = function(msg, reader) {
10979
+ while (reader.nextField()) {
10980
+ if (reader.isEndGroup()) {
10981
+ break;
10982
+ }
10983
+ var field = reader.getFieldNumber();
10984
+ switch (field) {
10985
+ case 1:
10986
+ var value = /** @type {number} */ (reader.readUint64());
10987
+ msg.setUserId(value);
10988
+ break;
10989
+ case 2:
10990
+ var values = /** @type {!Array<number>} */ (reader.isDelimited() ? reader.readPackedUint64() : [reader.readUint64()]);
10991
+ for (var i = 0; i < values.length; i++) {
10992
+ msg.addTournamentIds(values[i]);
10993
+ }
10994
+ break;
10995
+ default:
10996
+ reader.skipField();
10997
+ break;
10998
+ }
10999
+ }
11000
+ return msg;
11001
+ };
11002
+
11003
+
11004
+ /**
11005
+ * Serializes the message to binary data (in protobuf wire format).
11006
+ * @return {!Uint8Array}
11007
+ */
11008
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.prototype.serializeBinary = function() {
11009
+ var writer = new jspb.BinaryWriter();
11010
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.serializeBinaryToWriter(this, writer);
11011
+ return writer.getResultBuffer();
11012
+ };
11013
+
11014
+
11015
+ /**
11016
+ * Serializes the given message to binary data (in protobuf wire
11017
+ * format), writing to the given BinaryWriter.
11018
+ * @param {!proto.tournament.ResolveAutoTournamentForGameSessionRequest} message
11019
+ * @param {!jspb.BinaryWriter} writer
11020
+ * @suppress {unusedLocalVariables} f is only used for nested messages
11021
+ */
11022
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.serializeBinaryToWriter = function(message, writer) {
11023
+ var f = undefined;
11024
+ f = message.getUserId();
11025
+ if (f !== 0) {
11026
+ writer.writeUint64(
11027
+ 1,
11028
+ f
11029
+ );
11030
+ }
11031
+ f = message.getTournamentIdsList();
11032
+ if (f.length > 0) {
11033
+ writer.writePackedUint64(
11034
+ 2,
11035
+ f
11036
+ );
11037
+ }
11038
+ };
11039
+
11040
+
11041
+ /**
11042
+ * optional uint64 user_id = 1;
11043
+ * @return {number}
11044
+ */
11045
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.prototype.getUserId = function() {
11046
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
11047
+ };
11048
+
11049
+
11050
+ /**
11051
+ * @param {number} value
11052
+ * @return {!proto.tournament.ResolveAutoTournamentForGameSessionRequest} returns this
11053
+ */
11054
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.prototype.setUserId = function(value) {
11055
+ return jspb.Message.setProto3IntField(this, 1, value);
11056
+ };
11057
+
11058
+
11059
+ /**
11060
+ * repeated uint64 tournament_ids = 2;
11061
+ * @return {!Array<number>}
11062
+ */
11063
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.prototype.getTournamentIdsList = function() {
11064
+ return /** @type {!Array<number>} */ (jspb.Message.getRepeatedField(this, 2));
11065
+ };
11066
+
11067
+
11068
+ /**
11069
+ * @param {!Array<number>} value
11070
+ * @return {!proto.tournament.ResolveAutoTournamentForGameSessionRequest} returns this
11071
+ */
11072
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.prototype.setTournamentIdsList = function(value) {
11073
+ return jspb.Message.setField(this, 2, value || []);
11074
+ };
11075
+
11076
+
11077
+ /**
11078
+ * @param {number} value
11079
+ * @param {number=} opt_index
11080
+ * @return {!proto.tournament.ResolveAutoTournamentForGameSessionRequest} returns this
11081
+ */
11082
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.prototype.addTournamentIds = function(value, opt_index) {
11083
+ return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
11084
+ };
11085
+
11086
+
11087
+ /**
11088
+ * Clears the list making it empty but non-null.
11089
+ * @return {!proto.tournament.ResolveAutoTournamentForGameSessionRequest} returns this
11090
+ */
11091
+ proto.tournament.ResolveAutoTournamentForGameSessionRequest.prototype.clearTournamentIdsList = function() {
11092
+ return this.setTournamentIdsList([]);
11093
+ };
11094
+
11095
+
11096
+
11097
+
11098
+
11099
+ if (jspb.Message.GENERATE_TO_OBJECT) {
11100
+ /**
11101
+ * Creates an object representation of this proto.
11102
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
11103
+ * Optional fields that are not set will be set to undefined.
11104
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
11105
+ * For the list of reserved names please see:
11106
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
11107
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
11108
+ * JSPB instance for transitional soy proto support:
11109
+ * http://goto/soy-param-migration
11110
+ * @return {!Object}
11111
+ */
11112
+ proto.tournament.ResolveAutoTournamentForGameSessionResponse.prototype.toObject = function(opt_includeInstance) {
11113
+ return proto.tournament.ResolveAutoTournamentForGameSessionResponse.toObject(opt_includeInstance, this);
11114
+ };
11115
+
11116
+
11117
+ /**
11118
+ * Static version of the {@see toObject} method.
11119
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
11120
+ * the JSPB instance for transitional soy proto support:
11121
+ * http://goto/soy-param-migration
11122
+ * @param {!proto.tournament.ResolveAutoTournamentForGameSessionResponse} msg The msg instance to transform.
11123
+ * @return {!Object}
11124
+ * @suppress {unusedLocalVariables} f is only used for nested messages
11125
+ */
11126
+ proto.tournament.ResolveAutoTournamentForGameSessionResponse.toObject = function(includeInstance, msg) {
11127
+ var f, obj = {
11128
+ tournamentId: jspb.Message.getFieldWithDefault(msg, 1, 0),
11129
+ isEligible: jspb.Message.getBooleanFieldWithDefault(msg, 2, false)
11130
+ };
11131
+
11132
+ if (includeInstance) {
11133
+ obj.$jspbMessageInstance = msg;
11134
+ }
11135
+ return obj;
11136
+ };
11137
+ }
11138
+
11139
+
11140
+ /**
11141
+ * Deserializes binary data (in protobuf wire format).
11142
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
11143
+ * @return {!proto.tournament.ResolveAutoTournamentForGameSessionResponse}
11144
+ */
11145
+ proto.tournament.ResolveAutoTournamentForGameSessionResponse.deserializeBinary = function(bytes) {
11146
+ var reader = new jspb.BinaryReader(bytes);
11147
+ var msg = new proto.tournament.ResolveAutoTournamentForGameSessionResponse;
11148
+ return proto.tournament.ResolveAutoTournamentForGameSessionResponse.deserializeBinaryFromReader(msg, reader);
11149
+ };
11150
+
11151
+
11152
+ /**
11153
+ * Deserializes binary data (in protobuf wire format) from the
11154
+ * given reader into the given message object.
11155
+ * @param {!proto.tournament.ResolveAutoTournamentForGameSessionResponse} msg The message object to deserialize into.
11156
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
11157
+ * @return {!proto.tournament.ResolveAutoTournamentForGameSessionResponse}
11158
+ */
11159
+ proto.tournament.ResolveAutoTournamentForGameSessionResponse.deserializeBinaryFromReader = function(msg, reader) {
11160
+ while (reader.nextField()) {
11161
+ if (reader.isEndGroup()) {
11162
+ break;
11163
+ }
11164
+ var field = reader.getFieldNumber();
11165
+ switch (field) {
11166
+ case 1:
11167
+ var value = /** @type {number} */ (reader.readUint64());
11168
+ msg.setTournamentId(value);
11169
+ break;
11170
+ case 2:
11171
+ var value = /** @type {boolean} */ (reader.readBool());
11172
+ msg.setIsEligible(value);
11173
+ break;
11174
+ default:
11175
+ reader.skipField();
11176
+ break;
11177
+ }
11178
+ }
11179
+ return msg;
11180
+ };
11181
+
11182
+
11183
+ /**
11184
+ * Serializes the message to binary data (in protobuf wire format).
11185
+ * @return {!Uint8Array}
11186
+ */
11187
+ proto.tournament.ResolveAutoTournamentForGameSessionResponse.prototype.serializeBinary = function() {
11188
+ var writer = new jspb.BinaryWriter();
11189
+ proto.tournament.ResolveAutoTournamentForGameSessionResponse.serializeBinaryToWriter(this, writer);
11190
+ return writer.getResultBuffer();
11191
+ };
11192
+
11193
+
11194
+ /**
11195
+ * Serializes the given message to binary data (in protobuf wire
11196
+ * format), writing to the given BinaryWriter.
11197
+ * @param {!proto.tournament.ResolveAutoTournamentForGameSessionResponse} message
11198
+ * @param {!jspb.BinaryWriter} writer
11199
+ * @suppress {unusedLocalVariables} f is only used for nested messages
11200
+ */
11201
+ proto.tournament.ResolveAutoTournamentForGameSessionResponse.serializeBinaryToWriter = function(message, writer) {
11202
+ var f = undefined;
11203
+ f = message.getTournamentId();
11204
+ if (f !== 0) {
11205
+ writer.writeUint64(
11206
+ 1,
11207
+ f
11208
+ );
11209
+ }
11210
+ f = message.getIsEligible();
11211
+ if (f) {
11212
+ writer.writeBool(
11213
+ 2,
11214
+ f
11215
+ );
11216
+ }
11217
+ };
11218
+
11219
+
11220
+ /**
11221
+ * optional uint64 tournament_id = 1;
11222
+ * @return {number}
11223
+ */
11224
+ proto.tournament.ResolveAutoTournamentForGameSessionResponse.prototype.getTournamentId = function() {
11225
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
11226
+ };
11227
+
11228
+
11229
+ /**
11230
+ * @param {number} value
11231
+ * @return {!proto.tournament.ResolveAutoTournamentForGameSessionResponse} returns this
11232
+ */
11233
+ proto.tournament.ResolveAutoTournamentForGameSessionResponse.prototype.setTournamentId = function(value) {
11234
+ return jspb.Message.setProto3IntField(this, 1, value);
11235
+ };
11236
+
11237
+
11238
+ /**
11239
+ * optional bool is_eligible = 2;
11240
+ * @return {boolean}
11241
+ */
11242
+ proto.tournament.ResolveAutoTournamentForGameSessionResponse.prototype.getIsEligible = function() {
11243
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
11244
+ };
11245
+
11246
+
11247
+ /**
11248
+ * @param {boolean} value
11249
+ * @return {!proto.tournament.ResolveAutoTournamentForGameSessionResponse} returns this
11250
+ */
11251
+ proto.tournament.ResolveAutoTournamentForGameSessionResponse.prototype.setIsEligible = function(value) {
11252
+ return jspb.Message.setProto3BooleanField(this, 2, value);
11253
+ };
11254
+
11255
+
10171
11256
  goog.object.extend(exports, proto.tournament);