tachyon-protocol 0.1.12 → 0.2.1

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 +64 -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 -281
  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 -304
  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,193 +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:
71
- | "invalid_token"
72
- | "expired_token"
73
- | "unvalidated"
74
- | "banned"
75
- | "internal_error"
76
- | "unauthorized"
77
- | "invalid_command";
28
+ reason: "invalid_command";
78
29
  };
79
- export type AccountRecoverResponse =
30
+ export type BotUnslaveResponse =
80
31
  | {
81
- command: "account/recover/response";
32
+ messageId: string;
33
+ commandId: "bot/unslave/response";
82
34
  status: "success";
83
35
  }
84
36
  | {
85
- command: "account/recover/response";
37
+ messageId: string;
38
+ commandId: "bot/unslave/response";
86
39
  status: "failed";
87
- reason: "internal_error" | "unauthorized" | "invalid_command";
88
- };
89
- export type AccountRegisterResponse =
40
+ reason: "internal_error";
41
+ }
90
42
  | {
91
- command: "account/register/response";
92
- status: "success";
43
+ messageId: string;
44
+ commandId: "bot/unslave/response";
45
+ status: "failed";
46
+ reason: "unauthorized";
93
47
  }
94
48
  | {
95
- command: "account/register/response";
49
+ messageId: string;
50
+ commandId: "bot/unslave/response";
96
51
  status: "failed";
97
- reason:
98
- | "email_taken"
99
- | "username_taken"
100
- | "invalid_email"
101
- | "weak_password"
102
- | "username_profanity"
103
- | "internal_error"
104
- | "unauthorized"
105
- | "invalid_command";
52
+ reason: "invalid_command";
106
53
  };
107
- export type AccountRenameResponse =
54
+ export type GameLaunchResponse =
108
55
  | {
109
- command: "account/rename/response";
56
+ messageId: string;
57
+ commandId: "game/launch/response";
110
58
  status: "success";
59
+ data: {
60
+ script: string;
61
+ };
111
62
  }
112
63
  | {
113
- command: "account/rename/response";
64
+ messageId: string;
65
+ commandId: "game/launch/response";
114
66
  status: "failed";
115
- reason: "username_taken" | "username_profanity" | "internal_error" | "unauthorized" | "invalid_command";
116
- };
117
- export type BotSlaveResponse =
67
+ reason: "internal_error";
68
+ }
118
69
  | {
119
- command: "bot/slave/response";
120
- status: "success";
70
+ messageId: string;
71
+ commandId: "game/launch/response";
72
+ status: "failed";
73
+ reason: "unauthorized";
121
74
  }
122
75
  | {
123
- command: "bot/slave/response";
76
+ messageId: string;
77
+ commandId: "game/launch/response";
124
78
  status: "failed";
125
- reason: "internal_error" | "unauthorized" | "invalid_command";
79
+ reason: "invalid_command";
126
80
  };
127
- export type BotUnslaveResponse =
81
+ export type LobbyCloseResponse =
128
82
  | {
129
- command: "bot/unslave/response";
83
+ messageId: string;
84
+ commandId: "lobby/close/response";
130
85
  status: "success";
131
86
  }
132
87
  | {
133
- command: "bot/unslave/response";
88
+ messageId: string;
89
+ commandId: "lobby/close/response";
134
90
  status: "failed";
135
- reason: "internal_error" | "unauthorized" | "invalid_command";
136
- };
137
- export type GameLaunchResponse =
91
+ reason: "internal_error";
92
+ }
138
93
  | {
139
- command: "game/launch/response";
140
- status: "success";
141
- data: {
142
- script: string;
143
- };
94
+ messageId: string;
95
+ commandId: "lobby/close/response";
96
+ status: "failed";
97
+ reason: "unauthorized";
144
98
  }
145
99
  | {
146
- command: "game/launch/response";
100
+ messageId: string;
101
+ commandId: "lobby/close/response";
147
102
  status: "failed";
148
- reason: "internal_error" | "unauthorized" | "invalid_command";
103
+ reason: "invalid_command";
149
104
  };
150
- export type LobbyCloseResponse =
105
+ export type LobbyCreateResponse =
151
106
  | {
152
- command: "lobby/close/response";
107
+ messageId: string;
108
+ commandId: "lobby/create/response";
153
109
  status: "success";
154
110
  }
155
111
  | {
156
- command: "lobby/close/response";
112
+ messageId: string;
113
+ commandId: "lobby/create/response";
157
114
  status: "failed";
158
- reason: "internal_error" | "unauthorized" | "invalid_command";
159
- };
160
- export type LobbyCreateResponse =
115
+ reason: "no_hosts_available";
116
+ }
161
117
  | {
162
- command: "lobby/create/response";
163
- 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";
164
128
  }
165
129
  | {
166
- command: "lobby/create/response";
130
+ messageId: string;
131
+ commandId: "lobby/create/response";
167
132
  status: "failed";
168
- reason: "no_hosts_available" | "invalid_region" | "internal_error" | "unauthorized" | "invalid_command";
133
+ reason: "unauthorized";
134
+ }
135
+ | {
136
+ messageId: string;
137
+ commandId: "lobby/create/response";
138
+ status: "failed";
139
+ reason: "invalid_command";
169
140
  };
170
141
  export type LobbyJoinResponse =
171
142
  | {
172
- command: "lobby/join/response";
143
+ messageId: string;
144
+ commandId: "lobby/join/response";
173
145
  status: "success";
174
146
  }
175
147
  | {
176
- command: "lobby/join/response";
148
+ messageId: string;
149
+ commandId: "lobby/join/response";
177
150
  status: "failed";
178
- reason:
179
- | "locked"
180
- | "requires_password"
181
- | "invalid_password"
182
- | "max_participants_reached"
183
- | "rank_too_low"
184
- | "rank_too_high"
185
- | "banned"
186
- | "internal_error"
187
- | "unauthorized"
188
- | "invalid_command";
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";
204
+ status: "failed";
205
+ reason: "invalid_command";
189
206
  };
190
207
  export type LobbyJoinedResponse =
191
208
  | {
192
- command: "lobby/joined/response";
209
+ messageId: string;
210
+ commandId: "lobby/joined/response";
193
211
  status: "success";
194
212
  data: {
195
213
  id: number;
@@ -223,33 +241,81 @@ export type LobbyJoinedResponse =
223
241
  };
224
242
  }
225
243
  | {
226
- command: "lobby/joined/response";
244
+ messageId: string;
245
+ commandId: "lobby/joined/response";
227
246
  status: "failed";
228
- reason: "internal_error" | "unauthorized" | "invalid_command";
247
+ reason: "internal_error";
248
+ }
249
+ | {
250
+ messageId: string;
251
+ commandId: "lobby/joined/response";
252
+ status: "failed";
253
+ reason: "unauthorized";
254
+ }
255
+ | {
256
+ messageId: string;
257
+ commandId: "lobby/joined/response";
258
+ status: "failed";
259
+ reason: "invalid_command";
229
260
  };
230
261
  export type LobbyLeaveResponse =
231
262
  | {
232
- command: "lobby/leave/response";
263
+ messageId: string;
264
+ commandId: "lobby/leave/response";
233
265
  status: "success";
234
266
  }
235
267
  | {
236
- command: "lobby/leave/response";
268
+ messageId: string;
269
+ commandId: "lobby/leave/response";
237
270
  status: "failed";
238
- 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";
239
290
  };
240
291
  export type LobbyLeftResponse =
241
292
  | {
242
- command: "lobby/left/response";
293
+ messageId: string;
294
+ commandId: "lobby/left/response";
243
295
  status: "success";
244
296
  }
245
297
  | {
246
- command: "lobby/left/response";
298
+ messageId: string;
299
+ commandId: "lobby/left/response";
247
300
  status: "failed";
248
- reason: "internal_error" | "unauthorized" | "invalid_command";
301
+ reason: "internal_error";
302
+ }
303
+ | {
304
+ messageId: string;
305
+ commandId: "lobby/left/response";
306
+ status: "failed";
307
+ reason: "unauthorized";
308
+ }
309
+ | {
310
+ messageId: string;
311
+ commandId: "lobby/left/response";
312
+ status: "failed";
313
+ reason: "invalid_command";
249
314
  };
250
315
  export type LobbyListResponse =
251
316
  | {
252
- command: "lobby/list/response";
317
+ messageId: string;
318
+ commandId: "lobby/list/response";
253
319
  status: "success";
254
320
  data: {
255
321
  lobbies: {
@@ -285,13 +351,27 @@ export type LobbyListResponse =
285
351
  };
286
352
  }
287
353
  | {
288
- command: "lobby/list/response";
354
+ messageId: string;
355
+ commandId: "lobby/list/response";
289
356
  status: "failed";
290
- 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";
291
370
  };
292
371
  export type LobbyReceiveMessageResponse =
293
372
  | {
294
- command: "lobby/receiveMessage/response";
373
+ messageId: string;
374
+ commandId: "lobby/receiveMessage/response";
295
375
  status: "success";
296
376
  data: {
297
377
  userId: number;
@@ -299,23 +379,63 @@ export type LobbyReceiveMessageResponse =
299
379
  };
300
380
  }
301
381
  | {
302
- 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";
303
396
  status: "failed";
304
- reason: "internal_error" | "unauthorized" | "invalid_command";
397
+ reason: "invalid_command";
305
398
  };
306
399
  export type LobbySendMessageResponse =
307
400
  | {
308
- command: "lobby/sendMessage/response";
401
+ messageId: string;
402
+ commandId: "lobby/sendMessage/response";
309
403
  status: "success";
310
404
  }
311
405
  | {
312
- command: "lobby/sendMessage/response";
406
+ messageId: string;
407
+ commandId: "lobby/sendMessage/response";
313
408
  status: "failed";
314
- reason: "not_in_lobby" | "muted" | "internal_error" | "unauthorized" | "invalid_command";
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";
420
+ status: "failed";
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";
315
434
  };
316
435
  export type LobbyUpdatedResponse =
317
436
  | {
318
- command: "lobby/updated/response";
437
+ messageId: string;
438
+ commandId: "lobby/updated/response";
319
439
  status: "success";
320
440
  data: {
321
441
  id?: number;
@@ -349,36 +469,84 @@ export type LobbyUpdatedResponse =
349
469
  };
350
470
  }
351
471
  | {
352
- command: "lobby/updated/response";
472
+ messageId: string;
473
+ commandId: "lobby/updated/response";
474
+ status: "failed";
475
+ reason: "internal_error";
476
+ }
477
+ | {
478
+ messageId: string;
479
+ commandId: "lobby/updated/response";
353
480
  status: "failed";
354
- reason: "internal_error" | "unauthorized" | "invalid_command";
481
+ reason: "unauthorized";
482
+ }
483
+ | {
484
+ messageId: string;
485
+ commandId: "lobby/updated/response";
486
+ status: "failed";
487
+ reason: "invalid_command";
355
488
  };
356
489
  export type MatchmakingCancelResponse =
357
490
  | {
358
- command: "matchmaking/cancel/response";
491
+ messageId: string;
492
+ commandId: "matchmaking/cancel/response";
359
493
  status: "success";
360
494
  }
361
495
  | {
362
- 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";
504
+ status: "failed";
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";
363
516
  status: "failed";
364
- reason: "not_queued" | "internal_error" | "unauthorized" | "invalid_command";
517
+ reason: "invalid_command";
365
518
  };
366
519
  export type MatchmakingFoundResponse =
367
520
  | {
368
- command: "matchmaking/found/response";
521
+ messageId: string;
522
+ commandId: "matchmaking/found/response";
369
523
  status: "success";
370
524
  data: {
371
525
  queueId: string;
372
526
  };
373
527
  }
374
528
  | {
375
- command: "matchmaking/found/response";
529
+ messageId: string;
530
+ commandId: "matchmaking/found/response";
531
+ status: "failed";
532
+ reason: "internal_error";
533
+ }
534
+ | {
535
+ messageId: string;
536
+ commandId: "matchmaking/found/response";
376
537
  status: "failed";
377
- reason: "internal_error" | "unauthorized" | "invalid_command";
538
+ reason: "unauthorized";
539
+ }
540
+ | {
541
+ messageId: string;
542
+ commandId: "matchmaking/found/response";
543
+ status: "failed";
544
+ reason: "invalid_command";
378
545
  };
379
546
  export type MatchmakingListResponse =
380
547
  | {
381
- command: "matchmaking/list/response";
548
+ messageId: string;
549
+ commandId: "matchmaking/list/response";
382
550
  status: "success";
383
551
  data: {
384
552
  queues: {
@@ -389,56 +557,144 @@ export type MatchmakingListResponse =
389
557
  };
390
558
  }
391
559
  | {
392
- command: "matchmaking/list/response";
560
+ messageId: string;
561
+ commandId: "matchmaking/list/response";
393
562
  status: "failed";
394
- reason: "internal_error" | "unauthorized" | "invalid_command";
563
+ reason: "internal_error";
564
+ }
565
+ | {
566
+ messageId: string;
567
+ commandId: "matchmaking/list/response";
568
+ status: "failed";
569
+ reason: "unauthorized";
570
+ }
571
+ | {
572
+ messageId: string;
573
+ commandId: "matchmaking/list/response";
574
+ status: "failed";
575
+ reason: "invalid_command";
395
576
  };
396
577
  export type MatchmakingLostResponse =
397
578
  | {
398
- command: "matchmaking/lost/response";
579
+ messageId: string;
580
+ commandId: "matchmaking/lost/response";
399
581
  status: "success";
400
582
  }
401
583
  | {
402
- 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";
592
+ status: "failed";
593
+ reason: "unauthorized";
594
+ }
595
+ | {
596
+ messageId: string;
597
+ commandId: "matchmaking/lost/response";
403
598
  status: "failed";
404
- reason: "internal_error" | "unauthorized" | "invalid_command";
599
+ reason: "invalid_command";
405
600
  };
406
601
  export type MatchmakingQueueResponse =
407
602
  | {
408
- command: "matchmaking/queue/response";
603
+ messageId: string;
604
+ commandId: "matchmaking/queue/response";
409
605
  status: "success";
410
606
  }
411
607
  | {
412
- command: "matchmaking/queue/response";
608
+ messageId: string;
609
+ commandId: "matchmaking/queue/response";
413
610
  status: "failed";
414
- reason: "invalid_queue_specified" | "already_ingame" | "internal_error" | "unauthorized" | "invalid_command";
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";
622
+ status: "failed";
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";
415
636
  };
416
637
  export type MatchmakingQueueUpdateResponse =
417
638
  | {
418
- command: "matchmaking/queueUpdate/response";
639
+ messageId: string;
640
+ commandId: "matchmaking/queueUpdate/response";
419
641
  status: "success";
420
642
  data: {
421
643
  playersQueued: number;
422
644
  };
423
645
  }
424
646
  | {
425
- 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";
655
+ status: "failed";
656
+ reason: "unauthorized";
657
+ }
658
+ | {
659
+ messageId: string;
660
+ commandId: "matchmaking/queueUpdate/response";
426
661
  status: "failed";
427
- reason: "internal_error" | "unauthorized" | "invalid_command";
662
+ reason: "invalid_command";
428
663
  };
429
664
  export type MatchmakingReadyResponse =
430
665
  | {
431
- command: "matchmaking/ready/response";
666
+ messageId: string;
667
+ commandId: "matchmaking/ready/response";
432
668
  status: "success";
433
669
  }
434
670
  | {
435
- 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";
436
679
  status: "failed";
437
- reason: "no_match" | "internal_error" | "unauthorized" | "invalid_command";
680
+ reason: "internal_error";
681
+ }
682
+ | {
683
+ messageId: string;
684
+ commandId: "matchmaking/ready/response";
685
+ status: "failed";
686
+ reason: "unauthorized";
687
+ }
688
+ | {
689
+ messageId: string;
690
+ commandId: "matchmaking/ready/response";
691
+ status: "failed";
692
+ reason: "invalid_command";
438
693
  };
439
694
  export type MatchmakingReadyUpdateResponse =
440
695
  | {
441
- command: "matchmaking/readyUpdate/response";
696
+ messageId: string;
697
+ commandId: "matchmaking/readyUpdate/response";
442
698
  status: "success";
443
699
  data: {
444
700
  readyMax: number;
@@ -446,75 +702,77 @@ export type MatchmakingReadyUpdateResponse =
446
702
  };
447
703
  }
448
704
  | {
449
- command: "matchmaking/readyUpdate/response";
705
+ messageId: string;
706
+ commandId: "matchmaking/readyUpdate/response";
450
707
  status: "failed";
451
- 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";
452
721
  };
453
722
  export type SystemDisconnectedResponse =
454
723
  | {
455
- command: "system/disconnected/response";
724
+ messageId: string;
725
+ commandId: "system/disconnected/response";
456
726
  status: "success";
457
727
  }
458
728
  | {
459
- 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";
460
737
  status: "failed";
461
- reason: "internal_error" | "unauthorized" | "invalid_command";
738
+ reason: "unauthorized";
739
+ }
740
+ | {
741
+ messageId: string;
742
+ commandId: "system/disconnected/response";
743
+ status: "failed";
744
+ reason: "invalid_command";
462
745
  };
463
746
  export type SystemVersionResponse =
464
747
  | {
465
- command: "system/version/response";
748
+ messageId: string;
749
+ commandId: "system/version/response";
466
750
  status: "success";
467
751
  data: {
468
- tachyonVersion: "0.1.12";
752
+ tachyonVersion: "0.2.1";
469
753
  versionParity: "major_mismatch" | "minor_mismatch" | "patch_mismatch" | "match" | "unknown";
470
754
  };
471
755
  }
472
756
  | {
473
- command: "system/version/response";
757
+ messageId: string;
758
+ commandId: "system/version/response";
759
+ status: "failed";
760
+ reason: "internal_error";
761
+ }
762
+ | {
763
+ messageId: string;
764
+ commandId: "system/version/response";
474
765
  status: "failed";
475
- reason: "internal_error" | "unauthorized" | "invalid_command";
766
+ reason: "unauthorized";
767
+ }
768
+ | {
769
+ messageId: string;
770
+ commandId: "system/version/response";
771
+ status: "failed";
772
+ reason: "invalid_command";
476
773
  };
477
774
 
478
775
  export interface Tachyon {
479
- account: {
480
- /**
481
- * Get an authentication token used for [login](#login).
482
- */
483
- getToken: {
484
- request: AccountGetTokenRequest;
485
- response: AccountGetTokenResponse;
486
- };
487
- /**
488
- * Login using an authentication token from [getToken](#gettoken).
489
- */
490
- login: {
491
- request: AccountLoginRequest;
492
- response: AccountLoginResponse;
493
- };
494
- /**
495
- * Should reset the password for the connected user and send it to the associated email address
496
- */
497
- recover: {
498
- request: AccountRecoverRequest;
499
- response: AccountRecoverResponse;
500
- };
501
- /**
502
- * 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.
503
- *
504
- * 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.
505
- */
506
- register: {
507
- request: AccountRegisterRequest;
508
- response: AccountRegisterResponse;
509
- };
510
- /**
511
- * Change username for the current user.
512
- */
513
- rename: {
514
- request: AccountRenameRequest;
515
- response: AccountRenameResponse;
516
- };
517
- };
518
776
  bot: {
519
777
  /**
520
778
  * Registers the client as slavable by the master server to be used for hosting dedicated lobbies or matchmaking.
@@ -669,7 +927,7 @@ export interface Tachyon {
669
927
  request: SystemDisconnectRequest;
670
928
  };
671
929
  /**
672
- * 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.
673
931
  */
674
932
  disconnected: {
675
933
  response: SystemDisconnectedResponse;
@@ -684,62 +942,24 @@ export interface Tachyon {
684
942
  };
685
943
  };
686
944
  }
687
- export interface AccountGetTokenRequest {
688
- command: "account/getToken/request";
689
- data: (
690
- | {
691
- email: string;
692
- }
693
- | {
694
- username: string;
695
- }
696
- ) & {
697
- /**
698
- * md5 hash of the user's password input
699
- */
700
- hashedPassword: string;
701
- };
702
- }
703
- export interface AccountLoginRequest {
704
- command: "account/login/request";
705
- data: {
706
- token: string;
707
- };
708
- }
709
- export interface AccountRecoverRequest {
710
- command: "account/recover/request";
711
- }
712
- export interface AccountRegisterRequest {
713
- command: "account/register/request";
714
- data: {
715
- email: string;
716
- username: string;
717
- /**
718
- * md5 hash of the user's password input
719
- */
720
- hashedPassword: string;
721
- };
722
- }
723
- export interface AccountRenameRequest {
724
- command: "account/rename/request";
725
- data: {
726
- newUsername: string;
727
- };
728
- }
729
945
  export interface BotSlaveRequest {
730
- command: "bot/slave/request";
946
+ messageId: string;
947
+ commandId: "bot/slave/request";
731
948
  data: {
732
949
  maxBattles: number;
733
950
  };
734
951
  }
735
952
  export interface BotUnslaveRequest {
736
- command: "bot/unslave/request";
953
+ messageId: string;
954
+ commandId: "bot/unslave/request";
737
955
  }
738
956
  export interface LobbyCloseRequest {
739
- command: "lobby/close/request";
957
+ messageId: string;
958
+ commandId: "lobby/close/request";
740
959
  }
741
960
  export interface LobbyCreateRequest {
742
- command: "lobby/create/request";
961
+ messageId: string;
962
+ commandId: "lobby/create/request";
743
963
  data: {
744
964
  title: string;
745
965
  private: boolean;
@@ -748,32 +968,39 @@ export interface LobbyCreateRequest {
748
968
  };
749
969
  }
750
970
  export interface LobbyJoinRequest {
751
- command: "lobby/join/request";
971
+ messageId: string;
972
+ commandId: "lobby/join/request";
752
973
  data: {
753
974
  lobbyId: number;
754
975
  password?: string;
755
976
  };
756
977
  }
757
978
  export interface LobbyLeaveRequest {
758
- command: "lobby/leave/request";
979
+ messageId: string;
980
+ commandId: "lobby/leave/request";
759
981
  }
760
982
  export interface LobbyListRequest {
761
- command: "lobby/list/request";
983
+ messageId: string;
984
+ commandId: "lobby/list/request";
762
985
  }
763
986
  export interface LobbySendMessageRequest {
764
- command: "lobby/sendMessage/request";
987
+ messageId: string;
988
+ commandId: "lobby/sendMessage/request";
765
989
  data: {
766
990
  message: string;
767
991
  };
768
992
  }
769
993
  export interface MatchmakingCancelRequest {
770
- command: "matchmaking/cancel/request";
994
+ messageId: string;
995
+ commandId: "matchmaking/cancel/request";
771
996
  }
772
997
  export interface MatchmakingListRequest {
773
- command: "matchmaking/list/request";
998
+ messageId: string;
999
+ commandId: "matchmaking/list/request";
774
1000
  }
775
1001
  export interface MatchmakingQueueRequest {
776
- command: "matchmaking/queue/request";
1002
+ messageId: string;
1003
+ commandId: "matchmaking/queue/request";
777
1004
  data: {
778
1005
  /**
779
1006
  * @minItems 1
@@ -782,15 +1009,13 @@ export interface MatchmakingQueueRequest {
782
1009
  };
783
1010
  }
784
1011
  export interface MatchmakingReadyRequest {
785
- command: "matchmaking/ready/request";
1012
+ messageId: string;
1013
+ commandId: "matchmaking/ready/request";
786
1014
  }
787
1015
  export interface SystemDisconnectRequest {
788
- command: "system/disconnect/request";
1016
+ messageId: string;
1017
+ commandId: "system/disconnect/request";
789
1018
  }
790
- export type Username = string;
791
-
792
- export type Email = string;
793
-
794
1019
  export interface BattleStatus {
795
1020
  lobbyId: number | null;
796
1021
  inGame: boolean;
@@ -811,7 +1036,7 @@ export interface BattleStatus {
811
1036
 
812
1037
  export interface UserClient {
813
1038
  userId: number;
814
- username: string;
1039
+ displayName: string;
815
1040
  clanId: number | null;
816
1041
  icons: {
817
1042
  /**
@@ -842,7 +1067,7 @@ export interface UserClient {
842
1067
 
843
1068
  export interface PrivateUserClient {
844
1069
  userId: number;
845
- username: string;
1070
+ displayName: string;
846
1071
  clanId: number | null;
847
1072
  icons: {
848
1073
  /**
@@ -869,7 +1094,6 @@ export interface PrivateUserClient {
869
1094
  partyId: number | null;
870
1095
  muted: boolean;
871
1096
  } | null;
872
- email: string;
873
1097
  friends: number[];
874
1098
  friendRequests: number[];
875
1099
  ignores: number[];