2021-06-27 01:41:52 +03:00
|
|
|
|
2022-07-15 21:43:29 +03:00
|
|
|
import { RTMTWS } from "./rtmt/rtmt_websocket";
|
|
|
|
|
import { GameManager } from "./game/GameManager";
|
|
|
|
|
import { GameStoreImpl } from "./game/gamestore/GameStoreImpl";
|
|
|
|
|
import { MatchMakerImpl } from "./matchmaker/MatchMakerImpl";
|
|
|
|
|
import { ExpressApp } from "./server/ExpressApp";
|
|
|
|
|
import { WebServer } from "./server/WebServer";
|
2021-06-27 19:28:09 +03:00
|
|
|
|
2022-05-04 23:18:29 +03:00
|
|
|
const rtmt = new RTMTWS();
|
2022-07-15 21:43:29 +03:00
|
|
|
const gameStore = new GameStoreImpl();
|
|
|
|
|
const matchMaker = new MatchMakerImpl();
|
|
|
|
|
const gameManager = new GameManager({ rtmt, gameStore, matchMaker })
|
2021-06-27 19:28:09 +03:00
|
|
|
|
2022-07-15 21:43:29 +03:00
|
|
|
const expressApp = new ExpressApp();
|
2022-07-16 17:42:49 +03:00
|
|
|
const server = new WebServer({ expressApp: expressApp.app });
|
2022-05-06 00:07:41 +03:00
|
|
|
|
2022-07-15 21:43:29 +03:00
|
|
|
rtmt.initWebSocket(server.server, (userKey: string) => gameManager.fireOnPlayerConnected(userKey));
|