pvp:巅峰之路
This commit is contained in:
@@ -35,7 +35,7 @@ import { getAllOnlineRoles, getAllServers } from './redisService';
|
||||
import Item, { ItemModel } from '../db/Item';
|
||||
import { PvpDefenseModel } from '../db/PvpDefense';
|
||||
import { getDonation } from './donateService';
|
||||
import { refChallengeCnt } from './pvpService';
|
||||
import { refChallengeCnt, sendLastSeasonRewardIfNotSent } from './pvpService';
|
||||
import { HeroModel } from '../db/Hero';
|
||||
import { JewelModel } from '../db/Jewel';
|
||||
import { SkinModel } from '../db/Skin';
|
||||
@@ -248,12 +248,14 @@ async function getTowerEntryData(role: RoleType) {
|
||||
async function getPvpEntryData(roleId: string) {
|
||||
let pvpDefense = await PvpDefenseModel.findByRoleId(roleId);
|
||||
if (pvpDefense) {
|
||||
let seasonEndTime = pinus.app.get('pvpSeasonEndTime');
|
||||
pvpDefense = await sendLastSeasonRewardIfNotSent(pvpDefense);
|
||||
let seasonNum: number = pinus.app.get('pvpSeasonNum');
|
||||
let seasonEndTime: number = pinus.app.get('pvpSeasonEndTime');
|
||||
let refChallengeObj = await refChallengeCnt(pvpDefense.challengeCnt, pvpDefense.challengeRefTime, seasonEndTime, roleId);
|
||||
let { challengeCnt } = refChallengeObj;
|
||||
let { receivedBox, score, hisScore } = pvpDefense;
|
||||
let { receivedBox, score, seasonWinNum } = pvpDefense;
|
||||
|
||||
return { challengeCnt, score, hisScore, receivedBox }
|
||||
return { challengeCnt, score, seasonWinNum, receivedBox, seasonNum, seasonEndTime }
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user