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