roomJoinHandler.ts 390 Bytes
import { Connection } from "../../connection/Connection";
import { RoomManager } from "../../room/RoomManager";
import { User } from "../../user/User";
import { RoomJoinMessage } from "../types";

export function roomJoinHandler(user: User, message: RoomJoinMessage): void {
  const room = RoomManager.instance().get(message.uuid);
  if (room !== undefined) {
    room.connect(user);
  }
}