diff --git a/game-server/app/servers/battle/handler/pvpHandler.ts b/game-server/app/servers/battle/handler/pvpHandler.ts index ee4852568..3ea25d84c 100644 --- a/game-server/app/servers/battle/handler/pvpHandler.ts +++ b/game-server/app/servers/battle/handler/pvpHandler.ts @@ -169,7 +169,14 @@ export class PvpHandler { if(!curOpp) return resResult(STATUS.PVP_ROLE_NOT_FOUND); const role = await RoleModel.findByRoleId(roleId); + const myRecInfo = await generMyRecInfo(heroScores, winStreakNum, role, isSuccess, pos, myHeroes); + if(isSuccess) { + winStreakNum ++; + } else { + winStreakNum = 0; + } + let { attackInfo, showHeroScores, addSumScore } = myRecInfo score += addSumScore; diff --git a/game-server/app/services/pvpService.ts b/game-server/app/services/pvpService.ts index 6fb4eee54..831a7e064 100644 --- a/game-server/app/services/pvpService.ts +++ b/game-server/app/services/pvpService.ts @@ -445,12 +445,10 @@ export async function generMyRecInfo(heroScores: HeroScores[], winStreakNum: num showHeroScores.push({ hid, addScore: dicOpp.score, plusScore, score: curHeroScore.score }); - winStreakNum++; } else { showHeroScores.push({ hid, addScore: 0, plusScore: 0, score: curHeroScore.score }); - winStreakNum = 0; } const myHero = await HeroModel.findByHidAndRole(hid, roleId, 'quality star colorStar lv'); let { quality, star, colorStar, lv } = myHero; @@ -472,7 +470,7 @@ export async function generMyRecInfo(heroScores: HeroScores[], winStreakNum: num score: isSuccess ? addSumScore : 0 } - return { attackInfo, showHeroScores, winStreakNum, addSumScore } + return { attackInfo, showHeroScores, addSumScore } } // 获取对手战报记录