45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
import { clusterMain } from './clusterUtils';
|
||
import { extendType } from './extends';
|
||
import { ctor } from './global';
|
||
import { initIORedis } from './ioredis';
|
||
import { initGcType } from './jsonType';
|
||
import { createLng } from './lng';
|
||
import { createHttp } from './setHttp';
|
||
import { initMongoDB } from './setMongodb';
|
||
import { initRedis } from './setRedis';
|
||
import { startAfter } from './setStartAfther';
|
||
import { createWs } from './setWs';
|
||
|
||
async function start() {
|
||
//扩展框架
|
||
extendType();
|
||
//游戏配置提示文件
|
||
initGcType();
|
||
//连接mongodb
|
||
await initMongoDB();
|
||
//连接redis
|
||
await initRedis();
|
||
await initIORedis();
|
||
//socket
|
||
await createWs();
|
||
//http
|
||
await createHttp();
|
||
//集群处理
|
||
await clusterMain();
|
||
|
||
if(G.config.opened==true || G.config.opened===undefined || G.config.opened===null){
|
||
//在g123上,部署后就会启动容器,但opened是false
|
||
//本地配置里,没有这个项目,这里做一个兼容
|
||
//这里不做启动后的事情,避免部署好了不启动的情况下,定时器等产生废弃数据
|
||
startAfter();
|
||
}
|
||
}
|
||
|
||
//定义全局变量
|
||
ctor();
|
||
//启动服务
|
||
start();
|
||
//创建语言包
|
||
createLng();
|
||
|