fix 未找到对手

This commit is contained in:
luying
2021-01-15 19:04:26 +08:00
parent eac517c57b
commit d7cc9c87df

View File

@@ -261,6 +261,9 @@ export class PvpHandler {
// 战报记录
await PvpRecordModel.createRec({roleId1: roleId, roleId2: robotIdComBack(oppRoleId), warId: BattleRecord.battleId, attackInfo, defenseInfo, createTime: nowSeconds()});
// 对手记录更新
await PvpHistoryOppModel.setStatus(roleId, oppRoleId, 1);
// 刷新对手
let newOppPlayers: Array<OppPlayers> = await refreshEnemies(role, score, pLv);
@@ -283,9 +286,6 @@ export class PvpHandler {
await setRank(REDIS_KEY.PVP_RANK, 0, roleId, pvpDefense.score, pvpDefense.updatedAt.getTime(), params);
let myRank = await getMyRank(REDIS_KEY.PVP_RANK, 0, roleId);
// 对手记录更新
await PvpHistoryOppModel.setStatus(roleId, oppRoleId, 1);
return resResult(STATUS.SUCCESS, {
battleCode, isSuccess,
score, pLv, myRank, hisScore,