feat(服务器): 修改服务器自动开服策略

This commit is contained in:
luying
2023-04-25 13:04:30 +08:00
parent af1f6b9d8c
commit 906449be60
14 changed files with 121 additions and 128 deletions

View File

@@ -25,6 +25,7 @@ import { checkServerIsOpen, getIpLocation } from '../../../services/roleService'
import { leaveRaceActivityToRemote } from '../../../services/guildActivity/guildActivityService';
import { getHiddenData } from '../../../services/dataService';
import { leaveCity } from '../../../services/gvg/gvgBattleService';
import { autoCreateServerWhenRoleInit } from '../../../services/serverService';
export default function (app: Application) {
new HandlerService(app, {});
@@ -73,6 +74,7 @@ export class EntryHandler {
if (!role) {
return resResult(STATUS.ROLE_NOT_FOUND);
}
console.log('#### needCount 0', role.needCount)
let serverName = this.app.getServerId();
await roleLogin(role.roleId, user.userCode, serverName, role.createTime, role.serverId, role.lv, role.topLineupCe); // 保存在线用户
@@ -91,6 +93,8 @@ export class EntryHandler {
}
let todayZeroPoint = getZeroPoint();
console.log('####### needCount', role.needCount)
if(role.needCount) autoCreateServerWhenRoleInit(serverId);
// console.log('****** entry after', Date.now());
return resResult(STATUS.SUCCESS, { roleId: role.roleId, todayZeroPoint });