1
0
mirror of https://github.com/thib8956/tic-tac-toe-ws.git synced 2025-08-24 00:11:56 +00:00

handle remote websocketserver and handle game reset by client

This commit is contained in:
2024-09-25 22:15:10 +02:00
parent 6a729cc7ad
commit c9157e83ef
3 changed files with 35 additions and 10 deletions

View File

@@ -1,8 +1,8 @@
export type MessageKind = "hello" | "update" | "endgame";
export type MessageKind = "hello" | "update" | "endgame" | "reset";
export interface Message {
kind: MessageKind,
data: Response | Hello | EndGame,
data: Response | Hello | EndGame | Reset,
}
export interface Request {
@@ -11,7 +11,6 @@ export interface Request {
}
export interface Response {
grid: number[],
last: { x: number, y: number, symbol: "x" | "o" }
}
@@ -23,3 +22,6 @@ export interface Hello {
export interface EndGame {
issue: "win" | "lose" | "draw"
}
type Reset = undefined;