🐞 fix(gvg): 投石车定时任务

This commit is contained in:
luying
2023-02-15 22:03:05 +08:00
parent 4359bfd9cc
commit 7543baa8cb
17 changed files with 304 additions and 52 deletions

View File

@@ -1,6 +1,6 @@
import { GVGCityType } from './../../../db/GVGCity';
import { GVGRecModel } from '../../../db/GVGRec';
import { GVGAreaInMap, GVGTeamInList, GVGTeamInListOnPoint, GVGTeamSpineInMap, LeagueGood, MyTeamInfo } from '../../../domain/gvgField/returnData';
import { GVGAreaInMap, GVGTeamInList, GVGTeamInListOnPoint, GVGTeamSpineInMap, LeagueGood, MyTeamInfo, MyTeamSimpleInfo } from '../../../domain/gvgField/returnData';
import { GVGTeamModel, GVGTeamType, GVGTeamUpdate } from '../../../db/GVGTeam';
import { GVGUserDataModel } from '../../../db/GVGUserData';
import { GVGCityModel } from '../../../db/GVGCity';
@@ -23,6 +23,7 @@ import { sendMessageToUserWithSuc } from '../../../services/pushService';
import { GVGHeroInfo } from '../../../domain/dbGeneral';
import { ArtifactModel } from '../../../db/Artifact';
import { getHeroesAttributes } from '../../../services/playerCeService';
import { gvgBattleStartSchedule } from '../../../services/timeTaskService';
export default function (app: Application) {
new HandlerService(app, {});
@@ -40,8 +41,8 @@ export class GVGBattleHandler {
async getTeams(msg: {}, session: BackendSession) {
const roleId = session.get('roleId');
const teams = await GVGTeamModel.findByRole(roleId, '-_id teamCode index head frame spine lineup')
return resResult(STATUS.SUCCESS, { teams });
return resResult(STATUS.SUCCESS, { teams: teams.map(team => new MyTeamSimpleInfo(team)) });
}
// 保存队伍
@@ -101,7 +102,7 @@ export class GVGBattleHandler {
if (!team) {
return resResult(STATUS.GVG_SAVE_TEAM_FAILED);
}
return resResult(STATUS.SUCCESS, { curTeam: pick(team, ['teamCode', 'index', 'head', 'frame', 'spine', 'lineup']) });
return resResult(STATUS.SUCCESS, { curTeam: new MyTeamSimpleInfo(team) });
}
// 获取城池信息
@@ -509,4 +510,8 @@ export class GVGBattleHandler {
// ! 重新组织每个城市的数据,添加据点和积分点的信息
return resResult(STATUS.SUCCESS, { cities });
}
async debugStartSchedule() {
await gvgBattleStartSchedule();
}
}