diff --git a/game-server/app/servers/battle/handler/expeditionBattleHandler.ts b/game-server/app/servers/battle/handler/expeditionBattleHandler.ts index 9cd7d80ab..58bbde3b8 100644 --- a/game-server/app/servers/battle/handler/expeditionBattleHandler.ts +++ b/game-server/app/servers/battle/handler/expeditionBattleHandler.ts @@ -217,6 +217,10 @@ export class ExpeditionBattleHandler { if (!expeditionRecord || !expeditionWarRecord) { return resResult(STATUS.EXPEDITION_MISS_WAR_RECORD); } + if(expeditionWarRecord.battleStatus == EXPEDITION_WAR_RECORD_STATUS.SUCCESS) { + return resResult(STATUS.EXPEDITION_DUPLICATE_CHALLENGE); + } + // 更新敌人剩余状态及战斗状态 expeditionWarRecord = await ExpeditionWarRecordModel.updateEnemiesStatus(expeditionCode, expeditionId, EXPEDITION_WAR_RECORD_STATUS.SUCCESS, []); // 更新点数 @@ -236,6 +240,13 @@ export class ExpeditionBattleHandler { if (gameData.expedition.has(expeditionId + 1)) { await findOrCreateEnemies(roleId, expeditionRecord.myCe, expeditionCode, expeditionId + 1, EXPEDITION_WAR_RECORD_STATUS.WAITING); } + + let expeditionWarRecords = await ExpeditionWarRecordModel.getRecordByCode(expeditionCode); + let curLv = 0; + if (expeditionWarRecords.length > 0) { + curLv = expeditionWarRecords[expeditionWarRecords.length - 1].expeditionId; + } + await checkTaskInSkipExpedition(serverId, roleId, sid, battleId); return resResult(STATUS.SUCCESS, { @@ -243,7 +254,9 @@ export class ExpeditionBattleHandler { expeditionId, battleId, goods: reward, - expeditionPoint: role.expeditionPoint + expeditionPoint: role.expeditionPoint, + expeditionWarRecord: expeditionWarRecords, + curLv }); } diff --git a/game-server/app/services/expeditionService.ts b/game-server/app/services/expeditionService.ts index 311f9c0b4..2d9733754 100644 --- a/game-server/app/services/expeditionService.ts +++ b/game-server/app/services/expeditionService.ts @@ -67,7 +67,7 @@ export async function getExpeditionStatus(roleId: string, roleName: string, isEn */ export async function findOrCreateEnemies(roleId: string, myCe: number, expeditionCode: string, expeditionId: number, battleStatus: number) { - let expeditionWarRecord = await ExpeditionWarRecordModel.getRecordByCodeAndId(expeditionCode, expeditionId); + let expeditionWarRecord = await ExpeditionWarRecordModel.updateStatus(expeditionCode, expeditionId, battleStatus); if(!expeditionWarRecord) { // 如果没有信息 let curDicExpedition = gameData.expedition.get(expeditionId); if(curDicExpedition) {