🐞 fix(icon): 修复防守方失败且排名不变不推送提示
This commit is contained in:
@@ -235,7 +235,7 @@ export class LadderHandler {
|
|||||||
|
|
||||||
await checkTaskInLadderEnd(serverId, roleId, sid, isSuccess, historyRank, atkLadderMatch.rank);
|
await checkTaskInLadderEnd(serverId, roleId, sid, isSuccess, historyRank, atkLadderMatch.rank);
|
||||||
|
|
||||||
if (isSuccess && (!rec.defenseInfo?.isRobot)) await pushLadderIconShow(rec.roleId2, true);
|
if (isSuccess && (!rec.defenseInfo?.isRobot) && rec.defenseInfo.oldRank < rec.defenseInfo.newRank) await pushLadderIconShow(rec.roleId2, true);
|
||||||
return resResult(STATUS.SUCCESS, {...pick(result, ['rank', 'historyRank', 'challengeCnt','status', 'time', 'oppPlayers']), battleGoods, breakGoods});
|
return resResult(STATUS.SUCCESS, {...pick(result, ['rank', 'historyRank', 'challengeCnt','status', 'time', 'oppPlayers']), battleGoods, breakGoods});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ export class GVGProduceHandler {
|
|||||||
|
|
||||||
await saveScoreToRank(rec);
|
await saveScoreToRank(rec);
|
||||||
addVestigeBattleEndRec(rec);
|
addVestigeBattleEndRec(rec);
|
||||||
if (isSuccess && (!rec.defenseInfo?.isRobot)) await pushGvgFightIconShow(rec.defenseRoleId, battleCode);
|
if (isSuccess && (!rec.defenseInfo?.isRobot) && rec.defenseInfo.oldRank < rec.defenseInfo.newRank) await pushGvgFightIconShow(rec.defenseRoleId, battleCode);
|
||||||
|
|
||||||
return resResult(STATUS.SUCCESS, {
|
return resResult(STATUS.SUCCESS, {
|
||||||
vestigeId: rec.vestigeId,
|
vestigeId: rec.vestigeId,
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ export default class GVGVestigeRec extends BaseModel {
|
|||||||
const recs: GVGVestigeRecType[] = await GVGVestigeRecModel.aggregate(pipeline);
|
const recs: GVGVestigeRecType[] = await GVGVestigeRecModel.aggregate(pipeline);
|
||||||
if (recs.length > 0) {
|
if (recs.length > 0) {
|
||||||
for(const obj of recs){
|
for(const obj of recs){
|
||||||
if(obj.defenseRoleId == roleId && (!obj.defenseInfo.isSuccess)) result.push(obj);
|
if(obj.defenseRoleId == roleId && (!obj.defenseInfo.isSuccess) && obj.defenseInfo.newRank > obj.defenseInfo.oldRank ) result.push(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,11 +137,11 @@ export default class LadderMatchRec extends BaseModel {
|
|||||||
{ $match: { endTime: { $gt: quitTime }, $or: [{ roleId1: roleId }, { roleId2: roleId }], status: LADDER_STATUS.COMPLETE } },
|
{ $match: { endTime: { $gt: quitTime }, $or: [{ roleId1: roleId }, { roleId2: roleId }], status: LADDER_STATUS.COMPLETE } },
|
||||||
{ $sort: { endTime: -1 } },
|
{ $sort: { endTime: -1 } },
|
||||||
// { $limit: 1 },
|
// { $limit: 1 },
|
||||||
{ $project: { _id: 0, roleId2: 1, "defenseInfo.isSuccess": 1 } }
|
{ $project: { _id: 0, roleId2: 1, "defenseInfo.isSuccess": 1, "defenseInfo.oldRank": 1, "defenseInfo.newRank": 1} }
|
||||||
];
|
];
|
||||||
const recs: LadderMatchRecType[] = await LadderMatchRecModel.aggregate(pipeline);
|
const recs: LadderMatchRecType[] = await LadderMatchRecModel.aggregate(pipeline);
|
||||||
for (let obj of recs) {
|
for (let obj of recs) {
|
||||||
if (obj.roleId2 === roleId && (!obj.defenseInfo.isSuccess)) return true;
|
if (obj.roleId2 === roleId && (!obj.defenseInfo.isSuccess) && obj.defenseInfo.newRank > obj.defenseInfo.oldRank) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user