tachyon-protocol 1.7.0 → 1.9.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.
package/dist/index.d.ts CHANGED
@@ -1,52 +1,82 @@
1
+ import { TachyonCommand } from './types.js';
2
+
1
3
  declare const tachyonMeta: {
2
- readonly version: "1.7.0";
4
+ readonly version: "1.9.0";
3
5
  readonly schema: {
4
- readonly server: {
5
- readonly request: {
6
- readonly send: readonly ["autohost/launch"];
7
- readonly receive: readonly ["autohost/slave", "autohost/unslave", "lobby/close", "lobby/create", "lobby/join", "lobby/leave", "lobby/list", "lobby/sendMessage", "lobby/subscribe", "lobby/unsubscribe", "matchmaking/cancel", "matchmaking/declined", "matchmaking/list", "matchmaking/queue", "matchmaking/ready", "system/disconnect", "system/serverStats", "user/subscribe", "user/unsubscribe"];
6
+ readonly actors: {
7
+ readonly server: {
8
+ readonly request: {
9
+ readonly send: readonly ["autohost/addPlayer", "autohost/kickPlayer", "autohost/kill", "autohost/mutePlayer", "autohost/sendCommand", "autohost/sendMessage", "autohost/specPlayers", "autohost/start", "autohost/subscribeUpdates", "battle/start"];
10
+ readonly receive: readonly ["matchmaking/cancel", "matchmaking/list", "matchmaking/queue", "matchmaking/ready", "system/disconnect", "system/serverStats"];
11
+ };
12
+ readonly response: {
13
+ readonly send: readonly ["matchmaking/cancel", "matchmaking/list", "matchmaking/queue", "matchmaking/ready", "system/disconnect", "system/serverStats"];
14
+ readonly receive: readonly ["autohost/addPlayer", "autohost/kickPlayer", "autohost/kill", "autohost/mutePlayer", "autohost/sendCommand", "autohost/sendMessage", "autohost/specPlayers", "autohost/start", "autohost/subscribeUpdates", "battle/start"];
15
+ };
16
+ readonly event: {
17
+ readonly send: readonly ["matchmaking/found", "matchmaking/foundUpdate", "matchmaking/lost", "matchmaking/queueUpdate", "matchmaking/readyUpdate", "user/updated"];
18
+ readonly receive: readonly ["autohost/status", "autohost/update"];
19
+ };
8
20
  };
9
- readonly response: {
10
- readonly send: readonly ["autohost/slave", "autohost/unslave", "lobby/close", "lobby/create", "lobby/join", "lobby/leave", "lobby/list", "lobby/sendMessage", "lobby/subscribe", "lobby/unsubscribe", "matchmaking/cancel", "matchmaking/declined", "matchmaking/list", "matchmaking/queue", "matchmaking/ready", "system/disconnect", "system/serverStats", "user/subscribe", "user/unsubscribe"];
11
- readonly receive: readonly ["autohost/launch"];
21
+ readonly user: {
22
+ readonly request: {
23
+ readonly send: readonly ["matchmaking/cancel", "matchmaking/list", "matchmaking/queue", "matchmaking/ready", "system/disconnect", "system/serverStats"];
24
+ readonly receive: readonly ["battle/start"];
25
+ };
26
+ readonly response: {
27
+ readonly send: readonly ["battle/start"];
28
+ readonly receive: readonly ["matchmaking/cancel", "matchmaking/list", "matchmaking/queue", "matchmaking/ready", "system/disconnect", "system/serverStats"];
29
+ };
30
+ readonly event: {
31
+ readonly send: readonly [];
32
+ readonly receive: readonly ["matchmaking/found", "matchmaking/foundUpdate", "matchmaking/lost", "matchmaking/queueUpdate", "matchmaking/readyUpdate", "user/updated"];
33
+ };
12
34
  };
13
- readonly event: {
14
- readonly send: readonly ["autohost/connected", "game/launch", "lobby/joined", "lobby/left", "lobby/receiveMessage", "lobby/updated", "matchmaking/found", "matchmaking/foundUpdate", "matchmaking/lost", "matchmaking/queueUpdate", "matchmaking/readyUpdate", "system/connected", "user/updated"];
15
- readonly receive: readonly [];
35
+ readonly autohost: {
36
+ readonly request: {
37
+ readonly send: readonly [];
38
+ readonly receive: readonly ["autohost/addPlayer", "autohost/kickPlayer", "autohost/kill", "autohost/mutePlayer", "autohost/sendCommand", "autohost/sendMessage", "autohost/specPlayers", "autohost/start", "autohost/subscribeUpdates"];
39
+ };
40
+ readonly response: {
41
+ readonly send: readonly ["autohost/addPlayer", "autohost/kickPlayer", "autohost/kill", "autohost/mutePlayer", "autohost/sendCommand", "autohost/sendMessage", "autohost/specPlayers", "autohost/start", "autohost/subscribeUpdates"];
42
+ readonly receive: readonly [];
43
+ };
44
+ readonly event: {
45
+ readonly send: readonly ["autohost/status", "autohost/update"];
46
+ readonly receive: readonly [];
47
+ };
16
48
  };
17
49
  };
18
- readonly user: {
19
- readonly request: {
20
- readonly send: readonly ["lobby/close", "lobby/create", "lobby/join", "lobby/leave", "lobby/list", "lobby/sendMessage", "lobby/subscribe", "lobby/unsubscribe", "matchmaking/cancel", "matchmaking/declined", "matchmaking/list", "matchmaking/queue", "matchmaking/ready", "system/disconnect", "system/serverStats", "user/subscribe", "user/unsubscribe"];
21
- readonly receive: readonly [];
22
- };
23
- readonly response: {
24
- readonly send: readonly [];
25
- readonly receive: readonly ["lobby/close", "lobby/create", "lobby/join", "lobby/leave", "lobby/list", "lobby/sendMessage", "lobby/subscribe", "lobby/unsubscribe", "matchmaking/cancel", "matchmaking/declined", "matchmaking/list", "matchmaking/queue", "matchmaking/ready", "system/disconnect", "system/serverStats", "user/subscribe", "user/unsubscribe"];
26
- };
27
- readonly event: {
28
- readonly send: readonly [];
29
- readonly receive: readonly ["game/launch", "lobby/joined", "lobby/left", "lobby/receiveMessage", "lobby/updated", "matchmaking/found", "matchmaking/foundUpdate", "matchmaking/lost", "matchmaking/queueUpdate", "matchmaking/readyUpdate", "system/connected", "user/updated"];
30
- };
50
+ readonly serviceIds: {
51
+ readonly autohost: readonly ["addPlayer", "kickPlayer", "kill", "mutePlayer", "sendCommand", "sendMessage", "specPlayers", "start", "status", "subscribeUpdates", "update"];
52
+ readonly battle: readonly ["start"];
53
+ readonly matchmaking: readonly ["cancel", "found", "foundUpdate", "list", "lost", "queue", "queueUpdate", "ready", "readyUpdate"];
54
+ readonly system: readonly ["disconnect", "serverStats"];
55
+ readonly user: readonly ["updated"];
31
56
  };
32
- readonly autohost: {
33
- readonly request: {
34
- readonly send: readonly ["autohost/slave", "autohost/unslave"];
35
- readonly receive: readonly ["autohost/launch"];
36
- };
37
- readonly response: {
38
- readonly send: readonly ["autohost/launch"];
39
- readonly receive: readonly ["autohost/slave", "autohost/unslave"];
40
- };
41
- readonly event: {
42
- readonly send: readonly [];
43
- readonly receive: readonly ["autohost/connected"];
44
- };
57
+ readonly failedReasons: {
58
+ readonly "autohost/addPlayer": readonly ["internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
59
+ readonly "autohost/kickPlayer": readonly ["internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
60
+ readonly "autohost/kill": readonly ["internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
61
+ readonly "autohost/mutePlayer": readonly ["internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
62
+ readonly "autohost/sendCommand": readonly ["internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
63
+ readonly "autohost/sendMessage": readonly ["internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
64
+ readonly "autohost/specPlayers": readonly ["internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
65
+ readonly "autohost/start": readonly ["battle_already_exists", "engine_version_not_available", "internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
66
+ readonly "autohost/subscribeUpdates": readonly ["internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
67
+ readonly "battle/start": readonly ["internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
68
+ readonly "matchmaking/cancel": readonly ["not_queued", "internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
69
+ readonly "matchmaking/list": readonly ["internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
70
+ readonly "matchmaking/queue": readonly ["invalid_queue_specified", "already_queued", "already_inbattle", "internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
71
+ readonly "matchmaking/ready": readonly ["no_match", "internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
72
+ readonly "system/disconnect": readonly ["internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
73
+ readonly "system/serverStats": readonly ["internal_error", "unauthorized", "invalid_request", "command_unimplemented"];
45
74
  };
46
75
  };
47
76
  };
77
+
48
78
  type TachyonMeta = typeof tachyonMeta.schema;
49
- type TachyonActor = keyof TachyonMeta;
79
+ type TachyonActor = keyof TachyonMeta["actors"];
50
80
  type TachyonCommandType = TachyonCommand["type"];
51
81
  type TachyonRequest = Extract<TachyonCommand, {
52
82
  type: "request";
@@ -57,7 +87,9 @@ type TachyonResponse = Extract<TachyonCommand, {
57
87
  type TachyonEvent = Extract<TachyonCommand, {
58
88
  type: "event";
59
89
  }>;
60
- type GetCommandIds<Sender extends TachyonActor = TachyonActor, Receiver extends TachyonActor = TachyonActor, Type extends TachyonCommandType = TachyonCommandType> = ExcludeEmptyArray<TachyonMeta[Sender][Type]["send"]>[number] & ExcludeEmptyArray<TachyonMeta[Receiver][Type]["receive"]>[number];
90
+ type ServiceId = keyof TachyonMeta["serviceIds"];
91
+ type EndpointId<S extends ServiceId> = ExcludeEmptyArray<TachyonMeta["serviceIds"][S]>[number];
92
+ type GetCommandIds<Sender extends TachyonActor = TachyonActor, Receiver extends TachyonActor = TachyonActor, Type extends TachyonCommandType = TachyonCommandType> = ExcludeEmptyArray<TachyonMeta["actors"][Sender][Type]["send"]>[number] & ExcludeEmptyArray<TachyonMeta["actors"][Receiver][Type]["receive"]>[number];
61
93
  type GetCommands<Sender extends TachyonActor = TachyonActor, Receiver extends TachyonActor = TachyonActor, Type extends TachyonCommandType = TachyonCommandType, CommandId extends GetCommandIds<Sender, Receiver, Type> = GetCommandIds<Sender, Receiver, Type>> = Extract<TachyonCommand, {
62
94
  type: Type;
63
95
  commandId: CommandId;
@@ -65,1941 +97,11 @@ type GetCommands<Sender extends TachyonActor = TachyonActor, Receiver extends Ta
65
97
  type GetCommandData<C extends TachyonCommand> = C extends {
66
98
  data: infer D;
67
99
  } ? D : never;
100
+ type GetFailedResponseReason<C extends GetCommandIds<TachyonActor, TachyonActor, "response">> = GetCommands<TachyonActor, TachyonActor, "response", C> & {
101
+ status: "failed";
102
+ } extends {
103
+ reason: infer R;
104
+ } ? R : never;
68
105
  type ExcludeEmptyArray<T> = T extends readonly unknown[] ? T["length"] extends 0 ? never : T : T extends unknown[] ? T["length"] extends 0 ? never : T : never;
69
106
 
70
- export { GetCommandData, GetCommandIds, GetCommands, TachyonActor, TachyonCommandType, TachyonEvent, TachyonMeta, TachyonRequest, TachyonResponse, tachyonMeta };
71
-
72
- export type TachyonCommand =
73
- | AutohostConnectedEvent
74
- | AutohostLaunchRequest
75
- | AutohostLaunchResponse
76
- | AutohostSlaveRequest
77
- | AutohostSlaveResponse
78
- | AutohostUnslaveRequest
79
- | AutohostUnslaveResponse
80
- | GameLaunchEvent
81
- | LobbyCloseRequest
82
- | LobbyCloseResponse
83
- | LobbyCreateRequest
84
- | LobbyCreateResponse
85
- | LobbyJoinRequest
86
- | LobbyJoinResponse
87
- | LobbyJoinedEvent
88
- | LobbyLeaveRequest
89
- | LobbyLeaveResponse
90
- | LobbyLeftEvent
91
- | LobbyListRequest
92
- | LobbyListResponse
93
- | LobbyReceiveMessageEvent
94
- | LobbySendMessageRequest
95
- | LobbySendMessageResponse
96
- | LobbySubscribeRequest
97
- | LobbySubscribeResponse
98
- | LobbyUnsubscribeRequest
99
- | LobbyUnsubscribeResponse
100
- | LobbyUpdatedEvent
101
- | MatchmakingCancelRequest
102
- | MatchmakingCancelResponse
103
- | MatchmakingDeclinedRequest
104
- | MatchmakingDeclinedResponse
105
- | MatchmakingFoundEvent
106
- | MatchmakingFoundUpdateEvent
107
- | MatchmakingListRequest
108
- | MatchmakingListResponse
109
- | MatchmakingLostEvent
110
- | MatchmakingQueueRequest
111
- | MatchmakingQueueResponse
112
- | MatchmakingQueueUpdateEvent
113
- | MatchmakingReadyRequest
114
- | MatchmakingReadyResponse
115
- | MatchmakingReadyUpdateEvent
116
- | SystemConnectedEvent
117
- | SystemDisconnectRequest
118
- | SystemDisconnectResponse
119
- | SystemServerStatsRequest
120
- | SystemServerStatsResponse
121
- | UserSubscribeRequest
122
- | UserSubscribeResponse
123
- | UserUnsubscribeRequest
124
- | UserUnsubscribeResponse
125
- | UserUpdatedEvent;
126
- export type AutohostLaunchResponse =
127
- | {
128
- type: "response";
129
- messageId: string;
130
- commandId: "autohost/launch";
131
- status: "success";
132
- }
133
- | {
134
- type: "response";
135
- messageId: string;
136
- commandId: "autohost/launch";
137
- status: "failed";
138
- reason: "invalid_script";
139
- }
140
- | {
141
- type: "response";
142
- messageId: string;
143
- commandId: "autohost/launch";
144
- status: "failed";
145
- reason: "server_already_running";
146
- }
147
- | {
148
- type: "response";
149
- messageId: string;
150
- commandId: "autohost/launch";
151
- status: "failed";
152
- reason: "server_failed_to_start";
153
- }
154
- | {
155
- type: "response";
156
- messageId: string;
157
- commandId: "autohost/launch";
158
- status: "failed";
159
- reason: "internal_error";
160
- }
161
- | {
162
- type: "response";
163
- messageId: string;
164
- commandId: "autohost/launch";
165
- status: "failed";
166
- reason: "unauthorized";
167
- }
168
- | {
169
- type: "response";
170
- messageId: string;
171
- commandId: "autohost/launch";
172
- status: "failed";
173
- reason: "invalid_request";
174
- }
175
- | {
176
- type: "response";
177
- messageId: string;
178
- commandId: "autohost/launch";
179
- status: "failed";
180
- reason: "command_unimplemented";
181
- };
182
- export type AutohostSlaveResponse =
183
- | {
184
- type: "response";
185
- messageId: string;
186
- commandId: "autohost/slave";
187
- status: "success";
188
- }
189
- | {
190
- type: "response";
191
- messageId: string;
192
- commandId: "autohost/slave";
193
- status: "failed";
194
- reason: "internal_error";
195
- }
196
- | {
197
- type: "response";
198
- messageId: string;
199
- commandId: "autohost/slave";
200
- status: "failed";
201
- reason: "unauthorized";
202
- }
203
- | {
204
- type: "response";
205
- messageId: string;
206
- commandId: "autohost/slave";
207
- status: "failed";
208
- reason: "invalid_request";
209
- }
210
- | {
211
- type: "response";
212
- messageId: string;
213
- commandId: "autohost/slave";
214
- status: "failed";
215
- reason: "command_unimplemented";
216
- };
217
- export type AutohostUnslaveResponse =
218
- | {
219
- type: "response";
220
- messageId: string;
221
- commandId: "autohost/unslave";
222
- status: "success";
223
- }
224
- | {
225
- type: "response";
226
- messageId: string;
227
- commandId: "autohost/unslave";
228
- status: "failed";
229
- reason: "internal_error";
230
- }
231
- | {
232
- type: "response";
233
- messageId: string;
234
- commandId: "autohost/unslave";
235
- status: "failed";
236
- reason: "unauthorized";
237
- }
238
- | {
239
- type: "response";
240
- messageId: string;
241
- commandId: "autohost/unslave";
242
- status: "failed";
243
- reason: "invalid_request";
244
- }
245
- | {
246
- type: "response";
247
- messageId: string;
248
- commandId: "autohost/unslave";
249
- status: "failed";
250
- reason: "command_unimplemented";
251
- };
252
- export type LobbyCloseResponse =
253
- | {
254
- type: "response";
255
- messageId: string;
256
- commandId: "lobby/close";
257
- status: "success";
258
- }
259
- | {
260
- type: "response";
261
- messageId: string;
262
- commandId: "lobby/close";
263
- status: "failed";
264
- reason: "internal_error";
265
- }
266
- | {
267
- type: "response";
268
- messageId: string;
269
- commandId: "lobby/close";
270
- status: "failed";
271
- reason: "unauthorized";
272
- }
273
- | {
274
- type: "response";
275
- messageId: string;
276
- commandId: "lobby/close";
277
- status: "failed";
278
- reason: "invalid_request";
279
- }
280
- | {
281
- type: "response";
282
- messageId: string;
283
- commandId: "lobby/close";
284
- status: "failed";
285
- reason: "command_unimplemented";
286
- };
287
- export type LobbyCreateResponse =
288
- | {
289
- type: "response";
290
- messageId: string;
291
- commandId: "lobby/create";
292
- status: "success";
293
- }
294
- | {
295
- type: "response";
296
- messageId: string;
297
- commandId: "lobby/create";
298
- status: "failed";
299
- reason: "no_hosts_available";
300
- }
301
- | {
302
- type: "response";
303
- messageId: string;
304
- commandId: "lobby/create";
305
- status: "failed";
306
- reason: "invalid_region";
307
- }
308
- | {
309
- type: "response";
310
- messageId: string;
311
- commandId: "lobby/create";
312
- status: "failed";
313
- reason: "internal_error";
314
- }
315
- | {
316
- type: "response";
317
- messageId: string;
318
- commandId: "lobby/create";
319
- status: "failed";
320
- reason: "unauthorized";
321
- }
322
- | {
323
- type: "response";
324
- messageId: string;
325
- commandId: "lobby/create";
326
- status: "failed";
327
- reason: "invalid_request";
328
- }
329
- | {
330
- type: "response";
331
- messageId: string;
332
- commandId: "lobby/create";
333
- status: "failed";
334
- reason: "command_unimplemented";
335
- };
336
- export type LobbyJoinResponse =
337
- | {
338
- type: "response";
339
- messageId: string;
340
- commandId: "lobby/join";
341
- status: "success";
342
- }
343
- | {
344
- type: "response";
345
- messageId: string;
346
- commandId: "lobby/join";
347
- status: "failed";
348
- reason: "locked";
349
- }
350
- | {
351
- type: "response";
352
- messageId: string;
353
- commandId: "lobby/join";
354
- status: "failed";
355
- reason: "requires_password";
356
- }
357
- | {
358
- type: "response";
359
- messageId: string;
360
- commandId: "lobby/join";
361
- status: "failed";
362
- reason: "invalid_password";
363
- }
364
- | {
365
- type: "response";
366
- messageId: string;
367
- commandId: "lobby/join";
368
- status: "failed";
369
- reason: "max_participants_reached";
370
- }
371
- | {
372
- type: "response";
373
- messageId: string;
374
- commandId: "lobby/join";
375
- status: "failed";
376
- reason: "rank_too_low";
377
- }
378
- | {
379
- type: "response";
380
- messageId: string;
381
- commandId: "lobby/join";
382
- status: "failed";
383
- reason: "rank_too_high";
384
- }
385
- | {
386
- type: "response";
387
- messageId: string;
388
- commandId: "lobby/join";
389
- status: "failed";
390
- reason: "banned";
391
- }
392
- | {
393
- type: "response";
394
- messageId: string;
395
- commandId: "lobby/join";
396
- status: "failed";
397
- reason: "internal_error";
398
- }
399
- | {
400
- type: "response";
401
- messageId: string;
402
- commandId: "lobby/join";
403
- status: "failed";
404
- reason: "unauthorized";
405
- }
406
- | {
407
- type: "response";
408
- messageId: string;
409
- commandId: "lobby/join";
410
- status: "failed";
411
- reason: "invalid_request";
412
- }
413
- | {
414
- type: "response";
415
- messageId: string;
416
- commandId: "lobby/join";
417
- status: "failed";
418
- reason: "command_unimplemented";
419
- };
420
- export type LobbyLeaveResponse =
421
- | {
422
- type: "response";
423
- messageId: string;
424
- commandId: "lobby/leave";
425
- status: "success";
426
- }
427
- | {
428
- type: "response";
429
- messageId: string;
430
- commandId: "lobby/leave";
431
- status: "failed";
432
- reason: "no_lobby";
433
- }
434
- | {
435
- type: "response";
436
- messageId: string;
437
- commandId: "lobby/leave";
438
- status: "failed";
439
- reason: "internal_error";
440
- }
441
- | {
442
- type: "response";
443
- messageId: string;
444
- commandId: "lobby/leave";
445
- status: "failed";
446
- reason: "unauthorized";
447
- }
448
- | {
449
- type: "response";
450
- messageId: string;
451
- commandId: "lobby/leave";
452
- status: "failed";
453
- reason: "invalid_request";
454
- }
455
- | {
456
- type: "response";
457
- messageId: string;
458
- commandId: "lobby/leave";
459
- status: "failed";
460
- reason: "command_unimplemented";
461
- };
462
- export type LobbyListResponse =
463
- | {
464
- type: "response";
465
- messageId: string;
466
- commandId: "lobby/list";
467
- status: "success";
468
- data: {
469
- battles: ({
470
- battleId: string;
471
- hostId: string;
472
- engine: string;
473
- game: string;
474
- map: string;
475
- startPosType: 0 | 1 | 2;
476
- startAreas: {
477
- /**
478
- * This interface was referenced by `undefined`'s JSON-Schema definition
479
- * via the `patternProperty` "^(0|[1-9][0-9]*)$".
480
- */
481
- [k: string]: {
482
- x: number;
483
- y: number;
484
- width: number;
485
- height: number;
486
- };
487
- };
488
- startTime: number | null;
489
- ip: string | null;
490
- port: number | null;
491
- scriptPassword: string | null;
492
- modOptions: {
493
- /**
494
- * This interface was referenced by `undefined`'s JSON-Schema definition
495
- * via the `patternProperty` "^(.*)$".
496
- */
497
- [k: string]: unknown;
498
- };
499
- bots: {
500
- playerId: number;
501
- teamId: number;
502
- color: string;
503
- bonus: number;
504
- inGame: boolean;
505
- isSpectator: false;
506
- isBot: true;
507
- ownerId: string;
508
- aiShortName: string;
509
- name: string;
510
- aiOptions: {
511
- /**
512
- * This interface was referenced by `undefined`'s JSON-Schema definition
513
- * via the `patternProperty` "^(.*)$".
514
- */
515
- [k: string]: unknown;
516
- };
517
- faction: string;
518
- }[];
519
- users: {
520
- userId: string;
521
- username: string;
522
- displayName: string;
523
- avatarUrl: string | null;
524
- clanId: string | null;
525
- partyId: string | null;
526
- scopes: string[];
527
- countryCode?: string;
528
- status: "offline" | "menu" | "playing" | "lobby";
529
- battleStatus:
530
- | ({
531
- battleId: string;
532
- } & (
533
- | ({
534
- playerId: number;
535
- teamId: number;
536
- color: string;
537
- bonus: number;
538
- inGame: boolean;
539
- } & {
540
- isSpectator: false;
541
- isBot: false;
542
- ready: boolean;
543
- sync: {
544
- engine: number;
545
- game: number;
546
- map: number;
547
- };
548
- })
549
- | {
550
- isSpectator: true;
551
- isBot: false;
552
- }
553
- ))
554
- | null;
555
- }[];
556
- } & {
557
- title: string;
558
- locked: boolean;
559
- passworded: boolean;
560
- bossIds: string[];
561
- joinQueueIds: string[];
562
- limits: {
563
- minTeamsize: number | null;
564
- maxTeamsize: number | null;
565
- minRating: number | null;
566
- maxRating: number | null;
567
- };
568
- })[];
569
- };
570
- }
571
- | {
572
- type: "response";
573
- messageId: string;
574
- commandId: "lobby/list";
575
- status: "failed";
576
- reason: "internal_error";
577
- }
578
- | {
579
- type: "response";
580
- messageId: string;
581
- commandId: "lobby/list";
582
- status: "failed";
583
- reason: "unauthorized";
584
- }
585
- | {
586
- type: "response";
587
- messageId: string;
588
- commandId: "lobby/list";
589
- status: "failed";
590
- reason: "invalid_request";
591
- }
592
- | {
593
- type: "response";
594
- messageId: string;
595
- commandId: "lobby/list";
596
- status: "failed";
597
- reason: "command_unimplemented";
598
- };
599
- export type LobbySendMessageResponse =
600
- | {
601
- type: "response";
602
- messageId: string;
603
- commandId: "lobby/sendMessage";
604
- status: "success";
605
- }
606
- | {
607
- type: "response";
608
- messageId: string;
609
- commandId: "lobby/sendMessage";
610
- status: "failed";
611
- reason: "not_in_lobby";
612
- }
613
- | {
614
- type: "response";
615
- messageId: string;
616
- commandId: "lobby/sendMessage";
617
- status: "failed";
618
- reason: "muted";
619
- }
620
- | {
621
- type: "response";
622
- messageId: string;
623
- commandId: "lobby/sendMessage";
624
- status: "failed";
625
- reason: "internal_error";
626
- }
627
- | {
628
- type: "response";
629
- messageId: string;
630
- commandId: "lobby/sendMessage";
631
- status: "failed";
632
- reason: "unauthorized";
633
- }
634
- | {
635
- type: "response";
636
- messageId: string;
637
- commandId: "lobby/sendMessage";
638
- status: "failed";
639
- reason: "invalid_request";
640
- }
641
- | {
642
- type: "response";
643
- messageId: string;
644
- commandId: "lobby/sendMessage";
645
- status: "failed";
646
- reason: "command_unimplemented";
647
- };
648
- export type LobbySubscribeResponse =
649
- | {
650
- type: "response";
651
- messageId: string;
652
- commandId: "lobby/subscribe";
653
- status: "success";
654
- }
655
- | {
656
- type: "response";
657
- messageId: string;
658
- commandId: "lobby/subscribe";
659
- status: "failed";
660
- reason: "internal_error";
661
- }
662
- | {
663
- type: "response";
664
- messageId: string;
665
- commandId: "lobby/subscribe";
666
- status: "failed";
667
- reason: "unauthorized";
668
- }
669
- | {
670
- type: "response";
671
- messageId: string;
672
- commandId: "lobby/subscribe";
673
- status: "failed";
674
- reason: "invalid_request";
675
- }
676
- | {
677
- type: "response";
678
- messageId: string;
679
- commandId: "lobby/subscribe";
680
- status: "failed";
681
- reason: "command_unimplemented";
682
- };
683
- export type LobbyUnsubscribeResponse =
684
- | {
685
- type: "response";
686
- messageId: string;
687
- commandId: "lobby/unsubscribe";
688
- status: "success";
689
- }
690
- | {
691
- type: "response";
692
- messageId: string;
693
- commandId: "lobby/unsubscribe";
694
- status: "failed";
695
- reason: "cannot_unsub_own_battle";
696
- }
697
- | {
698
- type: "response";
699
- messageId: string;
700
- commandId: "lobby/unsubscribe";
701
- status: "failed";
702
- reason: "internal_error";
703
- }
704
- | {
705
- type: "response";
706
- messageId: string;
707
- commandId: "lobby/unsubscribe";
708
- status: "failed";
709
- reason: "unauthorized";
710
- }
711
- | {
712
- type: "response";
713
- messageId: string;
714
- commandId: "lobby/unsubscribe";
715
- status: "failed";
716
- reason: "invalid_request";
717
- }
718
- | {
719
- type: "response";
720
- messageId: string;
721
- commandId: "lobby/unsubscribe";
722
- status: "failed";
723
- reason: "command_unimplemented";
724
- };
725
- export type MatchmakingCancelResponse =
726
- | {
727
- type: "response";
728
- messageId: string;
729
- commandId: "matchmaking/cancel";
730
- status: "success";
731
- }
732
- | {
733
- type: "response";
734
- messageId: string;
735
- commandId: "matchmaking/cancel";
736
- status: "failed";
737
- reason: "not_queued";
738
- }
739
- | {
740
- type: "response";
741
- messageId: string;
742
- commandId: "matchmaking/cancel";
743
- status: "failed";
744
- reason: "internal_error";
745
- }
746
- | {
747
- type: "response";
748
- messageId: string;
749
- commandId: "matchmaking/cancel";
750
- status: "failed";
751
- reason: "unauthorized";
752
- }
753
- | {
754
- type: "response";
755
- messageId: string;
756
- commandId: "matchmaking/cancel";
757
- status: "failed";
758
- reason: "invalid_request";
759
- }
760
- | {
761
- type: "response";
762
- messageId: string;
763
- commandId: "matchmaking/cancel";
764
- status: "failed";
765
- reason: "command_unimplemented";
766
- };
767
- export type MatchmakingDeclinedResponse =
768
- | {
769
- type: "response";
770
- messageId: string;
771
- commandId: "matchmaking/declined";
772
- status: "success";
773
- }
774
- | {
775
- type: "response";
776
- messageId: string;
777
- commandId: "matchmaking/declined";
778
- status: "failed";
779
- reason: "internal_error";
780
- }
781
- | {
782
- type: "response";
783
- messageId: string;
784
- commandId: "matchmaking/declined";
785
- status: "failed";
786
- reason: "unauthorized";
787
- }
788
- | {
789
- type: "response";
790
- messageId: string;
791
- commandId: "matchmaking/declined";
792
- status: "failed";
793
- reason: "invalid_request";
794
- }
795
- | {
796
- type: "response";
797
- messageId: string;
798
- commandId: "matchmaking/declined";
799
- status: "failed";
800
- reason: "command_unimplemented";
801
- };
802
- export type MatchmakingListResponse =
803
- | {
804
- type: "response";
805
- messageId: string;
806
- commandId: "matchmaking/list";
807
- status: "success";
808
- data: {
809
- playlists: {
810
- id: string;
811
- name: string;
812
- numOfTeams: number;
813
- teamSize: number;
814
- ranked: boolean;
815
- }[];
816
- };
817
- }
818
- | {
819
- type: "response";
820
- messageId: string;
821
- commandId: "matchmaking/list";
822
- status: "failed";
823
- reason: "internal_error";
824
- }
825
- | {
826
- type: "response";
827
- messageId: string;
828
- commandId: "matchmaking/list";
829
- status: "failed";
830
- reason: "unauthorized";
831
- }
832
- | {
833
- type: "response";
834
- messageId: string;
835
- commandId: "matchmaking/list";
836
- status: "failed";
837
- reason: "invalid_request";
838
- }
839
- | {
840
- type: "response";
841
- messageId: string;
842
- commandId: "matchmaking/list";
843
- status: "failed";
844
- reason: "command_unimplemented";
845
- };
846
- export type MatchmakingQueueResponse =
847
- | {
848
- type: "response";
849
- messageId: string;
850
- commandId: "matchmaking/queue";
851
- status: "success";
852
- }
853
- | {
854
- type: "response";
855
- messageId: string;
856
- commandId: "matchmaking/queue";
857
- status: "failed";
858
- reason: "invalid_queue_specified";
859
- }
860
- | {
861
- type: "response";
862
- messageId: string;
863
- commandId: "matchmaking/queue";
864
- status: "failed";
865
- reason: "already_queued";
866
- }
867
- | {
868
- type: "response";
869
- messageId: string;
870
- commandId: "matchmaking/queue";
871
- status: "failed";
872
- reason: "already_ingame";
873
- }
874
- | {
875
- type: "response";
876
- messageId: string;
877
- commandId: "matchmaking/queue";
878
- status: "failed";
879
- reason: "internal_error";
880
- }
881
- | {
882
- type: "response";
883
- messageId: string;
884
- commandId: "matchmaking/queue";
885
- status: "failed";
886
- reason: "unauthorized";
887
- }
888
- | {
889
- type: "response";
890
- messageId: string;
891
- commandId: "matchmaking/queue";
892
- status: "failed";
893
- reason: "invalid_request";
894
- }
895
- | {
896
- type: "response";
897
- messageId: string;
898
- commandId: "matchmaking/queue";
899
- status: "failed";
900
- reason: "command_unimplemented";
901
- };
902
- export type MatchmakingReadyResponse =
903
- | {
904
- type: "response";
905
- messageId: string;
906
- commandId: "matchmaking/ready";
907
- status: "success";
908
- }
909
- | {
910
- type: "response";
911
- messageId: string;
912
- commandId: "matchmaking/ready";
913
- status: "failed";
914
- reason: "no_match";
915
- }
916
- | {
917
- type: "response";
918
- messageId: string;
919
- commandId: "matchmaking/ready";
920
- status: "failed";
921
- reason: "internal_error";
922
- }
923
- | {
924
- type: "response";
925
- messageId: string;
926
- commandId: "matchmaking/ready";
927
- status: "failed";
928
- reason: "unauthorized";
929
- }
930
- | {
931
- type: "response";
932
- messageId: string;
933
- commandId: "matchmaking/ready";
934
- status: "failed";
935
- reason: "invalid_request";
936
- }
937
- | {
938
- type: "response";
939
- messageId: string;
940
- commandId: "matchmaking/ready";
941
- status: "failed";
942
- reason: "command_unimplemented";
943
- };
944
- export type SystemDisconnectResponse =
945
- | {
946
- type: "response";
947
- messageId: string;
948
- commandId: "system/disconnect";
949
- status: "success";
950
- }
951
- | {
952
- type: "response";
953
- messageId: string;
954
- commandId: "system/disconnect";
955
- status: "failed";
956
- reason: "internal_error";
957
- }
958
- | {
959
- type: "response";
960
- messageId: string;
961
- commandId: "system/disconnect";
962
- status: "failed";
963
- reason: "unauthorized";
964
- }
965
- | {
966
- type: "response";
967
- messageId: string;
968
- commandId: "system/disconnect";
969
- status: "failed";
970
- reason: "invalid_request";
971
- }
972
- | {
973
- type: "response";
974
- messageId: string;
975
- commandId: "system/disconnect";
976
- status: "failed";
977
- reason: "command_unimplemented";
978
- };
979
- export type SystemServerStatsResponse =
980
- | {
981
- type: "response";
982
- messageId: string;
983
- commandId: "system/serverStats";
984
- status: "success";
985
- data: {
986
- userCount: number;
987
- };
988
- }
989
- | {
990
- type: "response";
991
- messageId: string;
992
- commandId: "system/serverStats";
993
- status: "failed";
994
- reason: "internal_error";
995
- }
996
- | {
997
- type: "response";
998
- messageId: string;
999
- commandId: "system/serverStats";
1000
- status: "failed";
1001
- reason: "unauthorized";
1002
- }
1003
- | {
1004
- type: "response";
1005
- messageId: string;
1006
- commandId: "system/serverStats";
1007
- status: "failed";
1008
- reason: "invalid_request";
1009
- }
1010
- | {
1011
- type: "response";
1012
- messageId: string;
1013
- commandId: "system/serverStats";
1014
- status: "failed";
1015
- reason: "command_unimplemented";
1016
- };
1017
- export type UserSubscribeResponse =
1018
- | {
1019
- type: "response";
1020
- messageId: string;
1021
- commandId: "user/subscribe";
1022
- status: "success";
1023
- data: {
1024
- users: {
1025
- userId: string;
1026
- username: string;
1027
- displayName: string;
1028
- avatarUrl: string | null;
1029
- clanId: string | null;
1030
- partyId: string | null;
1031
- scopes: string[];
1032
- countryCode?: string;
1033
- status: "offline" | "menu" | "playing" | "lobby";
1034
- battleStatus:
1035
- | ({
1036
- battleId: string;
1037
- } & (
1038
- | ({
1039
- playerId: number;
1040
- teamId: number;
1041
- color: string;
1042
- bonus: number;
1043
- inGame: boolean;
1044
- } & {
1045
- isSpectator: false;
1046
- isBot: false;
1047
- ready: boolean;
1048
- sync: {
1049
- engine: number;
1050
- game: number;
1051
- map: number;
1052
- };
1053
- })
1054
- | {
1055
- isSpectator: true;
1056
- isBot: false;
1057
- }
1058
- ))
1059
- | null;
1060
- }[];
1061
- };
1062
- }
1063
- | {
1064
- type: "response";
1065
- messageId: string;
1066
- commandId: "user/subscribe";
1067
- status: "failed";
1068
- reason: "internal_error";
1069
- }
1070
- | {
1071
- type: "response";
1072
- messageId: string;
1073
- commandId: "user/subscribe";
1074
- status: "failed";
1075
- reason: "unauthorized";
1076
- }
1077
- | {
1078
- type: "response";
1079
- messageId: string;
1080
- commandId: "user/subscribe";
1081
- status: "failed";
1082
- reason: "invalid_request";
1083
- }
1084
- | {
1085
- type: "response";
1086
- messageId: string;
1087
- commandId: "user/subscribe";
1088
- status: "failed";
1089
- reason: "command_unimplemented";
1090
- };
1091
- export type UserUnsubscribeResponse =
1092
- | {
1093
- type: "response";
1094
- messageId: string;
1095
- commandId: "user/unsubscribe";
1096
- status: "success";
1097
- }
1098
- | {
1099
- type: "response";
1100
- messageId: string;
1101
- commandId: "user/unsubscribe";
1102
- status: "failed";
1103
- reason: "cannot_unsub_own_user";
1104
- }
1105
- | {
1106
- type: "response";
1107
- messageId: string;
1108
- commandId: "user/unsubscribe";
1109
- status: "failed";
1110
- reason: "internal_error";
1111
- }
1112
- | {
1113
- type: "response";
1114
- messageId: string;
1115
- commandId: "user/unsubscribe";
1116
- status: "failed";
1117
- reason: "unauthorized";
1118
- }
1119
- | {
1120
- type: "response";
1121
- messageId: string;
1122
- commandId: "user/unsubscribe";
1123
- status: "failed";
1124
- reason: "invalid_request";
1125
- }
1126
- | {
1127
- type: "response";
1128
- messageId: string;
1129
- commandId: "user/unsubscribe";
1130
- status: "failed";
1131
- reason: "command_unimplemented";
1132
- };
1133
-
1134
- export interface AutohostConnectedEvent {
1135
- type: "event";
1136
- messageId: string;
1137
- commandId: "autohost/connected";
1138
- data: {};
1139
- }
1140
- export interface AutohostLaunchRequest {
1141
- type: "request";
1142
- messageId: string;
1143
- commandId: "autohost/launch";
1144
- data: {
1145
- script: string;
1146
- };
1147
- }
1148
- export interface AutohostSlaveRequest {
1149
- type: "request";
1150
- messageId: string;
1151
- commandId: "autohost/slave";
1152
- data: {
1153
- maxBattles: number;
1154
- };
1155
- }
1156
- export interface AutohostUnslaveRequest {
1157
- type: "request";
1158
- messageId: string;
1159
- commandId: "autohost/unslave";
1160
- }
1161
- export interface GameLaunchEvent {
1162
- type: "event";
1163
- messageId: string;
1164
- commandId: "game/launch";
1165
- data: {
1166
- script: string;
1167
- };
1168
- }
1169
- export interface LobbyCloseRequest {
1170
- type: "request";
1171
- messageId: string;
1172
- commandId: "lobby/close";
1173
- }
1174
- export interface LobbyCreateRequest {
1175
- type: "request";
1176
- messageId: string;
1177
- commandId: "lobby/create";
1178
- data: {
1179
- title: string;
1180
- private: boolean;
1181
- region: string;
1182
- maxPlayers: number;
1183
- };
1184
- }
1185
- export interface LobbyJoinRequest {
1186
- type: "request";
1187
- messageId: string;
1188
- commandId: "lobby/join";
1189
- data: {
1190
- lobbyId: string;
1191
- password?: string;
1192
- };
1193
- }
1194
- export interface LobbyJoinedEvent {
1195
- type: "event";
1196
- messageId: string;
1197
- commandId: "lobby/joined";
1198
- data: {
1199
- battleId: string;
1200
- hostId: string;
1201
- engine: string;
1202
- game: string;
1203
- map: string;
1204
- startPosType: 0 | 1 | 2;
1205
- startAreas: {
1206
- /**
1207
- * This interface was referenced by `undefined`'s JSON-Schema definition
1208
- * via the `patternProperty` "^(0|[1-9][0-9]*)$".
1209
- */
1210
- [k: string]: {
1211
- x: number;
1212
- y: number;
1213
- width: number;
1214
- height: number;
1215
- };
1216
- };
1217
- startTime: number | null;
1218
- ip: string | null;
1219
- port: number | null;
1220
- scriptPassword: string | null;
1221
- modOptions: {
1222
- /**
1223
- * This interface was referenced by `undefined`'s JSON-Schema definition
1224
- * via the `patternProperty` "^(.*)$".
1225
- */
1226
- [k: string]: unknown;
1227
- };
1228
- bots: {
1229
- playerId: number;
1230
- teamId: number;
1231
- color: string;
1232
- bonus: number;
1233
- inGame: boolean;
1234
- isSpectator: false;
1235
- isBot: true;
1236
- ownerId: string;
1237
- aiShortName: string;
1238
- name: string;
1239
- aiOptions: {
1240
- /**
1241
- * This interface was referenced by `undefined`'s JSON-Schema definition
1242
- * via the `patternProperty` "^(.*)$".
1243
- */
1244
- [k: string]: unknown;
1245
- };
1246
- faction: string;
1247
- }[];
1248
- users: {
1249
- userId: string;
1250
- username: string;
1251
- displayName: string;
1252
- avatarUrl: string | null;
1253
- clanId: string | null;
1254
- partyId: string | null;
1255
- scopes: string[];
1256
- countryCode?: string;
1257
- status: "offline" | "menu" | "playing" | "lobby";
1258
- battleStatus:
1259
- | ({
1260
- battleId: string;
1261
- } & (
1262
- | ({
1263
- playerId: number;
1264
- teamId: number;
1265
- color: string;
1266
- bonus: number;
1267
- inGame: boolean;
1268
- } & {
1269
- isSpectator: false;
1270
- isBot: false;
1271
- ready: boolean;
1272
- sync: {
1273
- engine: number;
1274
- game: number;
1275
- map: number;
1276
- };
1277
- })
1278
- | {
1279
- isSpectator: true;
1280
- isBot: false;
1281
- }
1282
- ))
1283
- | null;
1284
- }[];
1285
- };
1286
- }
1287
- export interface LobbyLeaveRequest {
1288
- type: "request";
1289
- messageId: string;
1290
- commandId: "lobby/leave";
1291
- }
1292
- export interface LobbyLeftEvent {
1293
- type: "event";
1294
- messageId: string;
1295
- commandId: "lobby/left";
1296
- }
1297
- export interface LobbyListRequest {
1298
- type: "request";
1299
- messageId: string;
1300
- commandId: "lobby/list";
1301
- }
1302
- export interface LobbyReceiveMessageEvent {
1303
- type: "event";
1304
- messageId: string;
1305
- commandId: "lobby/receiveMessage";
1306
- data: {
1307
- userId: string;
1308
- message: string;
1309
- };
1310
- }
1311
- export interface LobbySendMessageRequest {
1312
- type: "request";
1313
- messageId: string;
1314
- commandId: "lobby/sendMessage";
1315
- data: {
1316
- message: string;
1317
- };
1318
- }
1319
- export interface LobbySubscribeRequest {
1320
- type: "request";
1321
- messageId: string;
1322
- commandId: "lobby/subscribe";
1323
- data: {
1324
- battleIds: string[];
1325
- };
1326
- }
1327
- export interface LobbyUnsubscribeRequest {
1328
- type: "request";
1329
- messageId: string;
1330
- commandId: "lobby/unsubscribe";
1331
- data: {
1332
- battleIds?: string[];
1333
- };
1334
- }
1335
- export interface LobbyUpdatedEvent {
1336
- type: "event";
1337
- messageId: string;
1338
- commandId: "lobby/updated";
1339
- data: {
1340
- battles: ({
1341
- battleId?: string;
1342
- hostId?: string;
1343
- engine?: string;
1344
- game?: string;
1345
- map?: string;
1346
- startPosType?: 0 | 1 | 2;
1347
- startAreas?: {
1348
- /**
1349
- * This interface was referenced by `undefined`'s JSON-Schema definition
1350
- * via the `patternProperty` "^(0|[1-9][0-9]*)$".
1351
- */
1352
- [k: string]: {
1353
- x: number;
1354
- y: number;
1355
- width: number;
1356
- height: number;
1357
- };
1358
- };
1359
- startTime?: number | null;
1360
- ip?: string | null;
1361
- port?: number | null;
1362
- scriptPassword?: string | null;
1363
- modOptions?: {
1364
- /**
1365
- * This interface was referenced by `undefined`'s JSON-Schema definition
1366
- * via the `patternProperty` "^(.*)$".
1367
- */
1368
- [k: string]: unknown;
1369
- };
1370
- bots?: {
1371
- playerId: number;
1372
- teamId: number;
1373
- color: string;
1374
- bonus: number;
1375
- inGame: boolean;
1376
- isSpectator: false;
1377
- isBot: true;
1378
- ownerId: string;
1379
- aiShortName: string;
1380
- name: string;
1381
- aiOptions: {
1382
- /**
1383
- * This interface was referenced by `undefined`'s JSON-Schema definition
1384
- * via the `patternProperty` "^(.*)$".
1385
- */
1386
- [k: string]: unknown;
1387
- };
1388
- faction: string;
1389
- }[];
1390
- users?: {
1391
- userId: string;
1392
- username: string;
1393
- displayName: string;
1394
- avatarUrl: string | null;
1395
- clanId: string | null;
1396
- partyId: string | null;
1397
- scopes: string[];
1398
- countryCode?: string;
1399
- status: "offline" | "menu" | "playing" | "lobby";
1400
- battleStatus:
1401
- | ({
1402
- battleId: string;
1403
- } & (
1404
- | ({
1405
- playerId: number;
1406
- teamId: number;
1407
- color: string;
1408
- bonus: number;
1409
- inGame: boolean;
1410
- } & {
1411
- isSpectator: false;
1412
- isBot: false;
1413
- ready: boolean;
1414
- sync: {
1415
- engine: number;
1416
- game: number;
1417
- map: number;
1418
- };
1419
- })
1420
- | {
1421
- isSpectator: true;
1422
- isBot: false;
1423
- }
1424
- ))
1425
- | null;
1426
- }[];
1427
- } & {
1428
- title?: string;
1429
- locked?: boolean;
1430
- passworded?: boolean;
1431
- bossIds?: string[];
1432
- joinQueueIds?: string[];
1433
- limits?: {
1434
- minTeamsize: number | null;
1435
- maxTeamsize: number | null;
1436
- minRating: number | null;
1437
- maxRating: number | null;
1438
- };
1439
- })[];
1440
- };
1441
- }
1442
- export interface MatchmakingCancelRequest {
1443
- type: "request";
1444
- messageId: string;
1445
- commandId: "matchmaking/cancel";
1446
- }
1447
- export interface MatchmakingDeclinedRequest {
1448
- type: "request";
1449
- messageId: string;
1450
- commandId: "matchmaking/declined";
1451
- }
1452
- export interface MatchmakingFoundEvent {
1453
- type: "event";
1454
- messageId: string;
1455
- commandId: "matchmaking/found";
1456
- data: {
1457
- queueId: string;
1458
- timeoutMs: number;
1459
- };
1460
- }
1461
- export interface MatchmakingFoundUpdateEvent {
1462
- type: "event";
1463
- messageId: string;
1464
- commandId: "matchmaking/foundUpdate";
1465
- data: {
1466
- readyCount: number;
1467
- };
1468
- }
1469
- export interface MatchmakingListRequest {
1470
- type: "request";
1471
- messageId: string;
1472
- commandId: "matchmaking/list";
1473
- }
1474
- export interface MatchmakingLostEvent {
1475
- type: "event";
1476
- messageId: string;
1477
- commandId: "matchmaking/lost";
1478
- }
1479
- export interface MatchmakingQueueRequest {
1480
- type: "request";
1481
- messageId: string;
1482
- commandId: "matchmaking/queue";
1483
- data: {
1484
- /**
1485
- * @minItems 1
1486
- */
1487
- queues: [string, ...string[]];
1488
- };
1489
- }
1490
- export interface MatchmakingQueueUpdateEvent {
1491
- type: "event";
1492
- messageId: string;
1493
- commandId: "matchmaking/queueUpdate";
1494
- data: {
1495
- playersQueued: string;
1496
- };
1497
- }
1498
- export interface MatchmakingReadyRequest {
1499
- type: "request";
1500
- messageId: string;
1501
- commandId: "matchmaking/ready";
1502
- }
1503
- export interface MatchmakingReadyUpdateEvent {
1504
- type: "event";
1505
- messageId: string;
1506
- commandId: "matchmaking/readyUpdate";
1507
- data: {
1508
- readyMax: number;
1509
- readyCurrent: number;
1510
- };
1511
- }
1512
- export interface SystemConnectedEvent {
1513
- type: "event";
1514
- messageId: string;
1515
- commandId: "system/connected";
1516
- data: {
1517
- userId: string;
1518
- username: string;
1519
- displayName: string;
1520
- avatarUrl: string | null;
1521
- clanId: string | null;
1522
- partyId: string | null;
1523
- scopes: string[];
1524
- countryCode?: string;
1525
- status: "offline" | "menu" | "playing" | "lobby";
1526
- battleStatus:
1527
- | ({
1528
- battleId: string;
1529
- } & (
1530
- | ({
1531
- playerId: number;
1532
- teamId: number;
1533
- color: string;
1534
- bonus: number;
1535
- inGame: boolean;
1536
- } & {
1537
- isSpectator: false;
1538
- isBot: false;
1539
- ready: boolean;
1540
- sync: {
1541
- engine: number;
1542
- game: number;
1543
- map: number;
1544
- };
1545
- })
1546
- | {
1547
- isSpectator: true;
1548
- isBot: false;
1549
- }
1550
- ))
1551
- | null;
1552
- friendIds: string[];
1553
- outgoingFriendRequestIds: string[];
1554
- incomingFriendRequestIds: string[];
1555
- ignoreIds: string[];
1556
- };
1557
- }
1558
- export interface SystemDisconnectRequest {
1559
- type: "request";
1560
- messageId: string;
1561
- commandId: "system/disconnect";
1562
- data?: {
1563
- reason: string;
1564
- };
1565
- }
1566
- export interface SystemServerStatsRequest {
1567
- type: "request";
1568
- messageId: string;
1569
- commandId: "system/serverStats";
1570
- }
1571
- export interface UserSubscribeRequest {
1572
- type: "request";
1573
- messageId: string;
1574
- commandId: "user/subscribe";
1575
- data: {
1576
- userIds: string[];
1577
- };
1578
- }
1579
- export interface UserUnsubscribeRequest {
1580
- type: "request";
1581
- messageId: string;
1582
- commandId: "user/unsubscribe";
1583
- data: {
1584
- userIds: string[];
1585
- };
1586
- }
1587
- export interface UserUpdatedEvent {
1588
- type: "event";
1589
- messageId: string;
1590
- commandId: "user/updated";
1591
- data: {
1592
- users: {
1593
- userId?: string;
1594
- username?: string;
1595
- displayName?: string;
1596
- avatarUrl?: string | null;
1597
- clanId?: string | null;
1598
- partyId?: string | null;
1599
- scopes?: string[];
1600
- countryCode?: string;
1601
- status?: "offline" | "menu" | "playing" | "lobby";
1602
- battleStatus?:
1603
- | ({
1604
- battleId: string;
1605
- } & (
1606
- | ({
1607
- playerId: number;
1608
- teamId: number;
1609
- color: string;
1610
- bonus: number;
1611
- inGame: boolean;
1612
- } & {
1613
- isSpectator: false;
1614
- isBot: false;
1615
- ready: boolean;
1616
- sync: {
1617
- engine: number;
1618
- game: number;
1619
- map: number;
1620
- };
1621
- })
1622
- | {
1623
- isSpectator: true;
1624
- isBot: false;
1625
- }
1626
- ))
1627
- | null;
1628
- friendIds?: string[];
1629
- outgoingFriendRequestIds?: string[];
1630
- incomingFriendRequestIds?: string[];
1631
- ignoreIds?: string[];
1632
- }[];
1633
- };
1634
- }
1635
- export interface TachyonAutohostStatus {
1636
- gameStartTime: number | null;
1637
- }
1638
-
1639
- export interface TachyonBattle {
1640
- battleId: string;
1641
- hostId: string;
1642
- engine: string;
1643
- game: string;
1644
- map: string;
1645
- startPosType: 0 | 1 | 2;
1646
- startAreas: {
1647
- /**
1648
- * This interface was referenced by `undefined`'s JSON-Schema definition
1649
- * via the `patternProperty` "^(0|[1-9][0-9]*)$".
1650
- */
1651
- [k: string]: {
1652
- x: number;
1653
- y: number;
1654
- width: number;
1655
- height: number;
1656
- };
1657
- };
1658
- startTime: number | null;
1659
- ip: string | null;
1660
- port: number | null;
1661
- scriptPassword: string | null;
1662
- modOptions: {
1663
- /**
1664
- * This interface was referenced by `undefined`'s JSON-Schema definition
1665
- * via the `patternProperty` "^(.*)$".
1666
- */
1667
- [k: string]: unknown;
1668
- };
1669
- bots: {
1670
- playerId: number;
1671
- teamId: number;
1672
- color: string;
1673
- bonus: number;
1674
- inGame: boolean;
1675
- isSpectator: false;
1676
- isBot: true;
1677
- ownerId: string;
1678
- aiShortName: string;
1679
- name: string;
1680
- aiOptions: {
1681
- /**
1682
- * This interface was referenced by `undefined`'s JSON-Schema definition
1683
- * via the `patternProperty` "^(.*)$".
1684
- */
1685
- [k: string]: unknown;
1686
- };
1687
- faction: string;
1688
- }[];
1689
- users: {
1690
- userId: string;
1691
- username: string;
1692
- displayName: string;
1693
- avatarUrl: string | null;
1694
- clanId: string | null;
1695
- partyId: string | null;
1696
- scopes: string[];
1697
- countryCode?: string;
1698
- status: "offline" | "menu" | "playing" | "lobby";
1699
- battleStatus:
1700
- | ({
1701
- battleId: string;
1702
- } & (
1703
- | ({
1704
- playerId: number;
1705
- teamId: number;
1706
- color: string;
1707
- bonus: number;
1708
- inGame: boolean;
1709
- } & {
1710
- isSpectator: false;
1711
- isBot: false;
1712
- ready: boolean;
1713
- sync: {
1714
- engine: number;
1715
- game: number;
1716
- map: number;
1717
- };
1718
- })
1719
- | {
1720
- isSpectator: true;
1721
- isBot: false;
1722
- }
1723
- ))
1724
- | null;
1725
- }[];
1726
- }
1727
-
1728
- export interface TachyonBattleContender {
1729
- playerId: number;
1730
- teamId: number;
1731
- color: string;
1732
- bonus: number;
1733
- inGame: boolean;
1734
- }
1735
-
1736
- export type TachyonBattlePlayer = {
1737
- playerId: number;
1738
- teamId: number;
1739
- color: string;
1740
- bonus: number;
1741
- inGame: boolean;
1742
- } & {
1743
- isSpectator: false;
1744
- isBot: false;
1745
- ready: boolean;
1746
- sync: {
1747
- engine: number;
1748
- game: number;
1749
- map: number;
1750
- };
1751
- };
1752
-
1753
- export interface TachyonBattleSpectator {
1754
- isSpectator: true;
1755
- isBot: false;
1756
- }
1757
-
1758
- export type TachyonBattleStatus =
1759
- | ({
1760
- battleId: string;
1761
- } & (
1762
- | ({
1763
- playerId: number;
1764
- teamId: number;
1765
- color: string;
1766
- bonus: number;
1767
- inGame: boolean;
1768
- } & {
1769
- isSpectator: false;
1770
- isBot: false;
1771
- ready: boolean;
1772
- sync: {
1773
- engine: number;
1774
- game: number;
1775
- map: number;
1776
- };
1777
- })
1778
- | {
1779
- isSpectator: true;
1780
- isBot: false;
1781
- }
1782
- ))
1783
- | null;
1784
-
1785
- export interface TachyonBot {
1786
- playerId: number;
1787
- teamId: number;
1788
- color: string;
1789
- bonus: number;
1790
- inGame: boolean;
1791
- isSpectator: false;
1792
- isBot: true;
1793
- ownerId: string;
1794
- aiShortName: string;
1795
- name: string;
1796
- aiOptions: {
1797
- /**
1798
- * This interface was referenced by `undefined`'s JSON-Schema definition
1799
- * via the `patternProperty` "^(.*)$".
1800
- */
1801
- [k: string]: unknown;
1802
- };
1803
- faction: string;
1804
- }
1805
-
1806
- export type TachyonCustomBattle = {
1807
- battleId: string;
1808
- hostId: string;
1809
- engine: string;
1810
- game: string;
1811
- map: string;
1812
- startPosType: 0 | 1 | 2;
1813
- startAreas: {
1814
- /**
1815
- * This interface was referenced by `undefined`'s JSON-Schema definition
1816
- * via the `patternProperty` "^(0|[1-9][0-9]*)$".
1817
- */
1818
- [k: string]: {
1819
- x: number;
1820
- y: number;
1821
- width: number;
1822
- height: number;
1823
- };
1824
- };
1825
- startTime: number | null;
1826
- ip: string | null;
1827
- port: number | null;
1828
- scriptPassword: string | null;
1829
- modOptions: {
1830
- /**
1831
- * This interface was referenced by `undefined`'s JSON-Schema definition
1832
- * via the `patternProperty` "^(.*)$".
1833
- */
1834
- [k: string]: unknown;
1835
- };
1836
- bots: {
1837
- playerId: number;
1838
- teamId: number;
1839
- color: string;
1840
- bonus: number;
1841
- inGame: boolean;
1842
- isSpectator: false;
1843
- isBot: true;
1844
- ownerId: string;
1845
- aiShortName: string;
1846
- name: string;
1847
- aiOptions: {
1848
- /**
1849
- * This interface was referenced by `undefined`'s JSON-Schema definition
1850
- * via the `patternProperty` "^(.*)$".
1851
- */
1852
- [k: string]: unknown;
1853
- };
1854
- faction: string;
1855
- }[];
1856
- users: {
1857
- userId: string;
1858
- username: string;
1859
- displayName: string;
1860
- avatarUrl: string | null;
1861
- clanId: string | null;
1862
- partyId: string | null;
1863
- scopes: string[];
1864
- countryCode?: string;
1865
- status: "offline" | "menu" | "playing" | "lobby";
1866
- battleStatus:
1867
- | ({
1868
- battleId: string;
1869
- } & (
1870
- | ({
1871
- playerId: number;
1872
- teamId: number;
1873
- color: string;
1874
- bonus: number;
1875
- inGame: boolean;
1876
- } & {
1877
- isSpectator: false;
1878
- isBot: false;
1879
- ready: boolean;
1880
- sync: {
1881
- engine: number;
1882
- game: number;
1883
- map: number;
1884
- };
1885
- })
1886
- | {
1887
- isSpectator: true;
1888
- isBot: false;
1889
- }
1890
- ))
1891
- | null;
1892
- }[];
1893
- } & {
1894
- title: string;
1895
- locked: boolean;
1896
- passworded: boolean;
1897
- bossIds: string[];
1898
- joinQueueIds: string[];
1899
- limits: {
1900
- minTeamsize: number | null;
1901
- maxTeamsize: number | null;
1902
- minRating: number | null;
1903
- maxRating: number | null;
1904
- };
1905
- };
1906
-
1907
- export interface TachyonMatchmakingPlaylist {
1908
- id: string;
1909
- name: string;
1910
- numOfTeams: number;
1911
- teamSize: number;
1912
- ranked: boolean;
1913
- }
1914
-
1915
- export interface TachyonPrivateUser {
1916
- userId: string;
1917
- username: string;
1918
- displayName: string;
1919
- avatarUrl: string | null;
1920
- clanId: string | null;
1921
- partyId: string | null;
1922
- scopes: string[];
1923
- countryCode?: string;
1924
- status: "offline" | "menu" | "playing" | "lobby";
1925
- battleStatus:
1926
- | ({
1927
- battleId: string;
1928
- } & (
1929
- | ({
1930
- playerId: number;
1931
- teamId: number;
1932
- color: string;
1933
- bonus: number;
1934
- inGame: boolean;
1935
- } & {
1936
- isSpectator: false;
1937
- isBot: false;
1938
- ready: boolean;
1939
- sync: {
1940
- engine: number;
1941
- game: number;
1942
- map: number;
1943
- };
1944
- })
1945
- | {
1946
- isSpectator: true;
1947
- isBot: false;
1948
- }
1949
- ))
1950
- | null;
1951
- friendIds: string[];
1952
- outgoingFriendRequestIds: string[];
1953
- incomingFriendRequestIds: string[];
1954
- ignoreIds: string[];
1955
- }
1956
-
1957
- export interface TachyonRect {
1958
- x: number;
1959
- y: number;
1960
- width: number;
1961
- height: number;
1962
- }
1963
-
1964
- export type TachyonUnixTime = number | null;
1965
-
1966
- export interface TachyonUser {
1967
- userId: string;
1968
- username: string;
1969
- displayName: string;
1970
- avatarUrl: string | null;
1971
- clanId: string | null;
1972
- partyId: string | null;
1973
- scopes: string[];
1974
- countryCode?: string;
1975
- status: "offline" | "menu" | "playing" | "lobby";
1976
- battleStatus:
1977
- | ({
1978
- battleId: string;
1979
- } & (
1980
- | ({
1981
- playerId: number;
1982
- teamId: number;
1983
- color: string;
1984
- bonus: number;
1985
- inGame: boolean;
1986
- } & {
1987
- isSpectator: false;
1988
- isBot: false;
1989
- ready: boolean;
1990
- sync: {
1991
- engine: number;
1992
- game: number;
1993
- map: number;
1994
- };
1995
- })
1996
- | {
1997
- isSpectator: true;
1998
- isBot: false;
1999
- }
2000
- ))
2001
- | null;
2002
- }
2003
-
2004
- export type TachyonUserStatus = "offline" | "menu" | "playing" | "lobby";
2005
-
107
+ export { type EndpointId, type GetCommandData, type GetCommandIds, type GetCommands, type GetFailedResponseReason, type ServiceId, type TachyonActor, type TachyonCommandType, type TachyonEvent, type TachyonMeta, type TachyonRequest, type TachyonResponse, tachyonMeta };