aboutsummaryrefslogtreecommitdiffstats
path: root/backend/src/model/session.ts
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.com>2023-11-09 00:17:03 +0000
committerLeonardo Bishop <me@leonardobishop.com>2023-11-09 00:17:03 +0000
commit1f101fe7cc5cc31c66146a1e226fa4bae805fdd4 (patch)
treee1d533f686741bf0c7a446ba8ada1ac66a2051ef /backend/src/model/session.ts
parent28f705fc4aa2f3c62e7fe7d95557494bedcb8d1c (diff)
Refactor websockets
Diffstat (limited to 'backend/src/model/session.ts')
-rw-r--r--backend/src/model/session.ts16
1 files changed, 16 insertions, 0 deletions
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