@magicworks/client-party-game 0.1.0-rc.4 → 0.1.0-rc.6
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/README.md +18 -3
- package/dist/client.d.ts +37 -39
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +160 -183
- package/dist/client.js.map +1 -1
- package/dist/connection.d.ts +158 -0
- package/dist/connection.d.ts.map +1 -0
- package/dist/connection.js +375 -0
- package/dist/connection.js.map +1 -0
- package/dist/protocol/codes.d.ts +29 -0
- package/dist/protocol/codes.d.ts.map +1 -0
- package/dist/protocol/codes.js +56 -0
- package/dist/protocol/codes.js.map +1 -0
- package/dist/protocol/events.d.ts +129 -0
- package/dist/protocol/events.d.ts.map +1 -0
- package/dist/protocol/events.js +131 -0
- package/dist/protocol/events.js.map +1 -0
- package/dist/protocol/index.d.ts +25 -0
- package/dist/protocol/index.d.ts.map +1 -0
- package/dist/protocol/index.js +41 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/protocol/limits.d.ts +40 -0
- package/dist/protocol/limits.d.ts.map +1 -0
- package/dist/protocol/limits.js +43 -0
- package/dist/protocol/limits.js.map +1 -0
- package/dist/protocol/messages.d.ts +294 -0
- package/dist/protocol/messages.d.ts.map +1 -0
- package/dist/protocol/messages.js +3 -0
- package/dist/protocol/messages.js.map +1 -0
- package/dist/protocol/placement.d.ts +63 -0
- package/dist/protocol/placement.d.ts.map +1 -0
- package/dist/protocol/placement.js +82 -0
- package/dist/protocol/placement.js.map +1 -0
- package/dist/protocol/routing.d.ts +26 -0
- package/dist/protocol/routing.d.ts.map +1 -0
- package/dist/protocol/routing.js +19 -0
- package/dist/protocol/routing.js.map +1 -0
- package/dist/protocol/scoring.d.ts +7 -0
- package/dist/protocol/scoring.d.ts.map +1 -0
- package/dist/protocol/scoring.js +13 -0
- package/dist/protocol/scoring.js.map +1 -0
- package/dist/protocol/speedtest.d.ts +9 -0
- package/dist/protocol/speedtest.d.ts.map +1 -0
- package/dist/protocol/speedtest.js +22 -0
- package/dist/protocol/speedtest.js.map +1 -0
- package/dist/socket.d.ts +4 -2
- package/dist/socket.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/protocol.d.ts +0 -509
- package/dist/protocol.d.ts.map +0 -1
- package/dist/protocol.js +0 -262
- package/dist/protocol.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":";;;;;AAAA,yCAOoB;AAQpB,6EAA6E;AAChE,QAAA,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAEzC,mFAAmF;AACtE,QAAA,kBAAkB,GAAG,CAAC,CAAC;AAEpC,qBAA+B,OAAmB,EAAE,EAAU,EAAE,IAAY;IAC1E,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACxC,MAAM,KAAK,GAAG,UAAU,CACtB,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,+BAA+B,IAAI,OAAO,EAAE,IAAI,CAAC,CAAC,EACzE,EAAE,CACH,CAAC;QACF,OAAO,CAAC,IAAI,CACV,KAAK,CAAC,EAAE;YACN,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC,EACD,KAAK,CAAC,EAAE;YACN,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,6HAA6H;AAC7H,kBAAyB,IAA4B;IACnD,MAAM,IAAI,GAA2B,EAAE,CAAC;IACxC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MA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,EAAE,CAAC;YACnC,IAAI,IAAI,IAAI,IAAA,uBAAY,EAAC,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC;gBAC1C,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC/B,CAAC;YACD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** No I, O, 0 or 1 - codes are read off a TV screen and typed on a phone. */
|
|
2
|
+
export declare const CODE_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
|
3
|
+
export declare const CODE_LENGTH = 6;
|
|
4
|
+
/**
|
|
5
|
+
* A room's code starts with the prefix of the server that holds it, and the
|
|
6
|
+
* load balancer routes on it: a request whose `c` query parameter
|
|
7
|
+
* (ROUTING_QUERY_KEY) starts with a server's prefix reaches that server,
|
|
8
|
+
* whichever server it would otherwise have been handed to.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CODE_PREFIX_LENGTH = 2;
|
|
11
|
+
export declare const ROUTING_QUERY_KEY = "c";
|
|
12
|
+
/**
|
|
13
|
+
* Which region's servers hand out the codes starting with which characters.
|
|
14
|
+
* A room lives on one server in one region, and the party servers' global
|
|
15
|
+
* name is latency-routed, so a TV and a phone in the same room can be sent
|
|
16
|
+
* to different regions: a code says which region it belongs to, and a
|
|
17
|
+
* client connects for it to that region's own name. Between them the
|
|
18
|
+
* regions cover every first character, so any code belongs somewhere.
|
|
19
|
+
*/
|
|
20
|
+
export declare const PARTY_REGIONS: Readonly<Record<string, string>>;
|
|
21
|
+
/** The region a code belongs to. */
|
|
22
|
+
export declare function regionOfCode(code: string): string | null;
|
|
23
|
+
/** `code` tidied up the way a phone types it, or null if it cannot be a code. */
|
|
24
|
+
export declare function normaliseCode(code: unknown): string | null;
|
|
25
|
+
/** Whether `value` is a server prefix: CODE_PREFIX_LENGTH characters of CODE_ALPHABET. */
|
|
26
|
+
export declare function isCodePrefix(value: unknown): value is string;
|
|
27
|
+
/** The server prefix a code routes by. */
|
|
28
|
+
export declare function codePrefixOf(code: string): string;
|
|
29
|
+
//# sourceMappingURL=codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../src/protocol/codes.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,eAAO,MAAM,aAAa,qCAAqC,CAAC;AAChE,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAG1D,CAAC;AAEF,oCAAoC;AACpC,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOxD;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAQ1D;AAED,0FAA0F;AAC1F,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAM5D;AAED,0CAA0C;AAC1C,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PARTY_REGIONS = exports.ROUTING_QUERY_KEY = exports.CODE_PREFIX_LENGTH = exports.CODE_LENGTH = exports.CODE_ALPHABET = void 0;
|
|
4
|
+
exports.regionOfCode = regionOfCode;
|
|
5
|
+
exports.normaliseCode = normaliseCode;
|
|
6
|
+
exports.isCodePrefix = isCodePrefix;
|
|
7
|
+
exports.codePrefixOf = codePrefixOf;
|
|
8
|
+
/** No I, O, 0 or 1 - codes are read off a TV screen and typed on a phone. */
|
|
9
|
+
exports.CODE_ALPHABET = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';
|
|
10
|
+
exports.CODE_LENGTH = 6;
|
|
11
|
+
/**
|
|
12
|
+
* A room's code starts with the prefix of the server that holds it, and the
|
|
13
|
+
* load balancer routes on it: a request whose `c` query parameter
|
|
14
|
+
* (ROUTING_QUERY_KEY) starts with a server's prefix reaches that server,
|
|
15
|
+
* whichever server it would otherwise have been handed to.
|
|
16
|
+
*/
|
|
17
|
+
exports.CODE_PREFIX_LENGTH = 2;
|
|
18
|
+
exports.ROUTING_QUERY_KEY = 'c';
|
|
19
|
+
/**
|
|
20
|
+
* Which region's servers hand out the codes starting with which characters.
|
|
21
|
+
* A room lives on one server in one region, and the party servers' global
|
|
22
|
+
* name is latency-routed, so a TV and a phone in the same room can be sent
|
|
23
|
+
* to different regions: a code says which region it belongs to, and a
|
|
24
|
+
* client connects for it to that region's own name. Between them the
|
|
25
|
+
* regions cover every first character, so any code belongs somewhere.
|
|
26
|
+
*/
|
|
27
|
+
exports.PARTY_REGIONS = {
|
|
28
|
+
'us-east-1': 'ABCDEFGHJKLMNPQR',
|
|
29
|
+
'eu-west-1': 'STUVWXYZ23456789',
|
|
30
|
+
};
|
|
31
|
+
/** The region a code belongs to. */
|
|
32
|
+
function regionOfCode(code) {
|
|
33
|
+
const first = code.charAt(0).toUpperCase();
|
|
34
|
+
return (Object.keys(exports.PARTY_REGIONS).find(region => exports.PARTY_REGIONS[region].includes(first)) ?? null);
|
|
35
|
+
}
|
|
36
|
+
/** `code` tidied up the way a phone types it, or null if it cannot be a code. */
|
|
37
|
+
function normaliseCode(code) {
|
|
38
|
+
const clean = String(code ?? '')
|
|
39
|
+
.trim()
|
|
40
|
+
.toUpperCase();
|
|
41
|
+
if (clean.length !== exports.CODE_LENGTH) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
return [...clean].every(c => exports.CODE_ALPHABET.includes(c)) ? clean : null;
|
|
45
|
+
}
|
|
46
|
+
/** Whether `value` is a server prefix: CODE_PREFIX_LENGTH characters of CODE_ALPHABET. */
|
|
47
|
+
function isCodePrefix(value) {
|
|
48
|
+
return (typeof value === 'string' &&
|
|
49
|
+
value.length === exports.CODE_PREFIX_LENGTH &&
|
|
50
|
+
[...value].every(c => exports.CODE_ALPHABET.includes(c)));
|
|
51
|
+
}
|
|
52
|
+
/** The server prefix a code routes by. */
|
|
53
|
+
function codePrefixOf(code) {
|
|
54
|
+
return code.slice(0, exports.CODE_PREFIX_LENGTH);
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=codes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codes.js","sourceRoot":"","sources":["../../src/protocol/codes.ts"],"names":[],"mappings":";;;;;;;AAAA,6EAA6E;AAChE,QAAA,aAAa,GAAG,kCAAkC,CAAC;AACnD,QAAA,WAAW,GAAG,CAAC,CAAC;AAC7B;;;;;GAKG;AACU,QAAA,kBAAkB,GAAG,CAAC,CAAC;AACvB,QAAA,iBAAiB,GAAG,GAAG,CAAC;AAErC;;;;;;;GAOG;AACU,QAAA,aAAa,GAAqC;IAC7D,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,kBAAkB;CAChC,CAAC;AAEF,oCAAoC;AACpC,sBAA6B,IAAY;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC3C,OAAO,CACL,MAAM,CAAC,IAAI,CAAC,QAAA,aAAa,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CACvC,QAAA,aAAa,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CACtC,IAAI,IAAI,CACV,CAAC;AACJ,CAAC;AAED,iFAAiF;AACjF,uBAA8B,IAAa;IACzC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;SAC7B,IAAI,EAAE;SACN,WAAW,EAAE,CAAC;IACjB,IAAI,KAAK,CAAC,MAAM,KAAK,QAAA,WAAW,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,QAAA,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACzE,CAAC;AAED,0FAA0F;AAC1F,sBAA6B,KAAc;IACzC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,CAAC,MAAM,KAAK,QAAA,kBAAkB;QACnC,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,QAAA,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACjD,CAAC;AACJ,CAAC;AAED,0CAA0C;AAC1C,sBAA6B,IAAY;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,QAAA,kBAAkB,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/** The TV or a phone -> server: here, set up, and ready for the countdown. */
|
|
2
|
+
export declare const GameEvent: {
|
|
3
|
+
readonly Ready: 'game:ready';
|
|
4
|
+
};
|
|
5
|
+
/** Server -> the TV and the phones */
|
|
6
|
+
export declare const GameMessage: {
|
|
7
|
+
/** Say when you are ready for the countdown (phones: straight away). */
|
|
8
|
+
readonly Prepare: 'game:prepare';
|
|
9
|
+
/** Everybody is: start the countdown now. */
|
|
10
|
+
readonly Countdown: 'game:countdown';
|
|
11
|
+
};
|
|
12
|
+
/** TV -> server: the server's clock, for working out the offset to it. */
|
|
13
|
+
export declare const TimeEvent: {
|
|
14
|
+
readonly Ping: 'time:ping';
|
|
15
|
+
};
|
|
16
|
+
/** Host -> server */
|
|
17
|
+
export declare const HostEvent: {
|
|
18
|
+
readonly Create: 'host:create';
|
|
19
|
+
readonly Start: 'host:start';
|
|
20
|
+
/** The round's options and answer, sent once the host's video is preloaded. */
|
|
21
|
+
readonly RoundStart: 'host:round-start';
|
|
22
|
+
readonly RoundEnd: 'host:round-end';
|
|
23
|
+
/**
|
|
24
|
+
* An ad is playing on the TV, between rounds: the phones say so until the
|
|
25
|
+
* next round starts.
|
|
26
|
+
*/
|
|
27
|
+
readonly AdBreak: 'host:ad-break';
|
|
28
|
+
readonly GameEnd: 'host:game-end';
|
|
29
|
+
readonly Restart: 'host:restart';
|
|
30
|
+
/** Open, here, a room handed over by a server on its way out: see HostMessage.Move. */
|
|
31
|
+
readonly Adopt: 'host:adopt';
|
|
32
|
+
/** To the server it is leaving: the room is open again under this code. */
|
|
33
|
+
readonly Moved: 'host:moved';
|
|
34
|
+
/**
|
|
35
|
+
* The players of a room that was lost mid-game - its server went - put
|
|
36
|
+
* into this one, the lobby the TV opened instead, for each phone to claim
|
|
37
|
+
* back by name: see HostRestoreRequest.
|
|
38
|
+
*/
|
|
39
|
+
readonly Restore: 'host:restore';
|
|
40
|
+
};
|
|
41
|
+
/** Player -> server */
|
|
42
|
+
export declare const PlayerEvent: {
|
|
43
|
+
readonly Join: 'player:join';
|
|
44
|
+
readonly Ready: 'player:ready';
|
|
45
|
+
readonly Answer: 'player:answer';
|
|
46
|
+
/**
|
|
47
|
+
* How a phone times its connection, every few seconds: answered with
|
|
48
|
+
* nothing, as all it measures is the round trip. The TV's clock sync is
|
|
49
|
+
* `time:ping`, which answers with the server's time.
|
|
50
|
+
*/
|
|
51
|
+
readonly Ping: 'player:ping';
|
|
52
|
+
};
|
|
53
|
+
/** Server -> host */
|
|
54
|
+
export declare const HostMessage: {
|
|
55
|
+
/** The whole roster, in standings order (PlayersMessage). */
|
|
56
|
+
readonly Players: 'players';
|
|
57
|
+
/**
|
|
58
|
+
* Players whose connection, ready or answered flags changed, and nothing
|
|
59
|
+
* else about the roster did (PlayersChangedMessage): sent instead of the
|
|
60
|
+
* whole roster for every answer, ready and dropped connection.
|
|
61
|
+
*/
|
|
62
|
+
readonly PlayersChanged: 'players:changed';
|
|
63
|
+
readonly AllAnswered: 'round:all-answered';
|
|
64
|
+
readonly GameOver: 'game:over';
|
|
65
|
+
/** Play the round at `startAt` (server time). */
|
|
66
|
+
readonly RoundGo: 'round:go';
|
|
67
|
+
/**
|
|
68
|
+
* This server is on its way out and the game is over: take the room to
|
|
69
|
+
* another one (`host:adopt` with the token, over a connection placed for
|
|
70
|
+
* no room), then say where it went (`host:moved`).
|
|
71
|
+
*/
|
|
72
|
+
readonly Move: 'room:move';
|
|
73
|
+
};
|
|
74
|
+
/** Server -> player */
|
|
75
|
+
export declare const PlayerMessage: {
|
|
76
|
+
readonly State: 'state';
|
|
77
|
+
readonly Dropped: 'dropped';
|
|
78
|
+
readonly RoundStart: 'round:start';
|
|
79
|
+
readonly RoundResult: 'round:result';
|
|
80
|
+
/** An ad is playing on the TV (a PlayerAdBreak): the next round:start ends it. */
|
|
81
|
+
readonly AdBreak: 'ad:break';
|
|
82
|
+
readonly GameOver: 'game:over';
|
|
83
|
+
/** The party is open under another code: connect for it and rejoin as before. */
|
|
84
|
+
readonly Moved: 'room:moved';
|
|
85
|
+
/** The party is waiting for its TV, which is gone for now: try again in a while. */
|
|
86
|
+
readonly Parked: 'room:parked';
|
|
87
|
+
};
|
|
88
|
+
export declare const GameStatus: {
|
|
89
|
+
readonly Lobby: 'lobby';
|
|
90
|
+
readonly Playing: 'playing';
|
|
91
|
+
readonly Over: 'over';
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Why a host call was refused, in its ack's `reason`.
|
|
95
|
+
*/
|
|
96
|
+
export declare const HostRefusal: {
|
|
97
|
+
/**
|
|
98
|
+
* A server on its way out: it keeps the rooms it has, but opens no new ones
|
|
99
|
+
* (and past its drain deadline, starts no more games), so the host connects
|
|
100
|
+
* again without a room in its query - which the load balancer hands to a
|
|
101
|
+
* server still taking parties - and asks again.
|
|
102
|
+
*/
|
|
103
|
+
readonly Draining: 'draining';
|
|
104
|
+
/** The room is open under another code, `movedTo`: ask again there. */
|
|
105
|
+
readonly Moved: 'moved';
|
|
106
|
+
/** The room is on its way to another server: ask again once it is there. */
|
|
107
|
+
readonly Moving: 'moving';
|
|
108
|
+
};
|
|
109
|
+
/** Why a phone's call was refused, in its ack's `reason`. */
|
|
110
|
+
export declare const PlayerRefusal: {
|
|
111
|
+
/** The room is on its way to another server: ask again in a moment, or follow room:moved. */
|
|
112
|
+
readonly Moving: 'moving';
|
|
113
|
+
/** No party has this code. */
|
|
114
|
+
readonly NotFound: 'not-found';
|
|
115
|
+
/** A game is being played: new players can join once the TV sets up the next one. */
|
|
116
|
+
readonly Started: 'started';
|
|
117
|
+
/** The room's TV has left: only the phones already in it can come back. */
|
|
118
|
+
readonly TvGone: 'tv-gone';
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* What a host or a phone can do beyond the first version of the protocol,
|
|
122
|
+
* sent with `host:create` and `player:join`. A server only moves a room when
|
|
123
|
+
* its host and every phone in it can follow.
|
|
124
|
+
*/
|
|
125
|
+
export declare const Feature: {
|
|
126
|
+
readonly Move: 'move';
|
|
127
|
+
};
|
|
128
|
+
export type PartyFeature = (typeof Feature)[keyof typeof Feature];
|
|
129
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/protocol/events.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,eAAO,MAAM,SAAS;aACpB,KAAK,EAAE,YAAY;CACX,CAAC;AAEX,sCAAsC;AACtC,eAAO,MAAM,WAAW;IACtB,wEAAwE;aACxE,OAAO,EAAE,cAAc;IACvB,6CAA6C;aAC7C,SAAS,EAAE,gBAAgB;CACnB,CAAC;AAEX,0EA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AAM;CACJ,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,WAAW;IACtB;;;;;OAKG;aACH,QAAQ,EAAE,UAAU;IACpB,uEAAuE;aACvE,KAAK,EAAE,OAAO;IACd,4EAA4E;aAC5E,MAAM,EAAE,QAAQ;CACR,CAAC;AAEX,6DAA6D;AAC7D,eAAO,MAAM,aAAa;IACxB,6FAA6F;aAC7F,MAAM,EAAE,QAAQ;IAChB,8BAA8B;aAC9B,QAAQ,EAAE,WAAW;IACrB,qFAAqF;aACrF,OAAO,EAAE,SAAS;IAClB,2EAA2E;aAC3E,MAAM,EAAE,SAAS;CACT,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,OAAO;aAClB,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Feature = exports.PlayerRefusal = exports.HostRefusal = exports.GameStatus = exports.PlayerMessage = exports.HostMessage = exports.PlayerEvent = exports.HostEvent = exports.TimeEvent = exports.GameMessage = exports.GameEvent = void 0;
|
|
4
|
+
/** The TV or a phone -> server: here, set up, and ready for the countdown. */
|
|
5
|
+
exports.GameEvent = {
|
|
6
|
+
Ready: 'game:ready',
|
|
7
|
+
};
|
|
8
|
+
/** Server -> the TV and the phones */
|
|
9
|
+
exports.GameMessage = {
|
|
10
|
+
/** Say when you are ready for the countdown (phones: straight away). */
|
|
11
|
+
Prepare: 'game:prepare',
|
|
12
|
+
/** Everybody is: start the countdown now. */
|
|
13
|
+
Countdown: 'game:countdown',
|
|
14
|
+
};
|
|
15
|
+
/** TV -> server: the server's clock, for working out the offset to it. */
|
|
16
|
+
exports.TimeEvent = {
|
|
17
|
+
Ping: 'time:ping',
|
|
18
|
+
};
|
|
19
|
+
/** Host -> server */
|
|
20
|
+
exports.HostEvent = {
|
|
21
|
+
Create: 'host:create',
|
|
22
|
+
Start: 'host:start',
|
|
23
|
+
/** The round's options and answer, sent once the host's video is preloaded. */
|
|
24
|
+
RoundStart: 'host:round-start',
|
|
25
|
+
RoundEnd: 'host:round-end',
|
|
26
|
+
/**
|
|
27
|
+
* An ad is playing on the TV, between rounds: the phones say so until the
|
|
28
|
+
* next round starts.
|
|
29
|
+
*/
|
|
30
|
+
AdBreak: 'host:ad-break',
|
|
31
|
+
GameEnd: 'host:game-end',
|
|
32
|
+
Restart: 'host:restart',
|
|
33
|
+
/** Open, here, a room handed over by a server on its way out: see HostMessage.Move. */
|
|
34
|
+
Adopt: 'host:adopt',
|
|
35
|
+
/** To the server it is leaving: the room is open again under this code. */
|
|
36
|
+
Moved: 'host:moved',
|
|
37
|
+
/**
|
|
38
|
+
* The players of a room that was lost mid-game - its server went - put
|
|
39
|
+
* into this one, the lobby the TV opened instead, for each phone to claim
|
|
40
|
+
* back by name: see HostRestoreRequest.
|
|
41
|
+
*/
|
|
42
|
+
Restore: 'host:restore',
|
|
43
|
+
};
|
|
44
|
+
/** Player -> server */
|
|
45
|
+
exports.PlayerEvent = {
|
|
46
|
+
Join: 'player:join',
|
|
47
|
+
Ready: 'player:ready',
|
|
48
|
+
Answer: 'player:answer',
|
|
49
|
+
/**
|
|
50
|
+
* How a phone times its connection, every few seconds: answered with
|
|
51
|
+
* nothing, as all it measures is the round trip. The TV's clock sync is
|
|
52
|
+
* `time:ping`, which answers with the server's time.
|
|
53
|
+
*/
|
|
54
|
+
Ping: 'player:ping',
|
|
55
|
+
};
|
|
56
|
+
/** Server -> host */
|
|
57
|
+
exports.HostMessage = {
|
|
58
|
+
/** The whole roster, in standings order (PlayersMessage). */
|
|
59
|
+
Players: 'players',
|
|
60
|
+
/**
|
|
61
|
+
* Players whose connection, ready or answered flags changed, and nothing
|
|
62
|
+
* else about the roster did (PlayersChangedMessage): sent instead of the
|
|
63
|
+
* whole roster for every answer, ready and dropped connection.
|
|
64
|
+
*/
|
|
65
|
+
PlayersChanged: 'players:changed',
|
|
66
|
+
AllAnswered: 'round:all-answered',
|
|
67
|
+
GameOver: 'game:over',
|
|
68
|
+
/** Play the round at `startAt` (server time). */
|
|
69
|
+
RoundGo: 'round:go',
|
|
70
|
+
/**
|
|
71
|
+
* This server is on its way out and the game is over: take the room to
|
|
72
|
+
* another one (`host:adopt` with the token, over a connection placed for
|
|
73
|
+
* no room), then say where it went (`host:moved`).
|
|
74
|
+
*/
|
|
75
|
+
Move: 'room:move',
|
|
76
|
+
};
|
|
77
|
+
/** Server -> player */
|
|
78
|
+
exports.PlayerMessage = {
|
|
79
|
+
State: 'state',
|
|
80
|
+
Dropped: 'dropped',
|
|
81
|
+
RoundStart: 'round:start',
|
|
82
|
+
RoundResult: 'round:result',
|
|
83
|
+
/** An ad is playing on the TV (a PlayerAdBreak): the next round:start ends it. */
|
|
84
|
+
AdBreak: 'ad:break',
|
|
85
|
+
GameOver: 'game:over',
|
|
86
|
+
/** The party is open under another code: connect for it and rejoin as before. */
|
|
87
|
+
Moved: 'room:moved',
|
|
88
|
+
/** The party is waiting for its TV, which is gone for now: try again in a while. */
|
|
89
|
+
Parked: 'room:parked',
|
|
90
|
+
};
|
|
91
|
+
exports.GameStatus = {
|
|
92
|
+
Lobby: 'lobby',
|
|
93
|
+
Playing: 'playing',
|
|
94
|
+
Over: 'over',
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Why a host call was refused, in its ack's `reason`.
|
|
98
|
+
*/
|
|
99
|
+
exports.HostRefusal = {
|
|
100
|
+
/**
|
|
101
|
+
* A server on its way out: it keeps the rooms it has, but opens no new ones
|
|
102
|
+
* (and past its drain deadline, starts no more games), so the host connects
|
|
103
|
+
* again without a room in its query - which the load balancer hands to a
|
|
104
|
+
* server still taking parties - and asks again.
|
|
105
|
+
*/
|
|
106
|
+
Draining: 'draining',
|
|
107
|
+
/** The room is open under another code, `movedTo`: ask again there. */
|
|
108
|
+
Moved: 'moved',
|
|
109
|
+
/** The room is on its way to another server: ask again once it is there. */
|
|
110
|
+
Moving: 'moving',
|
|
111
|
+
};
|
|
112
|
+
/** Why a phone's call was refused, in its ack's `reason`. */
|
|
113
|
+
exports.PlayerRefusal = {
|
|
114
|
+
/** The room is on its way to another server: ask again in a moment, or follow room:moved. */
|
|
115
|
+
Moving: 'moving',
|
|
116
|
+
/** No party has this code. */
|
|
117
|
+
NotFound: 'not-found',
|
|
118
|
+
/** A game is being played: new players can join once the TV sets up the next one. */
|
|
119
|
+
Started: 'started',
|
|
120
|
+
/** The room's TV has left: only the phones already in it can come back. */
|
|
121
|
+
TvGone: 'tv-gone',
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* What a host or a phone can do beyond the first version of the protocol,
|
|
125
|
+
* sent with `host:create` and `player:join`. A server only moves a room when
|
|
126
|
+
* its host and every phone in it can follow.
|
|
127
|
+
*/
|
|
128
|
+
exports.Feature = {
|
|
129
|
+
Move: 'move',
|
|
130
|
+
};
|
|
131
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/protocol/events.ts"],"names":[],"mappings":";;;AAAA,8EAA8E;AACjE,QAAA,SAAS,GAAG;IACvB,KAAK,EAAE,YAAY;CACX,CAAC;AAEX,sCAAsC;AACzB,QAAA,WAAW,GAAG;IACzB,wEAAwE;IACxE,OAAO,EAAE,cAAc;IACvB,6CAA6C;IAC7C,SAAS,EAAE,gBAAgB;CACnB,CAAC;AAEX,0EAA0E;AAC7D,QAAA,SAAS,GAAG;IACvB,IAAI,EAAE,WAAW;CACT,CAAC;AAEX,qBAAqB;AACR,QAAA,SAAS,GAAG;IACvB,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,YAAY;IACnB,+EAA+E;IAC/E,UAAU,EAAE,kBAAkB;IAC9B,QAAQ,EAAE,gBAAgB;IAC1B;;;OAGG;IACH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MAAM,EAAE,QAAQ;IAChB,8BAA8B;IAC9B,QAAQ,EAAE,WAAW;IACrB,qFAAqF;IACrF,OAAO,EAAE,SAAS;IAClB,2EAA2E;IAC3E,MAAM,EAAE,SAAS;CACT,CAAC;AAEX;;;;GAIG;AACU,QAAA,OAAO,GAAG;IACrB,IAAI,EAAE,MAAM;CACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The party game wire protocol, shared by the server
|
|
3
|
+
* (`@magicworks/service-party-game`), the host TV (through `PartyGameClient`)
|
|
4
|
+
* and, by hand, the phone page the server hosts (`public/app.js`).
|
|
5
|
+
*
|
|
6
|
+
* Roles
|
|
7
|
+
* -----
|
|
8
|
+
* host - the ROXi TV app. Owns the video playback and therefore owns round
|
|
9
|
+
* timing. It tells the server when a round starts and ends.
|
|
10
|
+
* player - a phone browser. Only ever sends a join request, a ready and an
|
|
11
|
+
* answer.
|
|
12
|
+
*
|
|
13
|
+
* The correct answer index is sent by the host at round start and never
|
|
14
|
+
* leaves the server: players receive options only, and the server is the sole
|
|
15
|
+
* authority on who scored what.
|
|
16
|
+
*/
|
|
17
|
+
export * from './codes';
|
|
18
|
+
export * from './events';
|
|
19
|
+
export * from './limits';
|
|
20
|
+
export * from './messages';
|
|
21
|
+
export * from './placement';
|
|
22
|
+
export * from './routing';
|
|
23
|
+
export * from './scoring';
|
|
24
|
+
export * from './speedtest';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* The party game wire protocol, shared by the server
|
|
19
|
+
* (`@magicworks/service-party-game`), the host TV (through `PartyGameClient`)
|
|
20
|
+
* and, by hand, the phone page the server hosts (`public/app.js`).
|
|
21
|
+
*
|
|
22
|
+
* Roles
|
|
23
|
+
* -----
|
|
24
|
+
* host - the ROXi TV app. Owns the video playback and therefore owns round
|
|
25
|
+
* timing. It tells the server when a round starts and ends.
|
|
26
|
+
* player - a phone browser. Only ever sends a join request, a ready and an
|
|
27
|
+
* answer.
|
|
28
|
+
*
|
|
29
|
+
* The correct answer index is sent by the host at round start and never
|
|
30
|
+
* leaves the server: players receive options only, and the server is the sole
|
|
31
|
+
* authority on who scored what.
|
|
32
|
+
*/
|
|
33
|
+
__exportStar(require("./codes"), exports);
|
|
34
|
+
__exportStar(require("./events"), exports);
|
|
35
|
+
__exportStar(require("./limits"), exports);
|
|
36
|
+
__exportStar(require("./messages"), exports);
|
|
37
|
+
__exportStar(require("./placement"), exports);
|
|
38
|
+
__exportStar(require("./routing"), exports);
|
|
39
|
+
__exportStar(require("./scoring"), exports);
|
|
40
|
+
__exportStar(require("./speedtest"), exports);
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;GAeG;AACH,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,6CAA2B;AAC3B,8CAA4B;AAC5B,4CAA0B;AAC1B,4CAA0B;AAC1B,8CAA4B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const MAX_PLAYERS = 20;
|
|
2
|
+
/**
|
|
3
|
+
* How long a finished party stays worth coming back to. Opening a lobby with
|
|
4
|
+
* the code of a room touched inside this window reopens that room - same code,
|
|
5
|
+
* same players, scores back to zero - so a second game needs a tap on each
|
|
6
|
+
* phone rather than a fresh scan and everybody's name typed again. Past it the
|
|
7
|
+
* room is left where it is and a new one is opened.
|
|
8
|
+
*/
|
|
9
|
+
export declare const REOPEN_WINDOW_MS: number;
|
|
10
|
+
export declare const TOTAL_ROUNDS = 15;
|
|
11
|
+
/**
|
|
12
|
+
* How many rounds the server lets a game have; a TV asking for anything else
|
|
13
|
+
* gets TOTAL_ROUNDS (or the room's count). The lobby offers 5 to 30.
|
|
14
|
+
*/
|
|
15
|
+
export declare const MIN_ROUNDS = 1;
|
|
16
|
+
export declare const MAX_ROUNDS = 30;
|
|
17
|
+
export declare const MAX_NAME_LENGTH = 16;
|
|
18
|
+
/** The most options a round may put to the phones, and the longest an option's label or detail may be. */
|
|
19
|
+
export declare const MAX_OPTIONS = 8;
|
|
20
|
+
export declare const MAX_OPTION_LENGTH = 200;
|
|
21
|
+
/** The longest a round may run, in milliseconds. */
|
|
22
|
+
export declare const MAX_ROUND_DURATION_MS: number;
|
|
23
|
+
/**
|
|
24
|
+
* A round starts on the TV and the phones at once: when the host has the
|
|
25
|
+
* round's video preloaded the server picks a start time ROUND_LEAD_MS ahead -
|
|
26
|
+
* long enough for the message to reach the TV - or the host's planned start,
|
|
27
|
+
* if later. The TV plays the video at that moment by its own clock, corrected
|
|
28
|
+
* against the server's with `time:ping`, and the phones get the options then.
|
|
29
|
+
*/
|
|
30
|
+
export declare const ROUND_LEAD_MS = 700;
|
|
31
|
+
/**
|
|
32
|
+
* The countdown before round 1 runs on the TV and every phone at once, and only
|
|
33
|
+
* once everybody is there for it: starting a game asks the TV and every phone
|
|
34
|
+
* in the room whether it is ready (`game:prepare`), and the countdown goes out
|
|
35
|
+
* to all of them (`game:countdown`) once they have all said so (`game:ready`)
|
|
36
|
+
* - or this long after the start, so that one device that never answers cannot
|
|
37
|
+
* keep the rest waiting.
|
|
38
|
+
*/
|
|
39
|
+
export declare const GAME_READY_TIMEOUT_MS = 10000;
|
|
40
|
+
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../src/protocol/limits.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,QAAiB,CAAC;AAC/C,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B;;;GAGG;AACH,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,0GAA0G;AAC1G,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,oDAAoD;AACpD,eAAO,MAAM,qBAAqB,QAAgB,CAAC;AACnD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,QAAQ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GAME_READY_TIMEOUT_MS = exports.ROUND_LEAD_MS = exports.MAX_ROUND_DURATION_MS = exports.MAX_OPTION_LENGTH = exports.MAX_OPTIONS = exports.MAX_NAME_LENGTH = exports.MAX_ROUNDS = exports.MIN_ROUNDS = exports.TOTAL_ROUNDS = exports.REOPEN_WINDOW_MS = exports.MAX_PLAYERS = void 0;
|
|
4
|
+
exports.MAX_PLAYERS = 20;
|
|
5
|
+
/**
|
|
6
|
+
* How long a finished party stays worth coming back to. Opening a lobby with
|
|
7
|
+
* the code of a room touched inside this window reopens that room - same code,
|
|
8
|
+
* same players, scores back to zero - so a second game needs a tap on each
|
|
9
|
+
* phone rather than a fresh scan and everybody's name typed again. Past it the
|
|
10
|
+
* room is left where it is and a new one is opened.
|
|
11
|
+
*/
|
|
12
|
+
exports.REOPEN_WINDOW_MS = 20 * 60 * 1000;
|
|
13
|
+
exports.TOTAL_ROUNDS = 15;
|
|
14
|
+
/**
|
|
15
|
+
* How many rounds the server lets a game have; a TV asking for anything else
|
|
16
|
+
* gets TOTAL_ROUNDS (or the room's count). The lobby offers 5 to 30.
|
|
17
|
+
*/
|
|
18
|
+
exports.MIN_ROUNDS = 1;
|
|
19
|
+
exports.MAX_ROUNDS = 30;
|
|
20
|
+
exports.MAX_NAME_LENGTH = 16;
|
|
21
|
+
/** The most options a round may put to the phones, and the longest an option's label or detail may be. */
|
|
22
|
+
exports.MAX_OPTIONS = 8;
|
|
23
|
+
exports.MAX_OPTION_LENGTH = 200;
|
|
24
|
+
/** The longest a round may run, in milliseconds. */
|
|
25
|
+
exports.MAX_ROUND_DURATION_MS = 5 * 60 * 1000;
|
|
26
|
+
/**
|
|
27
|
+
* A round starts on the TV and the phones at once: when the host has the
|
|
28
|
+
* round's video preloaded the server picks a start time ROUND_LEAD_MS ahead -
|
|
29
|
+
* long enough for the message to reach the TV - or the host's planned start,
|
|
30
|
+
* if later. The TV plays the video at that moment by its own clock, corrected
|
|
31
|
+
* against the server's with `time:ping`, and the phones get the options then.
|
|
32
|
+
*/
|
|
33
|
+
exports.ROUND_LEAD_MS = 700;
|
|
34
|
+
/**
|
|
35
|
+
* The countdown before round 1 runs on the TV and every phone at once, and only
|
|
36
|
+
* once everybody is there for it: starting a game asks the TV and every phone
|
|
37
|
+
* in the room whether it is ready (`game:prepare`), and the countdown goes out
|
|
38
|
+
* to all of them (`game:countdown`) once they have all said so (`game:ready`)
|
|
39
|
+
* - or this long after the start, so that one device that never answers cannot
|
|
40
|
+
* keep the rest waiting.
|
|
41
|
+
*/
|
|
42
|
+
exports.GAME_READY_TIMEOUT_MS = 10000;
|
|
43
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../../src/protocol/limits.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,EAAE,CAAC;AAC9B;;;;;;GAMG;AACU,QAAA,gBAAgB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAClC,QAAA,YAAY,GAAG,EAAE,CAAC;AAC/B;;;GAGG;AACU,QAAA,UAAU,GAAG,CAAC,CAAC;AACf,QAAA,UAAU,GAAG,EAAE,CAAC;AAChB,QAAA,eAAe,GAAG,EAAE,CAAC;AAClC,0GAA0G;AAC7F,QAAA,WAAW,GAAG,CAAC,CAAC;AAChB,QAAA,iBAAiB,GAAG,GAAG,CAAC;AACrC,oDAAoD;AACvC,QAAA,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACnD;;;;;;GAMG;AACU,QAAA,aAAa,GAAG,GAAG,CAAC;AACjC;;;;;;;GAOG;AACU,QAAA,qBAAqB,GAAG,KAAK,CAAC"}
|