62 lines
1.8 KiB
TypeScript
62 lines
1.8 KiB
TypeScript
import { clusterMain } from './clusterUtils';
|
||
import { extendType } from './extends';
|
||
import { ctor } from './global';
|
||
import { initGcType } from './jsonType';
|
||
import { createLng } from './lng';
|
||
import { getItemByItemId, getItemList, getItemNum } from './public/item';
|
||
import { createHttp } from './setHttp';
|
||
import { initMongoDB } from './setMongodb';
|
||
import { initRedis, redisClient } from './setRedis';
|
||
import { startAfter } from './setStartAfther';
|
||
import { createWs } from './setWs';
|
||
|
||
async function start() {
|
||
//扩展框架
|
||
extendType();
|
||
//游戏配置提示文件
|
||
initGcType();
|
||
//连接mongodb
|
||
await initMongoDB();
|
||
//连接redis
|
||
await initRedis();
|
||
//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();
|
||
// }
|
||
|
||
// let a = await getItemList('0_64e7024f1b2a9acc9e6900fb');
|
||
// console.log('a',a)
|
||
|
||
// let b = await getItemByItemId('0_64e7024f1b2a9acc9e6900fb','12');
|
||
// console.log('b',b)
|
||
|
||
// let c = await getItemNum('0_64e7024f1b2a9acc9e6900fb',['27382','12']);
|
||
// console.log('c',c)
|
||
|
||
redisClient.del([
|
||
G.redis.fromatKey('item'),
|
||
G.redis.fromatKey('equip'),
|
||
G.redis.fromatKey('hero'),
|
||
G.redis.fromatKey('shiwu'),
|
||
G.redis.fromatKey('gbtx'),
|
||
G.redis.fromatKey('dxlt'),
|
||
])
|
||
}
|
||
|
||
//定义全局变量
|
||
ctor();
|
||
//启动服务
|
||
start();
|
||
//创建语言包
|
||
createLng();
|
||
|