Server authority

This commit is contained in:
2026-09-24 19:34:07 -03:00
parent 1bef94ce0c
commit 79faa556de
75 changed files with 2247 additions and 1632 deletions
+15
View File
@@ -0,0 +1,15 @@
// messages between server/main.ts (the host) and the game server worker
export type HostToGame =
| { type: "init"; save: string | undefined; default_seed: string }
| { type: "connect"; conn: number }
| { type: "message"; conn: number; data: string }
| { type: "disconnect"; conn: number }
// save now and say when it's done, for shutting down
| { type: "shutdown" };
export type GameToHost =
| { type: "ready"; seed: string }
| { type: "send"; conn: number; data: string }
| { type: "close"; conn: number }
| { type: "save"; data: string; final: boolean };