diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2023-11-09 00:17:03 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2023-11-09 00:17:03 +0000 |
| commit | 1f101fe7cc5cc31c66146a1e226fa4bae805fdd4 (patch) | |
| tree | e1d533f686741bf0c7a446ba8ada1ac66a2051ef /backend/src/model/session.ts | |
| parent | 28f705fc4aa2f3c62e7fe7d95557494bedcb8d1c (diff) | |
Refactor websockets
Diffstat (limited to 'backend/src/model/session.ts')
| -rw-r--r-- | backend/src/model/session.ts | 16 |
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 |
