后台:道具获取
This commit is contained in:
+14
-4
@@ -68,6 +68,7 @@ app.configure(function () {
|
||||
console.log('serverName:', app.get('serverName'))
|
||||
|
||||
initMongodb(app);
|
||||
initGmMongodb(app);
|
||||
initRedis(app);
|
||||
setupRoutes(app);
|
||||
setupFilters(app);
|
||||
@@ -136,7 +137,14 @@ app.configure(ALL_ENVS, 'chat', function() {
|
||||
app.event.on('start_all', () => {
|
||||
getTire();
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
app.configure(ALL_ENVS, 'activity', function () {
|
||||
app.event.on('start_all', () => {
|
||||
app.rpc.activity.activityRemote.loadActivities.toServer(app.getServerId());
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function errorHandler(err: Error, msg: any, resp: any,
|
||||
session: FrontendOrBackendSession, cb: HandlerCallback) {
|
||||
@@ -167,11 +175,13 @@ async function initMongodb(app: _pinus.Application) {
|
||||
console.log('mongodb connect suc');
|
||||
}
|
||||
});
|
||||
|
||||
let gmconnect = await mongoose.createConnection(app.get('database').gmmongo, { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true, useFindAndModify: false });
|
||||
loadGmDb(gmconnect);
|
||||
}
|
||||
|
||||
async function initGmMongodb(app: _pinus.Application) {
|
||||
let gmconnect = await mongoose.createConnection(app.get('database').gmmongo, { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true, useFindAndModify: false });
|
||||
loadGmDb(gmconnect);
|
||||
console.log('mongoGmDb connect suc')
|
||||
}
|
||||
function initRedis(app: _pinus.Application) {
|
||||
const redisClient = connectRedis(app.get('database').redis, app.get('database').redispw);
|
||||
app.set('redis', redisClient);
|
||||
|
||||
Reference in New Issue
Block a user