🐞 fix(巅峰演武): 当没有pvp数据时,登录也还是下发
This commit is contained in:
@@ -256,13 +256,14 @@ async function getTowerEntryData(role: RoleType) {
|
|||||||
* @param roleId
|
* @param roleId
|
||||||
*/
|
*/
|
||||||
async function getPvpEntryData(roleId: string) {
|
async function getPvpEntryData(roleId: string) {
|
||||||
|
let seasonNum: number = pinus.app.get('pvpSeasonNum');
|
||||||
|
let seasonEndTime: number = pinus.app.get('pvpSeasonEndTime');
|
||||||
|
let seasonStartTime: number = pinus.app.get('pvpSeasonStartTime');
|
||||||
|
let seasonRewardTime: number = pinus.app.get('pvpSeasonRewardTime');
|
||||||
|
|
||||||
let pvpDefense = await PvpDefenseModel.findByRoleId(roleId);
|
let pvpDefense = await PvpDefenseModel.findByRoleId(roleId);
|
||||||
if (pvpDefense) {
|
if (pvpDefense) {
|
||||||
pvpDefense = await sendLastSeasonRewardIfNotSent(pvpDefense);
|
pvpDefense = await sendLastSeasonRewardIfNotSent(pvpDefense);
|
||||||
let seasonNum: number = pinus.app.get('pvpSeasonNum');
|
|
||||||
let seasonEndTime: number = pinus.app.get('pvpSeasonEndTime');
|
|
||||||
let seasonStartTime: number = pinus.app.get('pvpSeasonStartTime');
|
|
||||||
let seasonRewardTime: number = pinus.app.get('pvpSeasonRewardTime');
|
|
||||||
|
|
||||||
let result = new PvpDataReturn(); // 返回对象
|
let result = new PvpDataReturn(); // 返回对象
|
||||||
result.setPvpConfig(seasonNum, seasonStartTime, seasonEndTime, seasonRewardTime);
|
result.setPvpConfig(seasonNum, seasonStartTime, seasonEndTime, seasonRewardTime);
|
||||||
@@ -273,7 +274,9 @@ async function getPvpEntryData(roleId: string) {
|
|||||||
result.setChallengeCnt(challengeCnt);
|
result.setChallengeCnt(challengeCnt);
|
||||||
return pick(result, ['challengeCnt', 'score', 'seasonWinNum', 'receivedBox', 'hasSaveDefense', 'seasonNum', 'seasonEndTime', 'seasonStartTime', 'seasonRewardTime'])
|
return pick(result, ['challengeCnt', 'score', 'seasonWinNum', 'receivedBox', 'hasSaveDefense', 'seasonNum', 'seasonEndTime', 'seasonStartTime', 'seasonRewardTime'])
|
||||||
} else {
|
} else {
|
||||||
return null
|
let result = new PvpDataReturn(); // 返回对象
|
||||||
|
result.setPvpConfig(seasonNum, seasonStartTime, seasonEndTime, seasonRewardTime);
|
||||||
|
return pick(result, ['seasonNum', 'seasonEndTime', 'seasonStartTime', 'seasonRewardTime'])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user