roomLeaveHandler.ts
379 Bytes
import { Connection } from "../../connection/Connection";
import { RoomManager } from "../../room/RoomManager";
import { User } from "../../user/User";
import { MessageResponse, RoomLeaveMessage } from "../types";
export function roomLeaveHandler(
user: User,
message: RoomLeaveMessage
): MessageResponse<undefined> {
user.room?.disconnect(user);
return { ok: true };
}