pvp:修复存储roleId字段

This commit is contained in:
luying
2021-11-08 15:52:57 +08:00
parent ff3e2cb244
commit 297f0d6b8f
2 changed files with 10 additions and 7 deletions
+8 -5
View File
@@ -559,13 +559,13 @@ export async function sendPVPRewardToUser(pvpDefense: PvpDefenseType, seasonNum:
async function resetPvpScores(pvpDefense: PvpDefenseType, seasonNum: number, pvpSeasonResult: PvpSeasonResultType) {
let { roleId, attack, defense } = pvpDefense;
let { heroScores, score } = pvpSeasonResult;
let { newHeroScores, newScore } = pvpSeasonResult;
let newAttack = <Attack>calLineupScore(attack, heroScores);
let newDefense = <Defense>calLineupScore(defense, heroScores);
let newAttack = <Attack>calLineupScore(attack, newHeroScores);
let newDefense = <Defense>calLineupScore(defense, newHeroScores);
pvpDefense = await PvpDefenseModel.updateInfoAndInclude(roleId, {
heroScores, score, attack: newAttack, defense: newDefense,
heroScores: newHeroScores, score: newScore, attack: newAttack, defense: newDefense,
seasonNum, challengeCnt: PVP.PVP_CHALLENGE_COUNTS, challengeRefTime: 0, winStreakNum: 0
});
return pvpDefense;
@@ -599,8 +599,11 @@ export async function savePvpSeasonResult(pvpDefense: PvpDefenseType, seasonNum:
hid: heroScore.hid, id, count
});
}
newScore += pvpHeroReward.heroscore;
} else {
newHeroScores.push(heroScore);
newScore += heroScore.score;
}
newScore += heroScore.score;
}
//pvp锁定的信息存入赛季结算表中