-
Notifications
You must be signed in to change notification settings - Fork 10
/
hiro.proto
2408 lines (2198 loc) · 84.9 KB
/
hiro.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2023 Heroic Labs & Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
// The request and response objects for Hiro.
package hiro;
import "google/protobuf/descriptor.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
option go_package = "github.com/heroiclabs/hiro";
extend google.protobuf.EnumValueOptions {
// The input proto message to the Nakama RPC.
optional string input = 1000;
// The output proto message of the Nakama RPC.
optional string output = 1001;
}
enum RpcId {
RPC_ID_UNSPECIFIED = 0;
// List all inventory items defined in the codex.
RPC_ID_INVENTORY_LIST = 1 [(input) = "InventoryListRequest", (output) = "InventoryList"];
// List all inventory items owned by the player.
RPC_ID_INVENTORY_LIST_INVENTORY = 2 [(input) = "InventoryListRequest", (output) = "InventoryList"];
// Consume one or more inventory items owned by the player.
RPC_ID_INVENTORY_CONSUME = 3 [(input) = "InventoryConsumeRequest", (output) = "InventoryConsumeRewards"];
// Grant one or more inventory items to the player.
RPC_ID_INVENTORY_GRANT = 4 [(input) = "InventoryGrantRequest", (output) = "InventoryUpdateAck"];
// Update the properties on one or more inventory items owned by the player.
RPC_ID_INVENTORY_UPDATE = 5 [(input) = "InventoryUpdateItemsRequest", (output) = "InventoryUpdateAck"];
// Claim one or more rewards which are partially or full donated by other players.
RPC_ID_ECONOMY_DONATION_CLAIM = 6 [(input) = "EconomyDonationClaimRequest", (output) = "EconomyDonationClaimRewards"];
// Donate some resource (currencies, items, etc.) to a user by donation ID.
RPC_ID_ECONOMY_DONATION_GIVE = 7 [(input) = "EconomyDonationGiveRequest", (output) = "EconomyUpdateAck"];
// Get progress on one or more donations for a set of players by their IDs.
RPC_ID_ECONOMY_DONATION_GET = 8 [(input) = "EconomyDonationGetRequest", (output) = "EconomyDonationsByUserList"];
// Request a donation which other players can contribute into.
RPC_ID_ECONOMY_DONATION_REQUEST = 9 [(input) = "EconomyDonationRequest", (output) = "EconomyDonationAck"];
// Get all store items defined in the Virtual Store.
RPC_ID_ECONOMY_STORE_GET = 10 [(input) = "EconomyListRequest", (output) = "EconomyList"];
// Grant one or more currencies or reward modifiers to te player.
RPC_ID_ECONOMY_GRANT = 11 [(input) = "EconomyGrantRequest", (output) = "EconomyUpdateAck"];
// Send a marker of intent to purchase by the player.
RPC_ID_ECONOMY_PURCHASE_INTENT = 12 [(input) = "EconomyPurchaseIntentRequest", (output) = ""];
// Purchase a store item by the player.
RPC_ID_ECONOMY_PURCHASE_ITEM = 13 [(input) = "EconomyPurchaseRequest", (output) = "EconomyPurchaseAck"];
// Restore a set of purchases.
RPC_ID_ECONOMY_PURCHASE_RESTORE = 59 [(input) = "EconomyPurchaseRestoreRequest", (output) = ""];
// Get the current status on an Ad placement which may have been rewarded.
RPC_ID_ECONOMY_PLACEMENT_STATUS = 14 [(input) = "EconomyPlacementStatusRequest", (output) = "EconomyPlacementStatus"];
// Start a new Ad placement by placement ID.
RPC_ID_ECONOMY_PLACEMENT_START = 15 [(input) = "EconomyPlacementStartRequest", (output) = "EconomyPlacementStatus"];
// Claim one or more achievements which have completed their progress.
RPC_ID_ACHIEVEMENTS_CLAIM = 16 [(input) = "AchievementsClaimRequest", (output) = "AchievementsUpdateAck"];
// Get all achievements with progress accumulated by the player.
RPC_ID_ACHIEVEMENTS_GET = 17 [(input) = "", (output) = "AchievementList"];
// Update one or more achievements with the same progress amount.
RPC_ID_ACHIEVEMENTS_UPDATE = 18 [(input) = "AchievementsUpdateRequest", (output) = "AchievementsUpdateAck"];
// Get the energies and their current timers for the player.
RPC_ID_ENERGY_GET = 19 [(input) = "", (output) = "EnergyList"];
// Spend one or more energies for the player.
RPC_ID_ENERGY_SPEND = 20 [(input) = "EnergySpendRequest", (output) = "EnergySpendReward"];
// Grant one or more energies to the player.
RPC_ID_ENERGY_GRANT = 65 [(input) = "EnergyGrantRequest", (output) = "EnergyList"];
// Get the tutorials and current progress step for the player.
RPC_ID_TUTORIALS_GET = 21 [(input) = "", (output) = "TutorialList"];
// Accept an offer to step through a tutorial.
RPC_ID_TUTORIALS_ACCEPT = 22 [(input) = "TutorialAcceptRequest", (output) = "Tutorial"];
// Decline an offer to start a tutorial.
RPC_ID_TUTORIALS_DECLINE = 23 [(input) = "TutorialDeclineRequest", (output) = "Tutorial"];
// Abandon progress on a tutorial.
RPC_ID_TUTORIALS_ABANDON = 24 [(input) = "TutorialAbandonRequest", (output) = "Tutorial"];
// Update the current progress step in the tutorial by ID.
RPC_ID_TUTORIALS_UPDATE = 25 [(input) = "TutorialUpdateRequest", (output) = "TutorialList"];
// Reset the state of all given tutorial IDs.
RPC_ID_TUTORIALS_RESET = 79 [(input) = "TutorialResetRequest", (output) = "TutorialList"];
// Create a team which other players can join.
RPC_ID_TEAMS_CREATE = 26 [(input) = "TeamCreateRequest", (output) = "Team"];
// List one or more teams which the player can join.
RPC_ID_TEAMS_LIST = 27 [(input) = "TeamListRequest", (output) = "TeamList"];
// Search for a team by name or optional short code.
RPC_ID_TEAMS_SEARCH = 28 [(input) = "TeamSearchRequest", (output) = "TeamList"];
// Write a chat message to the Team's chat channel.
RPC_ID_TEAMS_WRITE_CHAT_MESSAGE = 29 [(input) = "TeamWriteChatMessageRequest", (output) = "ChannelMessageAck"];
// Create a random unlockable to assign to a slot (or overflow) unless there are no slots.
RPC_ID_UNLOCKABLES_CREATE = 30 [(input) = "", (output) = "UnlockablesList"];
// Get the unlockables which are currently in progress for the player.
RPC_ID_UNLOCKABLES_GET = 31 [(input) = "", (output) = "UnlockablesList"];
// Start the unlock timer for an unlockable in the specified slot.
RPC_ID_UNLOCKABLES_UNLOCK_START = 32 [(input) = "UnlockablesRequest", (output) = "UnlockablesList"];
// Purchase an unlockable with soft currency based on the remainder cost calculated by the offset left to wait.
RPC_ID_UNLOCKABLES_PURCHASE_UNLOCK = 33 [(input) = "UnlockablesRequest", (output) = "UnlockablesList"];
// Purchase a new slot to be used to store unlockables.
RPC_ID_UNLOCKABLES_PURCHASE_SLOT = 34 [(input) = "", (output) = "UnlockablesList"];
// Claim an unlockable whose start timer has completed or completion was fast tracked with a purchase.
RPC_ID_UNLOCKABLES_CLAIM = 35 [(input) = "UnlockablesRequest", (output) = "UnlockablesReward"];
// Add some set of unlockables to the unlock queue.
RPC_ID_UNLOCKABLES_QUEUE_ADD = 62 [(input) = "UnlockablesQueueAddRequest", (output) = "UnlockablesList"];
// Remove some set of unlockables from the unlock queue.
RPC_ID_UNLOCKABLES_QUEUE_REMOVE = 63 [(input) = "UnlockablesQueueRemoveRequest", (output) = "UnlockablesList"];
// Replace the unlock queue with the given set of unlockables.
RPC_ID_UNLOCKABLES_QUEUE_SET = 64 [(input) = "UnlockablesQueueSetRequest", (output) = "UnlockablesList"];
// Send feedback to the game's developers over email.
RPC_ID_BASE_RATE_APP = 36 [(input) = "RateAppRequest", (output) = ""];
// Update or create the mobile push device tokens and preferences for the player.
RPC_ID_BASE_SET_DEVICE_PREFS = 37 [(input) = "DevicePrefsRequest", (output) = ""];
// Sync offline state.
RPC_ID_BASE_SYNC = 58 [(input) = "SyncRequest", (output) = "SyncResponse"];
// Get the leaderboards defined for the game.
RPC_ID_LEADERBOARDS_CONFIG_GET = 38 [(input) = "", (output) = "LeaderboardConfigList"];
// Get a specified event leaderboard defined for the game.
RPC_ID_EVENT_LEADERBOARD_GET = 42 [(input) = "EventLeaderboardGet", (output) = "EventLeaderboard"];
// Update an event leaderboard record for a user.
RPC_ID_EVENT_LEADERBOARD_UPDATE = 43 [(input) = "EventLeaderboardUpdate", (output) = "EventLeaderboard"];
// Claim an event leaderboard reward for a user.
RPC_ID_EVENT_LEADERBOARD_CLAIM = 44 [(input) = "EventLeaderboardClaim", (output) = "EventLeaderboard"];
// Roll a new cohort for the specified event leaderboard.
RPC_ID_EVENT_LEADERBOARD_ROLL = 45 [(input) = "EventLeaderboardRoll", (output) = "EventLeaderboard"];
// DEBUG. Fill an event leaderboard with random user IDs.
RPC_ID_EVENT_LEADERBOARD_DEBUG_FILL = 60 [(input) = "", (output) = "EventLeaderboard"];
// DEBUG. Assign random scores within a given range to users within the caller's cohort, except for the caller themselves.
RPC_ID_EVENT_LEADERBOARD_DEBUG_RANDOM_SCORES = 61 [(input) = "EventLeaderboardDebugRandomScoresRequest", (output) = "EventLeaderboard"];
// Get all stats.
RPC_ID_STATS_GET = 46 [(input) = "", (output) = "StatList"];
// Update private stats.
RPC_ID_STATS_UPDATE = 47 [(input) = "StatUpdateRequest", (output) = "StatList"];
// Get progressions.
RPC_ID_PROGRESSIONS_GET = 48 [(input) = "ProgressionGetRequest", (output) = "ProgressionList"];
// Purchase a progression for permanent unlock, if supported.
RPC_ID_PROGRESSIONS_PURCHASE = 49 [(input) = "ProgressionPurchaseRequest", (output) = "ProgressionList"];
// Update a progression to change its count, if supported.
RPC_ID_PROGRESSIONS_UPDATE = 50 [(input) = "ProgressionUpdateRequest", (output) = "ProgressionList"];
// List incentives set up by the user.
RPC_ID_INCENTIVES_SENDER_LIST = 51 [(input) = "", (output) = "IncentiveList"];
// Create a new incentive set up by the user.
RPC_ID_INCENTIVES_SENDER_CREATE = 52 [(input) = "IncentiveSenderCreateRequest", (output) = "IncentiveList"];
// Delete an existing incentive set up by the user.
RPC_ID_INCENTIVES_SENDER_DELETE = 53 [(input) = "IncentiveSenderDeleteRequest", (output) = "IncentiveList"];
// Claim rewards for an existing incentive after it has been used by some recipient(s).
RPC_ID_INCENTIVES_SENDER_CLAIM = 54 [(input) = "IncentiveSenderClaimRequest", (output) = "IncentiveList"];
// Get information about an existing incentive from a recipient's perspective.
RPC_ID_INCENTIVES_RECIPIENT_GET = 55 [(input) = "IncentiveRecipientGetRequest", (output) = "IncentiveInfo"];
// Claim an existing incentive and receive associated rewards.
RPC_ID_INCENTIVES_RECIPIENT_CLAIM = 56 [(input) = "IncentiveRecipientClaimRequest", (output) = "IncentiveInfo"];
// Reset progression progress.
RPC_ID_PROGRESSIONS_RESET = 57 [(input) = "ProgressionResetRequest", (output) = "ProgressionList"];
// Fetch all available auction templates.
RPC_ID_AUCTIONS_GET_TEMPLATES = 66 [(input) = "", (output) = "AuctionTemplates"];
// List available auctions.
RPC_ID_AUCTIONS_LIST = 67 [(input) = "AuctionListRequest", (output) = "AuctionList"];
// Bid on an active auction.
RPC_ID_AUCTIONS_BID = 68 [(input) = "AuctionBidRequest", (output) = "Auction"];
// Claim a completed auction where the user was the winning bidder.
RPC_ID_AUCTIONS_CLAIM_BID = 69 [(input) = "AuctionClaimBidRequest", (output) = "AuctionClaimBid"];
// Claim a completed auction where the user was the seller.
RPC_ID_AUCTIONS_CLAIM_CREATED = 70 [(input) = "AuctionClaimCreatedRequest", (output) = "AuctionClaimCreated"];
// Cancel an in-progress auction.
RPC_ID_AUCTIONS_CANCEL = 71 [(input) = "AuctionCancelRequest", (output) = "AuctionCancel"];
// Create a new auction.
RPC_ID_AUCTIONS_CREATE = 72 [(input) = "AuctionCreateRequest", (output) = "Auction"];
// List auctions the user has bid on.
RPC_ID_AUCTIONS_LIST_BIDS = 73 [(input) = "AuctionListBidsRequest", (output) = "AuctionList"];
// List auctions the user has created.
RPC_ID_AUCTIONS_LIST_CREATED = 74 [(input) = "AuctionListCreatedRequest", (output) = "AuctionList"];
// List all available streaks, including their current state and progress if any.
RPC_ID_STREAKS_LIST = 75 [(input) = "", (output) = "StreaksList"];
// Update one or more streaks with the given progress amounts.
RPC_ID_STREAKS_UPDATE = 76 [(input) = "StreaksUpdateRequest", (output) = "StreaksList"];
// Claim the rewards from one or more streaks.
RPC_ID_STREAKS_CLAIM = 77 [(input) = "StreaksClaimRequest", (output) = "StreaksList"];
// Reset all progress for one or more streaks.
RPC_ID_STREAKS_RESET = 78 [(input) = "StreaksResetRequest", (output) = "StreaksList"];
//--- Server to server RPCs ---//
// Webhook RPC to handle Rewarded Video Ad placement success callbacks.
RPC_ID_ECONOMY_PLACEMENT_SUCCESS = 1001;
// Webhook RPC to handle Rewarded Video Ad placement failure callbacks.
RPC_ID_ECONOMY_PLACEMENT_FAIL = 1002;
// RPC to upload Hiro system configurations for the storage personalizer.
RPC_ID_STORAGE_PERSONALIZER_UPLOAD = 1003;
}
enum RpcSocketId {
RPC_SOCKET_ID_UNSPECIFIED = 0;
// Follow auctions a user has an interest in, bid or own. Must be called via a connected socket.
RPC_SOCKET_ID_AUCTIONS_FOLLOW = 1 [(input) = "AuctionFollowRequest", (output) = "AuctionList"];
// Bid on an auction and follow it for further updates.
RPC_SOCKET_ID_AUCTIONS_BID = 2 [(input) = "AuctionBidRequest", (output) = "Auction"];
}
// The cost(s) associated with permanently unlocking a progression.
message ProgressionCost {
// The items which will be deducted.
map<string, int64> items = 1;
// The currencies which will be deducted.
map<string, int64> currencies = 2;
}
// Preconditions associated with a progression.
message ProgressionPreconditions {
// Counts required.
map<string, int64> counts = 1;
// Purchase cost paid.
ProgressionCost cost = 2;
// Other progressions.
repeated string progressions = 3;
// Achievements.
repeated string achievements = 4;
// Items with associated minimum counts.
map<string, int64> items_min = 5;
// Items with associated maximum counts.
map<string, int64> items_max = 6;
// Stats with associated minimum values.
map<string, int64> stats_min = 7;
// Stats with associated maximum values.
map<string, int64> stats_max = 8;
// Energies with associated minimum counts.
map<string, int64> energy_min = 9;
// Energies with associated maximum counts.
map<string, int64> energy_max = 10;
// Currencies with associated minimum counts.
map<string, int64> currency_min = 11;
// Currencies with associated maximum counts.
map<string, int64> currency_max = 12;
}
enum ProgressionPreconditionsOperator {
// Unspecified. Defaults to AND.
PROGRESSION_PRECONDITIONS_OPERATOR_UNSPECIFIED = 0;
// Both the direct preconditions and the nested block must be true.
PROGRESSION_PRECONDITIONS_OPERATOR_AND = 1;
// Either the direct preconditions or the nested block must be true.
PROGRESSION_PRECONDITIONS_OPERATOR_OR = 2;
// Either the direct preconditions or the nested block must be true, but not both.
PROGRESSION_PRECONDITIONS_OPERATOR_XOR = 3;
// The direct preconditions must be true, but the nested block must not be.
PROGRESSION_PRECONDITIONS_OPERATOR_NOT = 4;
}
// A complex set of progression preconditions.
message ProgressionPreconditionsBlock {
// Direct preconditions.
ProgressionPreconditions direct = 1;
// Operator for any nested block.
ProgressionPreconditionsOperator operator = 2;
// Nested block of preconditions, if any.
ProgressionPreconditionsBlock nested = 3;
}
// A progression element which can be unlocked to access further progressions.
message Progression {
// The ID of the progression.
string id = 1;
// The name of the progression. May be an i18n code.
string name = 2;
// A description of the progression. May be an i18n code.
string description = 3;
// The category to group the progression together with others.
string category = 4;
// Current count, if any.
map<string, int64> counts = 5;
// Additional metadata properties.
map<string, string> additional_properties = 6;
// Flag indicating unlock status.
bool unlocked = 7;
// All preconditions.
ProgressionPreconditionsBlock preconditions = 8;
// Unmet preconditions.
ProgressionPreconditionsBlock unmet_preconditions = 9;
}
enum ProgressionDeltaState {
// Unspecified. Defaults to UNCHANGED.
PROGRESSION_DELTA_STATE_UNSPECIFIED = 0;
// Progression unlock state has not changed.
PROGRESSION_DELTA_STATE_UNCHANGED = 1;
// Progression was locked, it is now unlocked.
PROGRESSION_DELTA_STATE_UNLOCKED = 2;
// Progression was unlocked, it is now locked.
PROGRESSION_DELTA_STATE_LOCKED = 3;
}
// A change in a given progression, compared to a previously known state.
message ProgressionDelta {
// The ID of the progression.
string id = 1;
// Potential state change.
ProgressionDeltaState state = 2;
// Changes to counts, if any.
map<string, int64> counts = 3;
// Changes to preconditions, if any.
ProgressionPreconditionsBlock preconditions = 4;
}
// All or a filtered list of progressions for a user.
message ProgressionList {
// Progressions keyed by progression ID.
map<string, Progression> progressions = 1;
// Progression deltas keyed by progression ID.
map<string, ProgressionDelta> deltas = 2;
}
// Request progressions for a user, optionally including previously seen state for delta calculations.
message ProgressionGetRequest {
// Optional last known progressions state, keyed by progression ID.
map<string, Progression> progressions = 1;
}
// Request to permanently unlock a progression, if supported by that specific progression.
message ProgressionPurchaseRequest {
// ID of the progression to permanently unlock.
string id = 1;
}
// Request to update a progression, if supported by that specific progression.
message ProgressionUpdateRequest {
// ID of the progression to update.
string id = 1;
// One or more counts to add to the progression.
map<string, int64> counts = 2;
}
// Request to reset progression progress.
message ProgressionResetRequest {
// The progression IDs to reset.
repeated string ids = 1;
}
// Indicate how a stats update should be handled.
enum StatUpdateOperator {
// Unspecified. Defaults to Set.
STAT_UPDATE_OPERATOR_UNSPECIFIED = 0;
// Set the given value, overwriting any previous one.
STAT_UPDATE_OPERATOR_SET = 1;
// Increment or decrement the existing value by the given amount. Equivalent to Set if no previous value existed.
STAT_UPDATE_OPERATOR_DELTA = 2;
// Use the new value if it's lower than the existing one. Equivalent to Set if no previous value existed.
STAT_UPDATE_OPERATOR_MIN = 3;
// Use the new value if it's higher than the existing one. Equivalent to Set if no previous value existed.
STAT_UPDATE_OPERATOR_MAX = 4;
}
// Describes a single stat update.
message StatUpdate {
// Name.
string name = 1;
// Value.
int64 value = 2;
// Operator.
StatUpdateOperator operator = 3;
}
// Request an optionally batched stats update.
message StatUpdateRequest {
// Public stat updates.
repeated StatUpdate public = 1;
// Private stat updates.
repeated StatUpdate private = 2;
}
// A single stat with associated information.
message Stat {
// Name.
string name = 1;
// Indicator if this belongs to public or private stats.
bool public = 2;
// Update time in UTC seconds.
int64 update_time_sec = 3;
// Current value.
int64 value = 4;
// Number of values submitted.
int64 count = 5;
// Total of all submitted values.
int64 total = 6;
// Smallest value submitted.
int64 min = 7;
// Largest value submitted.
int64 max = 8;
// First value submitted.
int64 first = 9;
// Latest value submitted.
int64 last = 10;
}
// A list of stats all belonging to one user.
message StatList {
// Public stat names and their associated data.
map<string, Stat> public = 1;
// Private stat names and their associated data.
map<string, Stat> private = 2;
}
// A receipt reply from a channel message send operation.
message ChannelMessageAck {
// The channel the message was sent to.
string channel_id = 1;
// The unique ID assigned to the message.
string message_id = 2;
// The code representing a message type or category.
int32 code = 3;
// Username of the message sender.
string username = 4;
// The UNIX time (for gRPC clients) or ISO string (for REST clients) when the message was created.
int64 create_time = 5;
// The UNIX time (for gRPC clients) or ISO string (for REST clients) when the message was last updated.
int64 update_time = 6;
// True if the message was persisted to the channel's history, false otherwise.
bool persistent = 7;
// The name of the chat room, or an empty string if this message was not sent through a chat room.
string room_name = 8;
// The ID of the group, or an empty string if this message was not sent through a group channel.
string group_id = 9;
// The ID of the first DM user, or an empty string if this message was not sent through a DM chat.
string user_id_one = 10;
// The ID of the second DM user, or an empty string if this message was not sent through a DM chat.
string user_id_two = 11;
}
// Update or create the mobile push device tokens and preferences.
message DevicePrefsRequest {
// The device ID to set.
string device_id = 1;
// The push token from the Android device. This or 'push_token_ios' must be set.
string push_token_android = 2;
// The push token from the iOS device. This or 'push_token_android' must be set.
string push_token_ios = 3;
// Additional device preferences for push events. Must be owned by the user.
map<string, bool> preferences = 4;
}
// The store types supported by the Economy system.
enum EconomyStoreType {
// Unspecified. Defaults to Apple.
ECONOMY_STORE_TYPE_UNSPECIFIED = 0;
// Apple App Store.
ECONOMY_STORE_TYPE_APPLE_APPSTORE = 1;
// Google Play.
ECONOMY_STORE_TYPE_GOOGLE_PLAY = 2;
// Facebook Instant games.
ECONOMY_STORE_TYPE_FBINSTANT = 3;
// Discord Store.
ECONOMY_STORE_TYPE_DISCORD = 4;
}
// Inventory item granted.
message RewardInventoryItem {
// The ID of the item.
string id = 1;
// The count granted of the item.
int64 count = 2;
// The properties with string values.
map<string, string> string_properties = 3;
// The properties with numeric values.
map<string, double> numeric_properties = 4;
// The instance ID of the item.
string instance_id = 5;
}
// Energy modifier granted.
message RewardEnergyModifier {
// The ID of they modifier granted.
string id = 1;
// The energy modifier operator.
string operator = 2;
// The value to apply. Its behavior depends on the operator.
int64 value = 3;
// The duration of the energy modifier in seconds.
uint64 duration_sec = 4;
// The weight of the energy modifier, if weighted. Otherwise, -1.
int64 weight = 5;
}
// A reward modifier temporally adjusts the way all rewards are handled in the economy.
message RewardModifier {
// The ID of the reward content to modify.
string id = 1;
// The type of reward content to modify.
string type = 2;
// The operator to apply.
string operator = 3;
// The value to apply. Its behavior depends on the operator.
int64 value = 4;
// The duration of the item modifier in seconds.
uint64 duration_sec = 5;
}
// A reward modifier that is currently active.
message ActiveRewardModifier {
// The ID of the reward content to modify.
string id = 1;
// The type of reward content to modify.
string type = 2;
// The operator to apply.
string operator = 3;
// The value to apply. Its behavior depends on the operator.
int64 value = 4;
// The start time when this reward modifier was activated.
int64 start_time_sec = 5;
// The time when this reward modifier will expire.
int64 end_time_sec = 6;
}
// Rewards granted to the player.
message Reward {
// The items granted. Indexed by item ID.
map<string, int64> items = 1;
// The currencies granted.
map<string, int64> currencies = 2;
// The energy granted.
map<string, int32> energies = 3;
// The energy modifier granted.
repeated RewardEnergyModifier energy_modifiers = 4;
// The reward modifiers granted.
repeated RewardModifier reward_modifiers = 5;
// When the reward was granted, in UNIX time.
int64 grant_time_sec = 6;
// The item instances granted. Indexed by item instance ID.
map<string, RewardInventoryItem> item_instances = 7;
}
// A list of rewards granted to the player.
message RewardList {
// The rewards granted.
repeated Reward rewards = 1;
}
// A range of possible values.
message RewardRangeInt32 {
// The minimum bound of the range.
int32 min = 1;
// The maximum bound of the range.
int32 max = 2;
// A number that the result must be a multiple of.
int32 multiple = 3;
}
// A range of possible values.
message RewardRangeInt64 {
// The minimum bound of the range.
int64 min = 1;
// The maximum bound of the range.
int64 max = 2;
// A number that the result must be a multiple of.
int64 multiple = 3;
}
// A range of possible values.
message RewardRangeUInt64 {
// The minimum bound of the range.
uint64 min = 1;
// The maximum bound of the range.
uint64 max = 2;
// A number that the result must be a multiple of.
uint64 multiple = 3;
}
// A range of possible values.
message RewardRangeDouble {
// The minimum bound of the range.
double min = 1;
// The maximum bound of the range.
double max = 2;
// A number that the result must be a multiple of.
double multiple = 3;
}
// A possible string property option.
message AvailableRewardsStringPropertyOption {
// The option weight.
int64 weight = 1;
}
// A possible string property.
message AvailableRewardsStringProperty {
// The available string property options.
map<string, AvailableRewardsStringPropertyOption> options = 1;
// The total weight from which the options are selected.
int64 total_weight = 2;
}
// A possible item reward.
message AvailableRewardsItem {
// The possible count of the reward.
RewardRangeInt64 count = 1;
// The possible numeric properties of the reward.
map<string, RewardRangeDouble> numeric_properties = 2;
// The possible string properties of the reward.
map<string, AvailableRewardsStringProperty> string_properties = 3;
}
// A possible item reward.
message AvailableRewardsItemSet {
// The number of items to draw from the set.
RewardRangeInt64 count = 1;
// The number of repeat items that may be drawn from the set. Also includes the user's inventory.
int64 max_repeats = 2;
// Drawn items must exist in the intersection of these sets.
repeated string set = 3;
}
// A possible currency reward.
message AvailableRewardsCurrency {
// The possible count of the currency.
RewardRangeInt64 count = 1;
}
// A possible energy reward.
message AvailableRewardsEnergy {
// The possible count of the energy.
RewardRangeInt32 count = 1;
}
// A possible energy reward.
message AvailableRewardsEnergyModifier {
// The ID of the energy to modify.
string id = 1;
// The operator of the energy modifier.
string operator = 2;
// The value of the energy modifier.
RewardRangeInt64 value = 3;
// The possible duration of the modifier.
RewardRangeUInt64 duration_sec = 4;
}
// A possible modifier reward.
message AvailableRewardsRewardModifier {
// The ID of the reward item, currency, energy, or energy modifier to modify.
string id = 1;
// The type of reward content to modify.
string type = 2;
// The operator of the modifier.
string operator = 3;
// The value of the modifier.
RewardRangeInt64 value = 4;
// The possible duration of the modifier.
RewardRangeUInt64 duration_sec = 5;
}
// The reward contents for available rewards.
message AvailableRewardsContents {
// All possible items from this particular reward.
map<string, AvailableRewardsItem> items = 1;
// All possible item sets from this particular reward.
repeated AvailableRewardsItemSet item_sets = 2;
// All possible currencies from this particular reward.
map<string, AvailableRewardsCurrency> currencies = 3;
// All possible energies from this particular reward.
map<string, AvailableRewardsEnergy> energies = 4;
// All possible energy reward modifiers from this particular reward.
repeated AvailableRewardsEnergyModifier energy_modifiers = 5;
// All reward modifiers from this particular reward.
repeated AvailableRewardsRewardModifier reward_modifiers = 6;
// The weight of the reward contents.
int64 weight = 7;
}
// The available rewards and their probabilistic weights.
message AvailableRewards {
// The guaranteed contents to grant.
AvailableRewardsContents guaranteed = 1;
// The weighted contents to grant.
repeated AvailableRewardsContents weighted = 2;
// The number of weighted reward contents to select from among the possibilities.
int64 max_rolls = 3;
/* The total weight that all weighted reward contents are calculated against. Auto calculated if set to 0 but can be
set to a higher value to introduce a chance of a "none" reward. */
int64 total_weight = 4;
// The maximum number of repeats of any given weighted reward.
int64 max_repeat_rolls = 5;
}
// Types of incentives.
enum IncentiveType {
// Unspecified. Defaults to INVITE.
INCENTIVE_TYPE_UNSPECIFIED = 0;
// An invite with an associated incentive reward.
INCENTIVE_TYPE_INVITE = 1;
}
// The result of claiming an incentive.
message IncentiveClaim {
// Reward granted.
Reward reward = 1;
// Claim time in UTC seconds.
int64 claim_time_sec = 2;
}
// An incentive set up by a user.
message Incentive {
// The ID of the incentive.
string id = 1;
// Name.
string name = 2;
// Description.
string description = 3;
// Shareable incentive code.
string code = 4;
// The type of the incentive.
IncentiveType type = 5;
// Create time in UTC seconds.
int64 create_time_sec = 6;
// Update time in UTC seconds.
int64 update_time_sec = 7;
// Expiry time in UTC seconds.
int64 expiry_time_sec = 8;
// Available reward.
AvailableRewards recipient_rewards = 9;
// Sender reward.
AvailableRewards sender_rewards = 10;
// Recipient user IDs for which the owner of the incentive has not yet claimed their sender reward.
repeated string unclaimed_recipients = 11;
// Sender rewards so far collected for this incentive.
repeated Reward rewards = 12;
// Max claims.
int64 max_claims = 13;
// Current user IDs that have claimed, and their outcomes.
map<string, IncentiveClaim> claims = 14;
}
// A list of incentives set up by a user.
message IncentiveList {
// Incentives set up by a single user.
repeated Incentive incentives = 1;
}
// An incentive claimant's view of a single incentive.
message IncentiveInfo {
// The ID of the incentive.
string id = 1;
// Name.
string name = 2;
// Description.
string description = 3;
// Unique shareable incentive code.
string code = 4;
// The type of the incentive.
IncentiveType type = 5;
// Incentive sender user ID.
string sender = 6;
// Available rewards that the caller can claim.
AvailableRewards available_rewards = 7;
// Indicator if the caller can claim rewards.
bool can_claim = 8;
// Reward that was granted.
Reward reward = 9;
// Create time in UTC seconds.
int64 create_time_sec = 10;
// Update time in UTC seconds.
int64 update_time_sec = 11;
// Expiry time in UTC seconds.
int64 expiry_time_sec = 12;
// Claim time in UTC seconds.
int64 claim_time_sec = 13;
}
// Request by a user to set up a new incentive.
message IncentiveSenderCreateRequest {
// The incentive configuration ID.
string id = 1;
}
// Request by a user to delete an incentive they had set up.
message IncentiveSenderDeleteRequest {
// The unique incentive code.
string code = 1;
}
// Request by a user to claim rewards from an incentive they had set up.
message IncentiveSenderClaimRequest {
// The unique incentive code.
string code = 1;
// The recipient ID(s) to claim for, or empty for all.
repeated string recipient_ids = 2;
}
// Request by a potential incentive claimant to view incentive information.
message IncentiveRecipientGetRequest {
// The unique incentive code.
string code = 1;
}
// Request by a potential incentive claimant to claim an incentive.
message IncentiveRecipientClaimRequest {
// The unique incentive code.
string code = 1;
}
// Find and retrieve an event leaderboard by ID, automatically joining the event if necessary.
message EventLeaderboardGet {
// Event leaderboard ID to get, and join if necessary/possible.
string id = 1;
}
// Submit a score to an event leaderboard.
message EventLeaderboardUpdate {
// Event leaderboard ID.
string id = 1;
// Score.
int64 score = 2;
// Subscore.
int64 subscore = 3;
// Metadata.
string metadata = 4;
}
// Claim the available reward for an event leaderboard by ID.
message EventLeaderboardClaim {
// Event leaderboard ID to claim.
string id = 1;
}
// Roll a new cohort for the specified event leaderboard.
message EventLeaderboardRoll {
// Event leaderboard ID to roll.
string id = 1;
}
// A single participant entry to an event leaderboard.
message EventLeaderboardScore {
// User ID.
string id = 1;
// Username.
string username = 2;
// Display name.
string display_name = 3;
// Avatar URL.
string avatar_url = 4;
// Time when the user joined the event leaderboard.
int64 create_time_sec = 5;
// Time when the user last submitted a score.
int64 update_time_sec = 6;
// Rank within the event leaderboard.
int64 rank = 7;
// Score.
int64 score = 8;
// Subscore.
int64 subscore = 9;
// Number of score submissions.
int64 num_scores = 10;
// Metadata.
string metadata = 11;
}
// A reward range within a specific tier based on ranks.
message EventLeaderboardRewardTier {
// Name for this tier.
string name = 1;
// The maximum rank (inclusive).
int32 rank_max = 2;
// The minimum rank (inclusive).
int32 rank_min = 3;
// The available rewards for this range.
AvailableRewards available_rewards = 4;
// Change in tier for this rank range.
int32 tier_change = 5;
}
// An event leaderboard's tier-specific set of rewards.
message EventLeaderboardRewardTiers {
// Possible reward tiers.
repeated EventLeaderboardRewardTier reward_tiers = 1;
}
// An event leaderboard's tier-specific promotion/demotion zones.
message EventLeaderboardChangeZone {
// Percentage of cohort to promote, expressed in the range of 0.0 to 1.0.
double promotion = 1;
// Percentage of cohort to demote, expressed in the range of 0.0 to 1.0.
double demotion = 2;
// Whether or not to always demote players that failed to submit a score at all.
bool demote_idle = 3;
}
// Details about a specific event leaderboard.
message EventLeaderboard {
// Event leaderboard ID.
string id = 1;
// The name of the event leaderboard. May be an i18n code.
string name = 2;
// A description of the event leaderboard. May be an i18n code.
string description = 3;
// The category to group the event leaderboard together with others.
string category = 4;
// Score ordering.
bool ascending = 5;
// Score submission operator.
string operator = 6;
// The tier of this instance of the event leaderboard.
int32 tier = 7;
// Time when the event starts.
int64 start_time_sec = 8;
// Time when the event ends.
int64 end_time_sec = 9;
// Time when the event expires.
int64 expiry_time_sec = 10;
// The available reward and its probabilities.
AvailableRewards available_rewards = 11;
// The possible reward tiers for this instance of the event leaderboard, based on its current tier.
map<int32, EventLeaderboardRewardTiers> reward_tiers = 12;
// Per-tier promotion/demotion change zones, if configured.
map<int32, EventLeaderboardChangeZone> change_zones = 13;
// Claim time, if any.
int64 claim_time_sec = 14;
// The outcome (rolled) reward for the event leaderboard.
Reward reward = 15;
// Additional metadata properties.
map<string, string> additional_properties = 16;
// Current participant count.
int64 count = 17;
// Maximum participant count.
int64 max_count = 18;
// Maximum number of score submissions per participant.
int64 max_num_score = 19;
// Participants and their scores.
repeated EventLeaderboardScore scores = 20;
// Indicates if the event is still active, and scores can be submitted.
bool is_active = 21;
// Indicates if the event is over and its reward can be claimed.
bool can_claim = 22;
// Indicates if the event can be rolled to get a new set of opponents.
bool can_roll = 23;
// Extra matchmaker properties for this cohort.
google.protobuf.Struct matchmaker_properties = 24;
// The UNIX timestamp for the current server time.
int64 current_time_sec = 25;
// Cohort ID the user belongs to for this active phase.
string cohort_id = 26;
}
message EventLeaderboardDebugFillRequest {
// Event leaderboard ID to fill.
string id = 1;
// Optional target cohort size to fill to, otherwise fill to max cohort size.
int32 target_count = 2;
}
// DEBUG. Payload describing scores to set for a cohort's participants.
message EventLeaderboardDebugRandomScoresRequest {
// Event leaderboard ID to update.
string id = 1;
// Minimum score, inclusive.
int64 min = 2;
// Maximum score, inclusive.
int64 max = 3;
// Optional operator to use when updating scores.
google.protobuf.Int32Value operator = 4;
// Minimum subscore, inclusive.
int64 subscore_min = 5;
// Maximum subscore, inclusive.
int64 subscore_max = 6;
}
// A contributor to this donation.
message EconomyDonationContributor {
// The user ID that contributed.
string user_id = 1;
// The amount they've donated.
int64 count = 2;
}
// A donation for a user.
message EconomyDonation {
// The user that owns this donation.
string user_id = 1;
// The count of how much of the donation has already been claimed.
int64 claim_count = 2;
// The count of how much has been contributed by users.
int64 count = 3;