MessageHandlerRegister.ts 375 Bytes
import { Connection } from "../../connection/Connection";
import { LoginMessage } from "../types";
import { LoginHandler } from "./LoginHandler";

export class MessageHandlerRegister {
  static registerMessageHandlers(connection: Connection) {
    connection.socket.on("login", (message: LoginMessage) => {
      new LoginHandler().handle(connection, message);
    });
  }
}