tachyon-protocol 0.1.11 → 0.2.0

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.
Files changed (50) hide show
  1. package/README.md +62 -38
  2. package/dist/bot/slave/request.json +7 -3
  3. package/dist/bot/slave/response.json +67 -19
  4. package/dist/bot/unslave/request.json +7 -3
  5. package/dist/bot/unslave/response.json +67 -19
  6. package/dist/game/launch/response.json +66 -19
  7. package/dist/index.d.ts +505 -271
  8. package/dist/lobby/close/request.json +6 -3
  9. package/dist/lobby/close/response.json +66 -19
  10. package/dist/lobby/create/request.json +6 -3
  11. package/dist/lobby/create/response.json +118 -27
  12. package/dist/lobby/join/request.json +6 -3
  13. package/dist/lobby/join/response.json +248 -47
  14. package/dist/lobby/joined/response.json +66 -19
  15. package/dist/lobby/leave/request.json +6 -3
  16. package/dist/lobby/leave/response.json +92 -23
  17. package/dist/lobby/left/response.json +66 -19
  18. package/dist/lobby/list/request.json +6 -3
  19. package/dist/lobby/list/response.json +66 -19
  20. package/dist/lobby/receiveMessage/response.json +66 -19
  21. package/dist/lobby/sendMessage/request.json +6 -3
  22. package/dist/lobby/sendMessage/response.json +118 -27
  23. package/dist/lobby/updated/response.json +66 -19
  24. package/dist/matchmaking/cancel/request.json +6 -3
  25. package/dist/matchmaking/cancel/response.json +92 -23
  26. package/dist/matchmaking/found/response.json +66 -19
  27. package/dist/matchmaking/list/request.json +6 -3
  28. package/dist/matchmaking/list/response.json +66 -19
  29. package/dist/matchmaking/lost/response.json +66 -19
  30. package/dist/matchmaking/queue/request.json +6 -3
  31. package/dist/matchmaking/queue/response.json +118 -27
  32. package/dist/matchmaking/queueUpdate/response.json +66 -19
  33. package/dist/matchmaking/ready/request.json +6 -3
  34. package/dist/matchmaking/ready/response.json +92 -23
  35. package/dist/matchmaking/readyUpdate/response.json +66 -19
  36. package/dist/meta.json +1 -23
  37. package/dist/system/disconnect/request.json +6 -3
  38. package/dist/system/disconnected/response.json +66 -19
  39. package/dist/system/version/response.json +67 -20
  40. package/package.json +1 -1
  41. package/dist/account/getToken/request.json +0 -74
  42. package/dist/account/getToken/response.json +0 -91
  43. package/dist/account/login/request.json +0 -32
  44. package/dist/account/login/response.json +0 -300
  45. package/dist/account/recover/request.json +0 -15
  46. package/dist/account/recover/response.json +0 -58
  47. package/dist/account/register/request.json +0 -53
  48. package/dist/account/register/response.json +0 -78
  49. package/dist/account/rename/request.json +0 -33
  50. package/dist/account/rename/response.json +0 -66
package/dist/index.d.ts CHANGED
@@ -3,186 +3,211 @@
3
3
  * Instead modify the .ts files in src/schema and do npm run build
4
4
  */
5
5
 
6
- export type AccountGetTokenResponse =
6
+ export type BotSlaveResponse =
7
7
  | {
8
- command: "account/getToken/response";
8
+ messageId: string;
9
+ commandId: "bot/slave/response";
9
10
  status: "success";
10
- data: {
11
- token: string;
12
- };
13
11
  }
14
12
  | {
15
- command: "account/getToken/response";
13
+ messageId: string;
14
+ commandId: "bot/slave/response";
16
15
  status: "failed";
17
- reason:
18
- | "no_user_found"
19
- | "unverified"
20
- | "invalid_password"
21
- | "max_attempts"
22
- | "internal_error"
23
- | "unauthorized"
24
- | "invalid_command";
25
- };
26
- export type AccountLoginResponse =
16
+ reason: "internal_error";
17
+ }
27
18
  | {
28
- command: "account/login/response";
29
- status: "success";
30
- data: {
31
- user: {
32
- userId: number;
33
- username: string;
34
- clanId: number | null;
35
- icons: {
36
- /**
37
- * This interface was referenced by `undefined`'s JSON-Schema definition
38
- * via the `patternProperty` "^(.*)$".
39
- */
40
- [k: string]: string;
41
- };
42
- roles: ("admin" | "moderator" | "autohost" | "mentor" | "caster" | "tourney")[];
43
- battleStatus: {
44
- lobbyId: number | null;
45
- inGame: boolean;
46
- away: boolean;
47
- ready: boolean;
48
- playerNumber: number | null;
49
- teamColour: string | null;
50
- isPlayer: boolean;
51
- bonus: number;
52
- sync: {
53
- engine: number;
54
- game: number;
55
- map: number;
56
- };
57
- partyId: number | null;
58
- muted: boolean;
59
- } | null;
60
- email: string;
61
- friends: number[];
62
- friendRequests: number[];
63
- ignores: number[];
64
- };
65
- };
19
+ messageId: string;
20
+ commandId: "bot/slave/response";
21
+ status: "failed";
22
+ reason: "unauthorized";
66
23
  }
67
24
  | {
68
- command: "account/login/response";
25
+ messageId: string;
26
+ commandId: "bot/slave/response";
69
27
  status: "failed";
70
- reason: "invalid_token" | "expired_token" | "banned" | "internal_error" | "unauthorized" | "invalid_command";
28
+ reason: "invalid_command";
71
29
  };
72
- export type AccountRecoverResponse =
30
+ export type BotUnslaveResponse =
73
31
  | {
74
- command: "account/recover/response";
32
+ messageId: string;
33
+ commandId: "bot/unslave/response";
75
34
  status: "success";
76
35
  }
77
36
  | {
78
- command: "account/recover/response";
37
+ messageId: string;
38
+ commandId: "bot/unslave/response";
79
39
  status: "failed";
80
- reason: "internal_error" | "unauthorized" | "invalid_command";
81
- };
82
- export type AccountRegisterResponse =
40
+ reason: "internal_error";
41
+ }
83
42
  | {
84
- command: "account/register/response";
85
- status: "success";
43
+ messageId: string;
44
+ commandId: "bot/unslave/response";
45
+ status: "failed";
46
+ reason: "unauthorized";
86
47
  }
87
48
  | {
88
- command: "account/register/response";
49
+ messageId: string;
50
+ commandId: "bot/unslave/response";
89
51
  status: "failed";
90
- reason:
91
- | "email_taken"
92
- | "username_taken"
93
- | "invalid_email"
94
- | "weak_password"
95
- | "username_profanity"
96
- | "internal_error"
97
- | "unauthorized"
98
- | "invalid_command";
52
+ reason: "invalid_command";
99
53
  };
100
- export type AccountRenameResponse =
54
+ export type GameLaunchResponse =
101
55
  | {
102
- command: "account/rename/response";
56
+ messageId: string;
57
+ commandId: "game/launch/response";
103
58
  status: "success";
59
+ data: {
60
+ script: string;
61
+ };
104
62
  }
105
63
  | {
106
- command: "account/rename/response";
64
+ messageId: string;
65
+ commandId: "game/launch/response";
107
66
  status: "failed";
108
- reason: "username_taken" | "username_profanity" | "internal_error" | "unauthorized" | "invalid_command";
109
- };
110
- export type BotSlaveResponse =
67
+ reason: "internal_error";
68
+ }
111
69
  | {
112
- command: "bot/slave/response";
113
- status: "success";
70
+ messageId: string;
71
+ commandId: "game/launch/response";
72
+ status: "failed";
73
+ reason: "unauthorized";
114
74
  }
115
75
  | {
116
- command: "bot/slave/response";
76
+ messageId: string;
77
+ commandId: "game/launch/response";
117
78
  status: "failed";
118
- reason: "internal_error" | "unauthorized" | "invalid_command";
79
+ reason: "invalid_command";
119
80
  };
120
- export type BotUnslaveResponse =
81
+ export type LobbyCloseResponse =
121
82
  | {
122
- command: "bot/unslave/response";
83
+ messageId: string;
84
+ commandId: "lobby/close/response";
123
85
  status: "success";
124
86
  }
125
87
  | {
126
- command: "bot/unslave/response";
88
+ messageId: string;
89
+ commandId: "lobby/close/response";
127
90
  status: "failed";
128
- reason: "internal_error" | "unauthorized" | "invalid_command";
129
- };
130
- export type GameLaunchResponse =
91
+ reason: "internal_error";
92
+ }
131
93
  | {
132
- command: "game/launch/response";
133
- status: "success";
134
- data: {
135
- script: string;
136
- };
94
+ messageId: string;
95
+ commandId: "lobby/close/response";
96
+ status: "failed";
97
+ reason: "unauthorized";
137
98
  }
138
99
  | {
139
- command: "game/launch/response";
100
+ messageId: string;
101
+ commandId: "lobby/close/response";
140
102
  status: "failed";
141
- reason: "internal_error" | "unauthorized" | "invalid_command";
103
+ reason: "invalid_command";
142
104
  };
143
- export type LobbyCloseResponse =
105
+ export type LobbyCreateResponse =
144
106
  | {
145
- command: "lobby/close/response";
107
+ messageId: string;
108
+ commandId: "lobby/create/response";
146
109
  status: "success";
147
110
  }
148
111
  | {
149
- command: "lobby/close/response";
112
+ messageId: string;
113
+ commandId: "lobby/create/response";
150
114
  status: "failed";
151
- reason: "internal_error" | "unauthorized" | "invalid_command";
152
- };
153
- export type LobbyCreateResponse =
115
+ reason: "no_hosts_available";
116
+ }
154
117
  | {
155
- command: "lobby/create/response";
156
- status: "success";
118
+ messageId: string;
119
+ commandId: "lobby/create/response";
120
+ status: "failed";
121
+ reason: "invalid_region";
122
+ }
123
+ | {
124
+ messageId: string;
125
+ commandId: "lobby/create/response";
126
+ status: "failed";
127
+ reason: "internal_error";
128
+ }
129
+ | {
130
+ messageId: string;
131
+ commandId: "lobby/create/response";
132
+ status: "failed";
133
+ reason: "unauthorized";
157
134
  }
158
135
  | {
159
- command: "lobby/create/response";
136
+ messageId: string;
137
+ commandId: "lobby/create/response";
160
138
  status: "failed";
161
- reason: "no_hosts_available" | "invalid_region" | "internal_error" | "unauthorized" | "invalid_command";
139
+ reason: "invalid_command";
162
140
  };
163
141
  export type LobbyJoinResponse =
164
142
  | {
165
- command: "lobby/join/response";
143
+ messageId: string;
144
+ commandId: "lobby/join/response";
166
145
  status: "success";
167
146
  }
168
147
  | {
169
- command: "lobby/join/response";
148
+ messageId: string;
149
+ commandId: "lobby/join/response";
150
+ status: "failed";
151
+ reason: "locked";
152
+ }
153
+ | {
154
+ messageId: string;
155
+ commandId: "lobby/join/response";
156
+ status: "failed";
157
+ reason: "requires_password";
158
+ }
159
+ | {
160
+ messageId: string;
161
+ commandId: "lobby/join/response";
162
+ status: "failed";
163
+ reason: "invalid_password";
164
+ }
165
+ | {
166
+ messageId: string;
167
+ commandId: "lobby/join/response";
168
+ status: "failed";
169
+ reason: "max_participants_reached";
170
+ }
171
+ | {
172
+ messageId: string;
173
+ commandId: "lobby/join/response";
174
+ status: "failed";
175
+ reason: "rank_too_low";
176
+ }
177
+ | {
178
+ messageId: string;
179
+ commandId: "lobby/join/response";
180
+ status: "failed";
181
+ reason: "rank_too_high";
182
+ }
183
+ | {
184
+ messageId: string;
185
+ commandId: "lobby/join/response";
186
+ status: "failed";
187
+ reason: "banned";
188
+ }
189
+ | {
190
+ messageId: string;
191
+ commandId: "lobby/join/response";
192
+ status: "failed";
193
+ reason: "internal_error";
194
+ }
195
+ | {
196
+ messageId: string;
197
+ commandId: "lobby/join/response";
198
+ status: "failed";
199
+ reason: "unauthorized";
200
+ }
201
+ | {
202
+ messageId: string;
203
+ commandId: "lobby/join/response";
170
204
  status: "failed";
171
- reason:
172
- | "locked"
173
- | "requires_password"
174
- | "invalid_password"
175
- | "max_participants_reached"
176
- | "rank_too_low"
177
- | "rank_too_high"
178
- | "banned"
179
- | "internal_error"
180
- | "unauthorized"
181
- | "invalid_command";
205
+ reason: "invalid_command";
182
206
  };
183
207
  export type LobbyJoinedResponse =
184
208
  | {
185
- command: "lobby/joined/response";
209
+ messageId: string;
210
+ commandId: "lobby/joined/response";
186
211
  status: "success";
187
212
  data: {
188
213
  id: number;
@@ -216,33 +241,81 @@ export type LobbyJoinedResponse =
216
241
  };
217
242
  }
218
243
  | {
219
- command: "lobby/joined/response";
244
+ messageId: string;
245
+ commandId: "lobby/joined/response";
246
+ status: "failed";
247
+ reason: "internal_error";
248
+ }
249
+ | {
250
+ messageId: string;
251
+ commandId: "lobby/joined/response";
220
252
  status: "failed";
221
- reason: "internal_error" | "unauthorized" | "invalid_command";
253
+ reason: "unauthorized";
254
+ }
255
+ | {
256
+ messageId: string;
257
+ commandId: "lobby/joined/response";
258
+ status: "failed";
259
+ reason: "invalid_command";
222
260
  };
223
261
  export type LobbyLeaveResponse =
224
262
  | {
225
- command: "lobby/leave/response";
263
+ messageId: string;
264
+ commandId: "lobby/leave/response";
226
265
  status: "success";
227
266
  }
228
267
  | {
229
- command: "lobby/leave/response";
268
+ messageId: string;
269
+ commandId: "lobby/leave/response";
230
270
  status: "failed";
231
- reason: "no_lobby" | "internal_error" | "unauthorized" | "invalid_command";
271
+ reason: "no_lobby";
272
+ }
273
+ | {
274
+ messageId: string;
275
+ commandId: "lobby/leave/response";
276
+ status: "failed";
277
+ reason: "internal_error";
278
+ }
279
+ | {
280
+ messageId: string;
281
+ commandId: "lobby/leave/response";
282
+ status: "failed";
283
+ reason: "unauthorized";
284
+ }
285
+ | {
286
+ messageId: string;
287
+ commandId: "lobby/leave/response";
288
+ status: "failed";
289
+ reason: "invalid_command";
232
290
  };
233
291
  export type LobbyLeftResponse =
234
292
  | {
235
- command: "lobby/left/response";
293
+ messageId: string;
294
+ commandId: "lobby/left/response";
236
295
  status: "success";
237
296
  }
238
297
  | {
239
- command: "lobby/left/response";
298
+ messageId: string;
299
+ commandId: "lobby/left/response";
300
+ status: "failed";
301
+ reason: "internal_error";
302
+ }
303
+ | {
304
+ messageId: string;
305
+ commandId: "lobby/left/response";
240
306
  status: "failed";
241
- reason: "internal_error" | "unauthorized" | "invalid_command";
307
+ reason: "unauthorized";
308
+ }
309
+ | {
310
+ messageId: string;
311
+ commandId: "lobby/left/response";
312
+ status: "failed";
313
+ reason: "invalid_command";
242
314
  };
243
315
  export type LobbyListResponse =
244
316
  | {
245
- command: "lobby/list/response";
317
+ messageId: string;
318
+ commandId: "lobby/list/response";
246
319
  status: "success";
247
320
  data: {
248
321
  lobbies: {
@@ -278,13 +351,27 @@ export type LobbyListResponse =
278
351
  };
279
352
  }
280
353
  | {
281
- command: "lobby/list/response";
354
+ messageId: string;
355
+ commandId: "lobby/list/response";
282
356
  status: "failed";
283
- reason: "internal_error" | "unauthorized" | "invalid_command";
357
+ reason: "internal_error";
358
+ }
359
+ | {
360
+ messageId: string;
361
+ commandId: "lobby/list/response";
362
+ status: "failed";
363
+ reason: "unauthorized";
364
+ }
365
+ | {
366
+ messageId: string;
367
+ commandId: "lobby/list/response";
368
+ status: "failed";
369
+ reason: "invalid_command";
284
370
  };
285
371
  export type LobbyReceiveMessageResponse =
286
372
  | {
287
- command: "lobby/receiveMessage/response";
373
+ messageId: string;
374
+ commandId: "lobby/receiveMessage/response";
288
375
  status: "success";
289
376
  data: {
290
377
  userId: number;
@@ -292,23 +379,63 @@ export type LobbyReceiveMessageResponse =
292
379
  };
293
380
  }
294
381
  | {
295
- command: "lobby/receiveMessage/response";
382
+ messageId: string;
383
+ commandId: "lobby/receiveMessage/response";
384
+ status: "failed";
385
+ reason: "internal_error";
386
+ }
387
+ | {
388
+ messageId: string;
389
+ commandId: "lobby/receiveMessage/response";
390
+ status: "failed";
391
+ reason: "unauthorized";
392
+ }
393
+ | {
394
+ messageId: string;
395
+ commandId: "lobby/receiveMessage/response";
296
396
  status: "failed";
297
- reason: "internal_error" | "unauthorized" | "invalid_command";
397
+ reason: "invalid_command";
298
398
  };
299
399
  export type LobbySendMessageResponse =
300
400
  | {
301
- command: "lobby/sendMessage/response";
401
+ messageId: string;
402
+ commandId: "lobby/sendMessage/response";
302
403
  status: "success";
303
404
  }
304
405
  | {
305
- command: "lobby/sendMessage/response";
406
+ messageId: string;
407
+ commandId: "lobby/sendMessage/response";
408
+ status: "failed";
409
+ reason: "not_in_lobby";
410
+ }
411
+ | {
412
+ messageId: string;
413
+ commandId: "lobby/sendMessage/response";
414
+ status: "failed";
415
+ reason: "muted";
416
+ }
417
+ | {
418
+ messageId: string;
419
+ commandId: "lobby/sendMessage/response";
306
420
  status: "failed";
307
- reason: "not_in_lobby" | "muted" | "internal_error" | "unauthorized" | "invalid_command";
421
+ reason: "internal_error";
422
+ }
423
+ | {
424
+ messageId: string;
425
+ commandId: "lobby/sendMessage/response";
426
+ status: "failed";
427
+ reason: "unauthorized";
428
+ }
429
+ | {
430
+ messageId: string;
431
+ commandId: "lobby/sendMessage/response";
432
+ status: "failed";
433
+ reason: "invalid_command";
308
434
  };
309
435
  export type LobbyUpdatedResponse =
310
436
  | {
311
- command: "lobby/updated/response";
437
+ messageId: string;
438
+ commandId: "lobby/updated/response";
312
439
  status: "success";
313
440
  data: {
314
441
  id?: number;
@@ -342,36 +469,84 @@ export type LobbyUpdatedResponse =
342
469
  };
343
470
  }
344
471
  | {
345
- command: "lobby/updated/response";
472
+ messageId: string;
473
+ commandId: "lobby/updated/response";
346
474
  status: "failed";
347
- reason: "internal_error" | "unauthorized" | "invalid_command";
475
+ reason: "internal_error";
476
+ }
477
+ | {
478
+ messageId: string;
479
+ commandId: "lobby/updated/response";
480
+ status: "failed";
481
+ reason: "unauthorized";
482
+ }
483
+ | {
484
+ messageId: string;
485
+ commandId: "lobby/updated/response";
486
+ status: "failed";
487
+ reason: "invalid_command";
348
488
  };
349
489
  export type MatchmakingCancelResponse =
350
490
  | {
351
- command: "matchmaking/cancel/response";
491
+ messageId: string;
492
+ commandId: "matchmaking/cancel/response";
352
493
  status: "success";
353
494
  }
354
495
  | {
355
- command: "matchmaking/cancel/response";
496
+ messageId: string;
497
+ commandId: "matchmaking/cancel/response";
498
+ status: "failed";
499
+ reason: "not_queued";
500
+ }
501
+ | {
502
+ messageId: string;
503
+ commandId: "matchmaking/cancel/response";
356
504
  status: "failed";
357
- reason: "not_queued" | "internal_error" | "unauthorized" | "invalid_command";
505
+ reason: "internal_error";
506
+ }
507
+ | {
508
+ messageId: string;
509
+ commandId: "matchmaking/cancel/response";
510
+ status: "failed";
511
+ reason: "unauthorized";
512
+ }
513
+ | {
514
+ messageId: string;
515
+ commandId: "matchmaking/cancel/response";
516
+ status: "failed";
517
+ reason: "invalid_command";
358
518
  };
359
519
  export type MatchmakingFoundResponse =
360
520
  | {
361
- command: "matchmaking/found/response";
521
+ messageId: string;
522
+ commandId: "matchmaking/found/response";
362
523
  status: "success";
363
524
  data: {
364
525
  queueId: string;
365
526
  };
366
527
  }
367
528
  | {
368
- command: "matchmaking/found/response";
529
+ messageId: string;
530
+ commandId: "matchmaking/found/response";
369
531
  status: "failed";
370
- reason: "internal_error" | "unauthorized" | "invalid_command";
532
+ reason: "internal_error";
533
+ }
534
+ | {
535
+ messageId: string;
536
+ commandId: "matchmaking/found/response";
537
+ status: "failed";
538
+ reason: "unauthorized";
539
+ }
540
+ | {
541
+ messageId: string;
542
+ commandId: "matchmaking/found/response";
543
+ status: "failed";
544
+ reason: "invalid_command";
371
545
  };
372
546
  export type MatchmakingListResponse =
373
547
  | {
374
- command: "matchmaking/list/response";
548
+ messageId: string;
549
+ commandId: "matchmaking/list/response";
375
550
  status: "success";
376
551
  data: {
377
552
  queues: {
@@ -382,56 +557,144 @@ export type MatchmakingListResponse =
382
557
  };
383
558
  }
384
559
  | {
385
- command: "matchmaking/list/response";
560
+ messageId: string;
561
+ commandId: "matchmaking/list/response";
562
+ status: "failed";
563
+ reason: "internal_error";
564
+ }
565
+ | {
566
+ messageId: string;
567
+ commandId: "matchmaking/list/response";
386
568
  status: "failed";
387
- reason: "internal_error" | "unauthorized" | "invalid_command";
569
+ reason: "unauthorized";
570
+ }
571
+ | {
572
+ messageId: string;
573
+ commandId: "matchmaking/list/response";
574
+ status: "failed";
575
+ reason: "invalid_command";
388
576
  };
389
577
  export type MatchmakingLostResponse =
390
578
  | {
391
- command: "matchmaking/lost/response";
579
+ messageId: string;
580
+ commandId: "matchmaking/lost/response";
392
581
  status: "success";
393
582
  }
394
583
  | {
395
- command: "matchmaking/lost/response";
584
+ messageId: string;
585
+ commandId: "matchmaking/lost/response";
586
+ status: "failed";
587
+ reason: "internal_error";
588
+ }
589
+ | {
590
+ messageId: string;
591
+ commandId: "matchmaking/lost/response";
396
592
  status: "failed";
397
- reason: "internal_error" | "unauthorized" | "invalid_command";
593
+ reason: "unauthorized";
594
+ }
595
+ | {
596
+ messageId: string;
597
+ commandId: "matchmaking/lost/response";
598
+ status: "failed";
599
+ reason: "invalid_command";
398
600
  };
399
601
  export type MatchmakingQueueResponse =
400
602
  | {
401
- command: "matchmaking/queue/response";
603
+ messageId: string;
604
+ commandId: "matchmaking/queue/response";
402
605
  status: "success";
403
606
  }
404
607
  | {
405
- command: "matchmaking/queue/response";
608
+ messageId: string;
609
+ commandId: "matchmaking/queue/response";
610
+ status: "failed";
611
+ reason: "invalid_queue_specified";
612
+ }
613
+ | {
614
+ messageId: string;
615
+ commandId: "matchmaking/queue/response";
616
+ status: "failed";
617
+ reason: "already_ingame";
618
+ }
619
+ | {
620
+ messageId: string;
621
+ commandId: "matchmaking/queue/response";
406
622
  status: "failed";
407
- reason: "invalid_queue_specified" | "already_ingame" | "internal_error" | "unauthorized" | "invalid_command";
623
+ reason: "internal_error";
624
+ }
625
+ | {
626
+ messageId: string;
627
+ commandId: "matchmaking/queue/response";
628
+ status: "failed";
629
+ reason: "unauthorized";
630
+ }
631
+ | {
632
+ messageId: string;
633
+ commandId: "matchmaking/queue/response";
634
+ status: "failed";
635
+ reason: "invalid_command";
408
636
  };
409
637
  export type MatchmakingQueueUpdateResponse =
410
638
  | {
411
- command: "matchmaking/queueUpdate/response";
639
+ messageId: string;
640
+ commandId: "matchmaking/queueUpdate/response";
412
641
  status: "success";
413
642
  data: {
414
643
  playersQueued: number;
415
644
  };
416
645
  }
417
646
  | {
418
- command: "matchmaking/queueUpdate/response";
647
+ messageId: string;
648
+ commandId: "matchmaking/queueUpdate/response";
649
+ status: "failed";
650
+ reason: "internal_error";
651
+ }
652
+ | {
653
+ messageId: string;
654
+ commandId: "matchmaking/queueUpdate/response";
419
655
  status: "failed";
420
- reason: "internal_error" | "unauthorized" | "invalid_command";
656
+ reason: "unauthorized";
657
+ }
658
+ | {
659
+ messageId: string;
660
+ commandId: "matchmaking/queueUpdate/response";
661
+ status: "failed";
662
+ reason: "invalid_command";
421
663
  };
422
664
  export type MatchmakingReadyResponse =
423
665
  | {
424
- command: "matchmaking/ready/response";
666
+ messageId: string;
667
+ commandId: "matchmaking/ready/response";
425
668
  status: "success";
426
669
  }
427
670
  | {
428
- command: "matchmaking/ready/response";
671
+ messageId: string;
672
+ commandId: "matchmaking/ready/response";
673
+ status: "failed";
674
+ reason: "no_match";
675
+ }
676
+ | {
677
+ messageId: string;
678
+ commandId: "matchmaking/ready/response";
679
+ status: "failed";
680
+ reason: "internal_error";
681
+ }
682
+ | {
683
+ messageId: string;
684
+ commandId: "matchmaking/ready/response";
429
685
  status: "failed";
430
- reason: "no_match" | "internal_error" | "unauthorized" | "invalid_command";
686
+ reason: "unauthorized";
687
+ }
688
+ | {
689
+ messageId: string;
690
+ commandId: "matchmaking/ready/response";
691
+ status: "failed";
692
+ reason: "invalid_command";
431
693
  };
432
694
  export type MatchmakingReadyUpdateResponse =
433
695
  | {
434
- command: "matchmaking/readyUpdate/response";
696
+ messageId: string;
697
+ commandId: "matchmaking/readyUpdate/response";
435
698
  status: "success";
436
699
  data: {
437
700
  readyMax: number;
@@ -439,75 +702,77 @@ export type MatchmakingReadyUpdateResponse =
439
702
  };
440
703
  }
441
704
  | {
442
- command: "matchmaking/readyUpdate/response";
705
+ messageId: string;
706
+ commandId: "matchmaking/readyUpdate/response";
443
707
  status: "failed";
444
- reason: "internal_error" | "unauthorized" | "invalid_command";
708
+ reason: "internal_error";
709
+ }
710
+ | {
711
+ messageId: string;
712
+ commandId: "matchmaking/readyUpdate/response";
713
+ status: "failed";
714
+ reason: "unauthorized";
715
+ }
716
+ | {
717
+ messageId: string;
718
+ commandId: "matchmaking/readyUpdate/response";
719
+ status: "failed";
720
+ reason: "invalid_command";
445
721
  };
446
722
  export type SystemDisconnectedResponse =
447
723
  | {
448
- command: "system/disconnected/response";
724
+ messageId: string;
725
+ commandId: "system/disconnected/response";
449
726
  status: "success";
450
727
  }
451
728
  | {
452
- command: "system/disconnected/response";
729
+ messageId: string;
730
+ commandId: "system/disconnected/response";
731
+ status: "failed";
732
+ reason: "internal_error";
733
+ }
734
+ | {
735
+ messageId: string;
736
+ commandId: "system/disconnected/response";
737
+ status: "failed";
738
+ reason: "unauthorized";
739
+ }
740
+ | {
741
+ messageId: string;
742
+ commandId: "system/disconnected/response";
453
743
  status: "failed";
454
- reason: "internal_error" | "unauthorized" | "invalid_command";
744
+ reason: "invalid_command";
455
745
  };
456
746
  export type SystemVersionResponse =
457
747
  | {
458
- command: "system/version/response";
748
+ messageId: string;
749
+ commandId: "system/version/response";
459
750
  status: "success";
460
751
  data: {
461
- tachyonVersion: "0.1.11";
752
+ tachyonVersion: "0.2.0";
462
753
  versionParity: "major_mismatch" | "minor_mismatch" | "patch_mismatch" | "match" | "unknown";
463
754
  };
464
755
  }
465
756
  | {
466
- command: "system/version/response";
757
+ messageId: string;
758
+ commandId: "system/version/response";
467
759
  status: "failed";
468
- reason: "internal_error" | "unauthorized" | "invalid_command";
760
+ reason: "internal_error";
761
+ }
762
+ | {
763
+ messageId: string;
764
+ commandId: "system/version/response";
765
+ status: "failed";
766
+ reason: "unauthorized";
767
+ }
768
+ | {
769
+ messageId: string;
770
+ commandId: "system/version/response";
771
+ status: "failed";
772
+ reason: "invalid_command";
469
773
  };
470
774
 
471
775
  export interface Tachyon {
472
- account: {
473
- /**
474
- * Get an authentication token used for [login](#login).
475
- */
476
- getToken: {
477
- request: AccountGetTokenRequest;
478
- response: AccountGetTokenResponse;
479
- };
480
- /**
481
- * Login using an authentication token from [getToken](#gettoken).
482
- */
483
- login: {
484
- request: AccountLoginRequest;
485
- response: AccountLoginResponse;
486
- };
487
- /**
488
- * Should reset the password for the connected user and send it to the associated email address
489
- */
490
- recover: {
491
- request: AccountRecoverRequest;
492
- response: AccountRecoverResponse;
493
- };
494
- /**
495
- * Registers a new account. The user's password should be hashed twice, once on the client (md5), then again on the server (something stronger) before being stored.
496
- *
497
- * The server implementation may wish to verify the account by sending a verification link to the email address. `hashedPassword` implies that the user's password should be hashed twice, once on the client-side, and then again on the server. Doing this ensures even the server can never know the user's plaintext password.
498
- */
499
- register: {
500
- request: AccountRegisterRequest;
501
- response: AccountRegisterResponse;
502
- };
503
- /**
504
- * Change username for the current user.
505
- */
506
- rename: {
507
- request: AccountRenameRequest;
508
- response: AccountRenameResponse;
509
- };
510
- };
511
776
  bot: {
512
777
  /**
513
778
  * Registers the client as slavable by the master server to be used for hosting dedicated lobbies or matchmaking.
@@ -662,7 +927,7 @@ export interface Tachyon {
662
927
  request: SystemDisconnectRequest;
663
928
  };
664
929
  /**
665
- * Sent when the server terminates the WebSocket connection with the client for any reason. The only time the `success` response should be sent is if the client asked to be disconnected using a [disconnect](#disconnect) request.
930
+ * Sent when the server terminates the WebSocket connection with the client.
666
931
  */
667
932
  disconnected: {
668
933
  response: SystemDisconnectedResponse;
@@ -677,62 +942,24 @@ export interface Tachyon {
677
942
  };
678
943
  };
679
944
  }
680
- export interface AccountGetTokenRequest {
681
- command: "account/getToken/request";
682
- data: (
683
- | {
684
- email: string;
685
- }
686
- | {
687
- username: string;
688
- }
689
- ) & {
690
- /**
691
- * md5 hash of the user's password input
692
- */
693
- hashedPassword: string;
694
- };
695
- }
696
- export interface AccountLoginRequest {
697
- command: "account/login/request";
698
- data: {
699
- token: string;
700
- };
701
- }
702
- export interface AccountRecoverRequest {
703
- command: "account/recover/request";
704
- }
705
- export interface AccountRegisterRequest {
706
- command: "account/register/request";
707
- data: {
708
- email: string;
709
- username: string;
710
- /**
711
- * md5 hash of the user's password input
712
- */
713
- hashedPassword: string;
714
- };
715
- }
716
- export interface AccountRenameRequest {
717
- command: "account/rename/request";
718
- data: {
719
- newUsername: string;
720
- };
721
- }
722
945
  export interface BotSlaveRequest {
723
- command: "bot/slave/request";
946
+ messageId: string;
947
+ commandId: "bot/slave/request";
724
948
  data: {
725
949
  maxBattles: number;
726
950
  };
727
951
  }
728
952
  export interface BotUnslaveRequest {
729
- command: "bot/unslave/request";
953
+ messageId: string;
954
+ commandId: "bot/unslave/request";
730
955
  }
731
956
  export interface LobbyCloseRequest {
732
- command: "lobby/close/request";
957
+ messageId: string;
958
+ commandId: "lobby/close/request";
733
959
  }
734
960
  export interface LobbyCreateRequest {
735
- command: "lobby/create/request";
961
+ messageId: string;
962
+ commandId: "lobby/create/request";
736
963
  data: {
737
964
  title: string;
738
965
  private: boolean;
@@ -741,32 +968,39 @@ export interface LobbyCreateRequest {
741
968
  };
742
969
  }
743
970
  export interface LobbyJoinRequest {
744
- command: "lobby/join/request";
971
+ messageId: string;
972
+ commandId: "lobby/join/request";
745
973
  data: {
746
974
  lobbyId: number;
747
975
  password?: string;
748
976
  };
749
977
  }
750
978
  export interface LobbyLeaveRequest {
751
- command: "lobby/leave/request";
979
+ messageId: string;
980
+ commandId: "lobby/leave/request";
752
981
  }
753
982
  export interface LobbyListRequest {
754
- command: "lobby/list/request";
983
+ messageId: string;
984
+ commandId: "lobby/list/request";
755
985
  }
756
986
  export interface LobbySendMessageRequest {
757
- command: "lobby/sendMessage/request";
987
+ messageId: string;
988
+ commandId: "lobby/sendMessage/request";
758
989
  data: {
759
990
  message: string;
760
991
  };
761
992
  }
762
993
  export interface MatchmakingCancelRequest {
763
- command: "matchmaking/cancel/request";
994
+ messageId: string;
995
+ commandId: "matchmaking/cancel/request";
764
996
  }
765
997
  export interface MatchmakingListRequest {
766
- command: "matchmaking/list/request";
998
+ messageId: string;
999
+ commandId: "matchmaking/list/request";
767
1000
  }
768
1001
  export interface MatchmakingQueueRequest {
769
- command: "matchmaking/queue/request";
1002
+ messageId: string;
1003
+ commandId: "matchmaking/queue/request";
770
1004
  data: {
771
1005
  /**
772
1006
  * @minItems 1
@@ -775,13 +1009,13 @@ export interface MatchmakingQueueRequest {
775
1009
  };
776
1010
  }
777
1011
  export interface MatchmakingReadyRequest {
778
- command: "matchmaking/ready/request";
1012
+ messageId: string;
1013
+ commandId: "matchmaking/ready/request";
779
1014
  }
780
1015
  export interface SystemDisconnectRequest {
781
- command: "system/disconnect/request";
1016
+ messageId: string;
1017
+ commandId: "system/disconnect/request";
782
1018
  }
783
- export type Username = string;
784
-
785
1019
  export type Email = string;
786
1020
 
787
1021
  export interface BattleStatus {
@@ -804,7 +1038,7 @@ export interface BattleStatus {
804
1038
 
805
1039
  export interface UserClient {
806
1040
  userId: number;
807
- username: string;
1041
+ displayName: string;
808
1042
  clanId: number | null;
809
1043
  icons: {
810
1044
  /**
@@ -835,7 +1069,7 @@ export interface UserClient {
835
1069
 
836
1070
  export interface PrivateUserClient {
837
1071
  userId: number;
838
- username: string;
1072
+ displayName: string;
839
1073
  clanId: number | null;
840
1074
  icons: {
841
1075
  /**