mirror of
https://github.com/maierfelix/POGOserver.git
synced 2026-04-15 22:25:50 -05:00
- Isomorphic databases - Refactored some player->db keys - Seperated shutdown method - Nearby pidgey instead of rattata - Removed some unused arguments - Player saving is async now - Prettified used db console print
31 lines
757 B
JavaScript
31 lines
757 B
JavaScript
import path from "path";
|
|
|
|
import * as CFG from "../cfg";
|
|
|
|
export function setup() {
|
|
|
|
this.print("Booting server..", 33);
|
|
|
|
this.createAssetDownloadSession().then(() => {
|
|
this.setupDatabaseConnection().then(() => {
|
|
|
|
let dbType = String(CFG.SERVER_USE_DATABASE).toLowerCase();
|
|
let name = dbType === "mongo" ? "MongoDB" : "MySQL";
|
|
|
|
this.print(`\x1b[36;1m${name}\x1b[0m\x1b[${CFG.SERVER_DEFAULT_CONSOLE_COLOR};1m connection established\x1b[0m`);
|
|
|
|
if (CFG.SERVER_PORT < 1) {
|
|
this.print("Invalid port!", 31);
|
|
return void 0;
|
|
}
|
|
|
|
this.socket = this.createHTTPServer();
|
|
|
|
setTimeout(this::this.cycle, 1);
|
|
|
|
this.print(`Server running at ${CFG.SERVER_HOST_IP}:${CFG.SERVER_PORT}`);
|
|
|
|
});
|
|
});
|
|
|
|
} |