bugs bashed

This commit is contained in:
2025-09-08 22:45:42 -04:00
parent 41bd1fce38
commit fb3f567a5b
10 changed files with 55 additions and 64 deletions

View File

@@ -1,21 +1,9 @@
import { Game } from "@games/shared/games";
import { Human } from "@prisma/client";
import dayjs from "dayjs";
import { Elysia, t } from "elysia";
import { combine } from "kefir";
import Bus from "kefir-bus";
import { liveTable, WsIn, WsOut } from "./table";
import { Elysia } from "elysia";
import { generateTokenAndKey, resolveToken } from "./human";
import { err } from "./logging";
import { generateTokenAndKey, resolveToken, tokenExists } from "./human";
export const WS = Bus<
{
type: "open" | "message" | "error" | "close";
humanKey: string;
tableKey: string;
},
unknown
>();
import { liveTable, WsIn, WsOut } from "./table";
import type { ExtractPropertyType, UnionKeys } from "@games/shared/types";
const api = new Elysia({ prefix: "/api" })
.post("/whoami", async ({ cookie: { token } }) => {
@@ -57,6 +45,7 @@ const api = new Elysia({ prefix: "/api" })
...table.outputs.global,
...(table.outputs.player[humanKey] ?? {}),
}).forEach(([type, stream]) =>
// @ts-ignore
stream.onValue((v) => send({ [type]: v }))
);
},