Skip to content

Commit bc8e390

Browse files
committed
Add: Websocket messages
1 parent c1edb91 commit bc8e390

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/models/matchmaking.model.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,26 @@ export type MatchmakingTreeNode = {
33
left: null | MatchmakingTreeNode;
44
right: null | MatchmakingTreeNode;
55
};
6+
7+
export enum WebsocketMessageType {
8+
READY = "READY",
9+
NOT_READY = "NOT_READY",
10+
CHECK = "CHECK", // Verify if handle sends a problem
11+
PING = "PING",
12+
START_CONTEST = "START_CONTEST",
13+
}
14+
15+
export type WebsocketReadyPayload = {
16+
handle: string;
17+
};
18+
19+
export type WebsocketReadyMessage = {
20+
action: WebsocketMessageType.READY;
21+
data: WebsocketReadyPayload;
22+
};
23+
24+
export type WebsocketNotReadyMessage = {
25+
action: WebsocketMessageType.NOT_READY;
26+
};
27+
28+
export type WebsocketCheckMessage = {};

0 commit comments

Comments
 (0)