bugs bashed
This commit is contained in:
@@ -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 }))
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user