zzyxyz_game/server.ts

16 lines
554 B
TypeScript

import { IncomingMessage } from "http";
import { RawData, WebSocket } from "ws";
import RoomProto from "./src/RoomProto/RoomProto";
import Manager from "./src/RoomProto/Manager";
import SecurityManager from "./src/RoomProto/utils/secure";
const manager = new Manager("server");
export default function connectHandle(ws: WebSocket, req: IncomingMessage) {
const ip = req.socket.remoteAddress;
console.log(`Client connected ${ip}`);
let globalId: string = SecurityManager.generateId();
let func = new RoomProto(globalId, ws, manager);
}