From 6fae9646c94dc12c84b739a762537342205bda01 Mon Sep 17 00:00:00 2001 From: luying Date: Sat, 9 Jan 2021 14:57:31 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug=20=E8=BF=9E=E8=83=9C=E6=AC=A1?= =?UTF-8?q?=E6=95=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/servers/battle/handler/pvpHandler.ts | 7 +++++++ game-server/app/services/pvpService.ts | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) 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 } } // 获取对手战报记录