diff --git a/game-server/app/servers/guild/handler/gvgBattleHandler.ts b/game-server/app/servers/guild/handler/gvgBattleHandler.ts index 33ff180d2..2d65a5e80 100644 --- a/game-server/app/servers/guild/handler/gvgBattleHandler.ts +++ b/game-server/app/servers/guild/handler/gvgBattleHandler.ts @@ -474,6 +474,7 @@ export class GVGBattleHandler { if(!record) return resResult(STATUS.GVG_BATTLEREC_NOT_FOUND); if(record.battleEndTime > 0) return resResult(STATUS.GVG_BATTLEREC_HAS_SUMMIT); let { attackTeam, defenseTeam } = await GVGTeamModel.findBattleTeams(record.attackTeam.teamCode, record.defenseTeam.teamCode); + let attackOriginId = attackTeam.pointId; if(defenseTeam.lockTeamCode != attackTeam.teamCode) return resResult(STATUS.GVG_LOCK_TIME_OUT) let groupKey = await getGroupKey(serverId); @@ -498,10 +499,8 @@ export class GVGBattleHandler { if(defenseTeam.curTeamBreak) { let attackScore = calBattleScoreByCe(isSuccess, defenseTeam.lineupCe); let attackCurTeamBreak = attackTeam.curTeamBreak; - let originPointId = attackTeam.originPointId; attackTeam = await GVGTeamModel.addScore(attackTeam.teamCode, attackScore, 0); attackTeam.curTeamBreak = attackCurTeamBreak; - attackTeam.originPointId = originPointId; await redisAddBattleScore(attackTeam, attackScore); } @@ -510,7 +509,7 @@ export class GVGBattleHandler { teamObj.battleEnd([attackTeam, defenseTeam]); // 更新rec let rec = await GVGBattleRecModel.battleEnd(battleCode, isSuccess, attackTeam, defenseTeam); - await battleEndSendMessage(groupKey, cityId, defenseTeam, attackTeam, GVG_ATTACK_TYPE.PLAYER); + await battleEndSendMessage(groupKey, cityId, defenseTeam, {...attackTeam, originPointId: attackOriginId}, GVG_ATTACK_TYPE.PLAYER); addBattleEndRec(rec); return resResult(STATUS.SUCCESS, { curTeam: new MyTeamInfo(attackTeam), oppTeam: new MyTeamInfo(defenseTeam) }); @@ -533,6 +532,7 @@ export class GVGBattleHandler { let groupKey = await getGroupKey(serverId); let { attackTeam, defenseTeam } = await GVGTeamModel.findBattleTeams(teamCode, oppoTeamCode); + let attackOriginId = attackTeam.pointId; let checkStatus = checkGVGBattleStart(roleId, attackTeam, defenseTeam); if(checkStatus.code != 0) return resResult(checkStatus); @@ -565,7 +565,7 @@ export class GVGBattleHandler { let teamObj = getGVGBattleData(groupKey); teamObj.battleEnd([attackTeam, defenseTeam]); - await battleEndSendMessage(groupKey, cityId, defenseTeam, attackTeam, GVG_ATTACK_TYPE.KNIFE); + await battleEndSendMessage(groupKey, cityId, defenseTeam, {...attackTeam, originPointId: attackOriginId}, GVG_ATTACK_TYPE.KNIFE); return resResult(STATUS.SUCCESS, { curTeam: new MyTeamInfo(attackTeam), oppTeam: new MyTeamInfo(defenseTeam) }); } diff --git a/game-server/app/services/gvg/gvgBattleService.ts b/game-server/app/services/gvg/gvgBattleService.ts index 7f5f9398b..8233ba8af 100644 --- a/game-server/app/services/gvg/gvgBattleService.ts +++ b/game-server/app/services/gvg/gvgBattleService.ts @@ -672,14 +672,13 @@ export async function battleEndSendMessage(groupKey: string, cityId: number, def // 队伍移动 export async function pushTeamBeHurtMessage(team: GVGTeamType, replaceTeam?: GVGTeamType) { - if(team.curTeamBreak && team.originPointId > 0) { await sendMessageToGVGAreaByTeamWithSuc(team.groupKey, team.fromAreaId, PUSH_ROUTE.GVG_AREA_POINT_CHANGE, { - cityId: team.cityId, areaId: team.fromAreaId, targetPointId: team.originPointId, originPointId: replaceTeam?.pointId??0, point: new GVGTeamInListOnPoint(team.pointId, true, team) + cityId: team.cityId, areaId: team.fromAreaId, targetPointId: team.originPointId, originPointId: replaceTeam?.originPointId??0, point: new GVGTeamInListOnPoint(replaceTeam.pointId||team.pointId, true, replaceTeam||team) }); - if(!team.curTeamBreak) { + if(!replaceTeam.curTeamBreak && replaceTeam.originPointId > 0) { await sendMessageToGVGAreaByTeamWithSuc(replaceTeam.groupKey, replaceTeam.fromAreaId, PUSH_ROUTE.GVG_AREA_POINT_CHANGE, { - cityId: replaceTeam.cityId, areaId: replaceTeam.fromAreaId, targetPointId: replaceTeam.pointId, originPointId: replaceTeam.originPointId, point: new GVGTeamInListOnPoint(replaceTeam.pointId, true, replaceTeam) + cityId: replaceTeam.cityId, areaId: replaceTeam.fromAreaId, targetPointId: replaceTeam.originPointId, originPointId: 0, point: new GVGTeamInListOnPoint(replaceTeam.pointId, true, replaceTeam) }); } }