军团:bug修复

This commit is contained in:
luying
2021-09-26 18:43:49 +08:00
parent 023490c642
commit e952580ac8
9 changed files with 52 additions and 30 deletions

View File

@@ -100,7 +100,7 @@ export class GuildTrainHandler {
const { guildCode: code } = userGuild;
if (userGuild.trainCount <= 0)
return resResult(STATUS.GUILD_TRAIN_BATTLE_COUNT_NOT_ENOUGH);
let { trainId: curTeainId, trainLv } = await GuildModel.findGuild(code, serverId, 'trainId');
let { trainId: curTeainId, trainLv } = await GuildModel.findGuild(code, serverId, 'trainId trainLv');
if (curTeainId !== trainId)
return resResult(STATUS.GUILD_TRAIN_LEVEL_IS_COMPLETE);
let guildTrain = await GuildTrainModel.findTrainByTrainIdNotLock(code, trainId, 'trainId isComplete trainInstances');
@@ -191,7 +191,7 @@ export class GuildTrainHandler {
}
let addScore = Math.floor((isSuccess ? trainSoloReward.winScore : trainSoloReward.failScore));//个人获得积分,也是压制进度
//个人功勋奖励
let goods = await addItems(roleId, roleName, sid, [{ id: CURRENCY_BY_TYPE.get(CURRENCY_TYPE.HONOUR), count: Math.floor((isSuccess ? trainSoloReward.winHonour : trainSoloReward.failHonour) * (soloRewardRatio + 100) / 100) }]);
let goods = await addItems(roleId, roleName, sid, [{ id: CURRENCY_BY_TYPE.get(CURRENCY_TYPE.HONOUR), count: Math.floor((isSuccess ? trainSoloReward.winHonour : trainSoloReward.failHonour) * soloRewardRatio) }]);
let { isComplete, ranks } = guildTrain;
let reports = [];
// let index = findIndex(ranks, { roleId });
@@ -224,6 +224,7 @@ export class GuildTrainHandler {
reports.push({ type: 3, time: nowSeconds(), score: addScore, roleName, trainId, hid, difficulty });
pushGuildTrainSucMsg(roleId, roleName, code, hid);
if (needLockNext && maxTrainId > trainId) {
guildTrain = await unlockTrain(code, trainId + 1);
}