GuessWhoIAmS/src/api/room/ApiCreate.ts
2023-09-10 15:17:34 +08:00

12 lines
454 B
TypeScript

import { ApiCall, BaseConnection } from "tsrpc";
import Room from "../../component/Room/Room";
import { ReqCreate, ResCreate } from "../../shared/protocols/room/PtlCreate";
import { ServiceType } from "../../shared/protocols/serviceProto";
export default async function (call: ApiCall<ReqCreate, ResCreate>) {
const conn: BaseConnection<ServiceType> = call.conn;
const room = new Room();
room.Join(conn);
conn.Room = room;
call.succ(room.RoomId);
}