12 lines
449 B
TypeScript
12 lines
449 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)
|
||
|
}
|