pvp结算展示
This commit is contained in:
@@ -20,6 +20,7 @@ import { existsRank, initRank, getRank, setRank, getMyRank } from '../../../serv
|
||||
import { handleCost } from '../../../services/rewardService';
|
||||
import { nowSeconds } from '../../../pubUtils/timeUtil';
|
||||
import { setPvpSeasonResult, resetPvpWarId, resetPvpSeasonTime } from '../../../services/timeTaskService';
|
||||
import { PvpSeasonResultModel } from '../../../db/PvpSeasonResult';
|
||||
export default function(app: Application) {
|
||||
return new PvpHandler(app);
|
||||
}
|
||||
@@ -93,12 +94,30 @@ export class PvpHandler {
|
||||
if (isFirstEntry) {
|
||||
await PvpDefenseModel.updateInfo(roleId, {isFirstEntry:false});
|
||||
}
|
||||
let myRank = await getMyRank(REDIS_KEY.PVP_RANK, 0, roleId);//去redis中获取排名
|
||||
let pvpSeasonResult = await PvpSeasonResultModel.getPvpSeasonResult(roleId);
|
||||
|
||||
if (!!pvpSeasonResult) {
|
||||
var { oldSeasonData, show } = pvpSeasonResult;
|
||||
if ( oldSeasonData.seasonEndTime > nowSeconds()) {
|
||||
seasonEndTime = oldSeasonData.seasonEndTime;
|
||||
heroScores = oldSeasonData.heroScores;
|
||||
score = oldSeasonData.score;
|
||||
winStreakNum = oldSeasonData.winStreakNum;
|
||||
refOppCnt = oldSeasonData.refOppCnt;
|
||||
challengeCnt = oldSeasonData.challengeCnt;
|
||||
challengeRefTime = oldSeasonData.challengeRefTime;
|
||||
} else if(show) {
|
||||
await PvpSeasonResultModel.updatePvpSeasonResult(roleId, {show: false})
|
||||
}
|
||||
}
|
||||
|
||||
let myRank = await getMyRank(REDIS_KEY.PVP_RANK, 0, roleId);//去redis中获取排名
|
||||
|
||||
let data = {warId, seasonNum, seasonEndTime, myRank, oppPlayers, heroes: heroes.map(cur => {
|
||||
let {actorId, dataId, order} = cur;
|
||||
return { actorId, dataId, order }
|
||||
}), score, pLv, winStreakNum, refOppCnt, challengeCnt, challengeRefTime, receivedBox, hisScore, heroScores, isFirstEntry, isDefaultHero}
|
||||
}), score, pLv, winStreakNum, refOppCnt, challengeCnt, challengeRefTime, receivedBox, hisScore, heroScores, isFirstEntry, isDefaultHero, oldSeasonData, show }
|
||||
|
||||
return resResult(STATUS.SUCCESS, data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user