diff --git a/game-server/app/services/connectorService.ts b/game-server/app/services/connectorService.ts index 0d3f8ecdd..a313a8fdb 100644 --- a/game-server/app/services/connectorService.ts +++ b/game-server/app/services/connectorService.ts @@ -256,13 +256,14 @@ async function getTowerEntryData(role: RoleType) { * @param roleId */ 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); if (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(); // 返回对象 result.setPvpConfig(seasonNum, seasonStartTime, seasonEndTime, seasonRewardTime); @@ -273,7 +274,9 @@ async function getPvpEntryData(roleId: string) { result.setChallengeCnt(challengeCnt); return pick(result, ['challengeCnt', 'score', 'seasonWinNum', 'receivedBox', 'hasSaveDefense', 'seasonNum', 'seasonEndTime', 'seasonStartTime', 'seasonRewardTime']) } else { - return null + let result = new PvpDataReturn(); // 返回对象 + result.setPvpConfig(seasonNum, seasonStartTime, seasonEndTime, seasonRewardTime); + return pick(result, ['seasonNum', 'seasonEndTime', 'seasonStartTime', 'seasonRewardTime']) } }