2023-09-02 22:33:40 +08:00
|
|
|
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>) {
|
2023-09-10 15:17:34 +08:00
|
|
|
const conn: BaseConnection<ServiceType> = call.conn;
|
|
|
|
const room = new Room();
|
|
|
|
room.Join(conn);
|
|
|
|
conn.Room = room;
|
|
|
|
call.succ(room.RoomId);
|
2023-09-02 22:33:40 +08:00
|
|
|
}
|