巅峰演武:赛季防守阵容修改

This commit is contained in:
luying
2022-10-18 18:01:03 +08:00
parent 3752075255
commit 7daf28172e
13 changed files with 4012 additions and 212 deletions
@@ -2,7 +2,7 @@
import { Application, BackendSession, pinus, HandlerService, } from 'pinus';
import { findIndex } from 'underscore';
import { gameData, getPvpBoxBySeasonNumAndIndex } from '../../../pubUtils/data';
import { refreshEnemies, getEnemies, refChallengeCnt, generPVPOppRecInfo, generMyRecInfo, sendLastSeasonRewardIfNotSent, refreshRefOppCnt, generPvpLineupCe, calLineupScore, checkPvpSeasonIsStart, checkPvpSeasonIsSummit } from '../../../services/pvpService';
import { refreshEnemies, getEnemies, refChallengeCnt, generPVPOppRecInfo, generMyRecInfo, sendLastSeasonRewardIfNotSent, refreshRefOppCnt, generPvpLineupCe, calLineupScore, checkPvpSeasonIsStart, checkPvpSeasonIsSummit, getPvpSeasonStatus, checkPvpSeasonIsWaiting } from '../../../services/pvpService';
import { RoleModel, RoleType } from '../../../db/Role';
import { STATUS } from '../../../consts/statusCode';
import { resResult, genCode, checkRoleIsRobot, robotIdComBack } from '../../../pubUtils/util';
@@ -394,13 +394,16 @@ export class PvpHandler {
let list: pvpSaveDataReturn[] = [];
for(let warId of (pvpConfig.warIds||[])) {
let data = new pvpSaveDataReturn(warId);
let curSaveData = saveDatas.find(cur => cur.warId == warId);
data.setUserSaveData(curSaveData);
if(pvpDefense.defense?.warId == warId) {
data.setAsUsing();
let dicWar = gameData.war.get(warId);
if(dicWar && dicWar.selectView == 1) {
let data = new pvpSaveDataReturn(warId);
let curSaveData = saveDatas.find(cur => cur.warId == warId);
data.setUserSaveData(curSaveData);
if(pvpDefense.defense?.warId == warId) {
data.setAsUsing();
}
list.push(data);
}
list.push(data);
}
return resResult(STATUS.SUCCESS, { list });
}
@@ -467,6 +470,9 @@ export class PvpHandler {
let roleId = session.get('roleId');
let seasonNum: number = this.app.get('pvpSeasonNum');
if(checkPvpSeasonIsWaiting()) { // 休赛期
seasonNum ++;
}
let r = new Rank(REDIS_KEY.PVP_RANK, { seasonNum });
let { ranks, myRank } = await r.getRankListWithMyRank({ roleId });