From 1f101fe7cc5cc31c66146a1e226fa4bae805fdd4 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Thu, 9 Nov 2023 00:17:03 +0000 Subject: Refactor websockets --- backend/src/model/session.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 backend/src/model/session.ts (limited to 'backend/src/model/session.ts') diff --git a/backend/src/model/session.ts b/backend/src/model/session.ts new file mode 100644 index 0000000..d2fdea3 --- /dev/null +++ b/backend/src/model/session.ts @@ -0,0 +1,16 @@ +import { CoopWebSocket } from "./websocket"; + +export type CoopSession = { + id: string; + state: SessionState; + host: CoopWebSocket; + clients: CoopWebSocket[]; +}; + +export type VersusSession = { + id: string; + state: SessionState; + clients: string[]; +}; + +export type SessionState = 'waiting' | 'playing' | 'finished'; \ No newline at end of file -- cgit v1.2.3-70-g09d2