-
Notifications
You must be signed in to change notification settings - Fork 0
/
gateway.proto
461 lines (387 loc) · 8.94 KB
/
gateway.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
syntax = "proto3";
option csharp_namespace = "Protobuf.Messages";
message WebSocketRequest {
oneof request_type {
GetUser get_user = 1;
GetUserByUsername get_user_by_username = 2;
CreateUser create_user = 3;
GetCampaigns get_campaigns = 4;
GetCampaign get_campaign = 5;
GetLevel get_level = 6;
FightLevel fight_level = 7;
SelectUnit select_unit = 9;
UnselectUnit unselect_unit = 10;
LevelUpUnit level_up_unit = 11;
TierUpUnit tier_up_unit = 12;
FuseUnit fuse_unit = 13;
EquipItem equip_item = 14;
UnequipItem unequip_item = 15;
GetItem get_item = 16;
LevelUpItem level_up_item = 17;
GetBoxes get_boxes = 18;
GetBox get_box = 19;
Summon summon = 20;
GetKalineAfkRewards get_kaline_afk_rewards = 21;
ClaimKalineAfkRewards claim_kaline_afk_rewards = 22;
GetUserSuperCampaignProgresses get_user_super_campaign_progresses = 23;
LevelUpKalineTree level_up_kaline_tree = 24;
ClaimDungeonAfkRewards claim_dungeon_afk_rewards = 25;
LevelUpDungeonSettlement level_up_dungeon_settlement = 26;
PurchaseDungeonUpgrade purchase_dungeon_upgrade = 27;
GetDungeonAfkRewards get_dungeon_afk_rewards = 28;
}
}
message GetUser {
string user_id = 1;
}
message GetUserByUsername {
string username = 1;
}
message CreateUser {
string username = 1;
}
message GetCampaigns {
string user_id = 1;
}
message GetCampaign {
string user_id = 1;
string campaign_id = 2;
}
message GetLevel {
string user_id = 1;
string level_id = 2;
}
message FightLevel {
string user_id = 1;
string level_id = 2;
}
message SelectUnit {
string user_id = 1;
string unit_id = 2;
uint32 slot = 3;
}
message UnselectUnit {
string user_id = 1;
string unit_id = 2;
}
message LevelUpUnit {
string user_id = 1;
string unit_id = 2;
}
message TierUpUnit {
string user_id = 1;
string unit_id = 2;
}
message FuseUnit {
string user_id = 1;
string unit_id = 2;
repeated string consumed_units_ids = 3;
}
message EquipItem {
string user_id = 1;
string item_id = 2;
string unit_id = 3;
}
message UnequipItem {
string user_id = 1;
string item_id = 2;
}
message GetItem {
string user_id = 1;
string item_id = 2;
}
message LevelUpItem {
string user_id = 1;
string item_id = 2;
}
message GetKalineAfkRewards {
string user_id = 1;
}
message ClaimKalineAfkRewards {
string user_id = 1;
}
message GetBoxes {
string user_id = 1;
}
message GetBox {
string box_id = 1;
}
message Summon {
string user_id = 1;
string box_id = 2;
}
message GetUserSuperCampaignProgresses {
string user_id = 1;
}
message LevelUpKalineTree {
string user_id = 1;
}
message ClaimDungeonAfkRewards {
string user_id = 1;
}
message LevelUpDungeonSettlement {
string user_id = 1;
}
message PurchaseDungeonUpgrade {
string user_id = 1;
string upgrade_id = 2;
}
message GetDungeonAfkRewards {
string user_id = 1;
}
////////////////////////////////////////
message WebSocketResponse {
oneof response_type {
User user = 1;
Unit unit = 2;
Units units = 3;
UnitAndCurrencies unit_and_currencies = 4;
Item item = 5;
Campaigns campaigns = 6;
Campaign campaign = 7;
Level level = 8;
BattleResult battle_result = 9;
Error error = 10;
Boxes boxes = 11;
Box box = 12;
UserAndUnit user_and_unit = 13;
AfkRewards afk_rewards = 14;
SuperCampaignProgresses super_campaign_progresses = 15;
}
}
message User {
string id = 1;
string username = 2;
uint64 level = 3;
uint64 experience = 4;
repeated UserCurrency currencies = 7;
repeated Unit units = 8;
repeated Item items = 9;
KalineTreeLevel kaline_tree_level = 10;
DungeonSettlementLevel dungeon_settlement_level = 11;
}
message KalineTreeLevel {
string id = 1;
uint64 level = 2;
uint64 fertilizer_level_up_cost = 3;
uint64 gold_level_up_cost = 4;
repeated string unlock_features = 5;
repeated AfkRewardRate afk_reward_rates = 6;
}
message DungeonSettlementLevel {
string id = 1;
uint64 level = 2;
repeated CurrencyCost level_up_costs = 3;
uint64 max_dungeon = 4;
uint64 max_factional = 5;
uint64 supply_limit = 6;
repeated AfkRewardRate afk_reward_rates = 7;
}
message SuperCampaignProgresses {
repeated SuperCampaignProgress super_campaign_progresses = 1;
}
message SuperCampaignProgress {
string user_id = 1;
string campaign_id = 2;
string level_id = 3;
string super_campaign_name = 4;
}
message AfkRewardRate {
string kaline_tree_level_id = 1;
Currency currency = 2;
float daily_rate = 3;
}
message UserCurrency {
Currency currency = 1;
uint32 amount = 2;
}
message Currency {
string name = 1;
}
message Unit {
string id = 1;
uint32 level = 2;
uint32 tier = 3;
uint32 rank = 4;
bool selected = 5;
uint32 slot = 6;
string campaign_level_id = 7;
string user_id = 8;
Character character = 9;
repeated Item items = 10;
}
message Units {
repeated Unit units = 1;
}
message UnitAndCurrencies {
Unit unit = 1;
repeated UserCurrency user_currency = 2;
}
message Character {
bool active = 1;
string name = 2;
string faction = 3;
uint32 quality = 4;
}
message Item {
string id = 1;
uint32 level = 2;
ItemTemplate template = 3;
string user_id = 4;
string unit_id = 5;
}
message ItemTemplate {
string id = 1;
string name = 2;
string type = 3;
}
message Campaigns {
repeated Campaign campaigns = 1;
}
message Campaign {
string id = 1;
string super_campaign_name = 2;
uint32 campaign_number = 3;
repeated Level levels = 4;
}
message Level {
string id = 1;
string campaign_id = 2;
uint32 level_number = 3;
repeated Unit units = 4;
repeated CurrencyReward currency_rewards = 5;
uint32 experience_reward = 6;
}
message CurrencyReward {
Currency currency = 1;
uint64 amount = 3;
}
message AfkRewards {
repeated AfkReward afk_rewards = 1;
}
message AfkReward {
Currency currency = 1;
uint64 amount = 2;
}
message Error {
string reason = 1;
}
message Boxes {
repeated Box boxes = 1;
}
message Box {
string id = 1;
string name = 2;
string description = 3;
repeated string factions = 4;
repeated RankWeights rank_weights = 5;
repeated CurrencyCost cost = 6;
}
message RankWeights {
int32 rank = 1;
int32 weight = 2;
}
message CurrencyCost {
Currency currency = 1;
int32 amount = 2;
}
message UserAndUnit {
User user = 1;
Unit unit = 2;
}
// BATTLE RESULT
enum SkillActionType {
ANIMATION_START = 0;
EFFECT_TRIGGER = 1;
EFFECT_HIT = 2;
EFFECT_MISS = 3;
}
enum Stat {
HEALTH = 0;
ENERGY = 1;
ATTACK = 2;
DEFENSE = 3;
DAMAGE_REDUCTION = 4;
SPEED = 5;
}
message BattleResult {
State initial_state = 1;
repeated Step steps = 2;
string result = 3;
}
message State {
repeated BattleUnit units = 1;
}
message BattleUnit {
string id = 1;
int32 health = 2;
int32 energy = 3;
int32 slot = 4;
string character_id = 5;
int32 team = 6;
}
message Step {
int32 step_number = 1;
repeated Action actions = 2;
}
message Action {
oneof action_type {
SkillAction skill_action = 1;
ModifierReceived modifier_received = 2;
TagReceived tag_received = 3;
ModifierExpired modifier_expired = 4;
TagExpired tag_expired = 5;
Death death = 6;
ExecutionReceived execution_received = 7;
EnergyRegen energy_regen = 8;
StatOverride stat_override = 9;
}
}
message StatAffected {
Stat stat = 1;
float amount = 2;
}
message SkillAction {
string caster_id = 1;
repeated string target_ids = 2;
string skill_id = 3;
SkillActionType skill_action_type = 4;
}
message ExecutionReceived {
string target_id = 1;
StatAffected stat_affected = 2;
}
message ModifierReceived {
string skill_id = 1;
string target_id = 2;
StatAffected stat_affected = 3;
string operation = 4;
}
message TagReceived {
string skill_id = 1;
string target_id = 2;
string tag = 3;
}
message ModifierExpired {
string skill_id = 1;
string target_id = 2;
StatAffected stat_affected = 3;
string operation = 4;
}
message TagExpired {
string skill_id = 1;
string target_id = 2;
string tag = 3;
}
message Death {
string unit_id = 1;
}
message EnergyRegen {
string target_id = 1;
string skill_id = 2;
float amount = 3;
}
message StatOverride {
string target_id = 1;
StatAffected stat_affected = 2;
}