任务:排查及修复

This commit is contained in:
luying
2021-11-17 18:09:09 +08:00
parent 2b157c9ef4
commit 08fffc2b54
5 changed files with 24 additions and 21 deletions
@@ -112,7 +112,7 @@ export class RoleHandler {
let calResult = await calAllHeroCe(HERO_SYSTEM_TYPE.TITLE, sid, roleId, update); let calResult = await calAllHeroCe(HERO_SYSTEM_TYPE.TITLE, sid, roleId, update);
// 任务 // 任务
await checkTask(roleId, sid, TASK_TYPE.ROLE_TITLE, 1, false, { title }); await checkTask(roleId, sid, TASK_TYPE.ROLE_TITLE, 1, false, { oldTitle: title, title: update.title });
//成长任务 //成长任务
await checkActivityTask(serverId, sid, roleId, TASK_TYPE.ROLE_TITLE, update.title) await checkActivityTask(serverId, sid, roleId, TASK_TYPE.ROLE_TITLE, update.title)
+16 -16
View File
@@ -1,20 +1,20 @@
module.exports = { module.exports = {
"battle.normalBattleHandler.getBattleList": { // "battle.normalBattleHandler.getBattleList": {
'message Data': { // 'message Data': {
'message BattleList': { // 'message BattleList': {
'required uInt32 battleId': 1, // 'required uInt32 battleId': 1,
'required uInt32 status': 2, // 'required uInt32 status': 2,
'required uInt32 star': 3, // 'required uInt32 star': 3,
'repeated uInt32 stars': 4, // 'repeated uInt32 stars': 4,
'required string scriptBefore': 5, // 'optional string scriptBefore': 5,
'required string scriptAfter': 6, // 'optional string scriptAfter': 6,
}, // },
'repeated BattleList list': 1 // 'repeated BattleList list': 1
}, // },
'required string msg': 1, // 'required string msg': 1,
'required uInt32 code': 2, // 'required uInt32 code': 2,
'required Data data': 3 // 'required Data data': 3
}, // },
// "battle.normalBattleHandler.checkBattle": { // "battle.normalBattleHandler.checkBattle": {
// 'message Data': { // 'message Data': {
// "optional uInt32 battleId": 1, // "optional uInt32 battleId": 1,
+1
View File
@@ -20,6 +20,7 @@ export class TaskParam {
heroScores?: HeroScore[]; heroScores?: HeroScore[];
rankLv?: number; rankLv?: number;
title?: number; title?: number;
oldTitle?: number;
job?: number; job?: number;
aid?: number; aid?: number;
isDebug?: boolean; isDebug?: boolean;
+2
View File
@@ -287,6 +287,7 @@ export class CreateHeroes extends UpdateHeroes {
// 皮肤使用初始加载进内存的数据 // 皮肤使用初始加载进内存的数据
let skins = await this.getSkinsOfThisHero(hid, { ...skinInfo, _id: new SkinModel()._id }, false); let skins = await this.getSkinsOfThisHero(hid, { ...skinInfo, _id: new SkinModel()._id }, false);
initHeroInfos.push({ ...heroInfo, skins, _id: new HeroModel()._id }); initHeroInfos.push({ ...heroInfo, skins, _id: new HeroModel()._id });
this.heroNum ++;
} }
// 武将使用初始加载数据插入 // 武将使用初始加载数据插入
this.resultHeroes = await HeroModel.insertHeroes(this.roleId, this.roleName, this.serverId, initHeroInfos); this.resultHeroes = await HeroModel.insertHeroes(this.roleId, this.roleName, this.serverId, initHeroInfos);
@@ -310,6 +311,7 @@ export class CreateHeroes extends UpdateHeroes {
let model = new SkinModel(); let model = new SkinModel();
let skins = await this.getSkinsOfThisHero(hid, { ...skinInfo, _id: model._id }, true); let skins = await this.getSkinsOfThisHero(hid, { ...skinInfo, _id: model._id }, true);
heroeInfos.push({ ...heroInfo, skins, _id: new HeroModel()._id}); heroeInfos.push({ ...heroInfo, skins, _id: new HeroModel()._id});
this.heroNum ++;
} }
this.resultHeroes = await HeroModel.insertHeroes(this.roleId, this.roleName, this.serverId, heroeInfos); this.resultHeroes = await HeroModel.insertHeroes(this.roleId, this.roleName, this.serverId, heroeInfos);
} }
+4 -4
View File
@@ -79,7 +79,7 @@ export async function checkTaskWithHeroes(roleId: string, taskType: number, hero
let pushMessage = new Array<TaskListReturn>(); let pushMessage = new Array<TaskListReturn>();
for (let hero of heroes) { for (let hero of heroes) {
let singlePush = await checkTaskWithHero(roleId, taskType, hero, []); let singlePush = await checkTaskWithHero(roleId, taskType, hero, []);
pushMessage.concat(singlePush); pushMessage.push(...singlePush);
} }
return pushMessage return pushMessage
} }
@@ -342,7 +342,7 @@ export async function checkTaskRec(roleId: string, type: number, group: number,
let checkHistory = false; // 是否检查历史 let checkHistory = false; // 是否检查历史
switch (taskType) { switch (taskType) {
case TASK_TYPE.ROLE_TITLE: case TASK_TYPE.ROLE_TITLE:
isMatch = taskParam[0] == param.title; isMatch = param.title >= taskParam[0] && param.oldTitle < taskParam[0];
checkHistory = true; checkHistory = true;
break; break;
case TASK_TYPE.HERO_STAR_UP: case TASK_TYPE.HERO_STAR_UP:
@@ -369,9 +369,9 @@ export async function checkTaskRec(roleId: string, type: number, group: number,
break; break;
case TASK_TYPE.EQUIP_BY_HERO: case TASK_TYPE.EQUIP_BY_HERO:
isMatch = false; isMatch = false;
if (param.isPutOn && param.count == taskParam[1]) { // 装上之后达到 +1 if (param.isPutOn == 1 && param.count == taskParam[1]) { // 装上之后达到 +1
isMatch = true; isMatch = true;
} else if (!param.isPutOn && param.count < taskParam[1]) { // 脱下后不能达到 -1 } else if (param.isPutOn == -1 && param.count < taskParam[1]) { // 脱下后不能达到 -1
isMatch = true; isMatch = true;
} }
break; break;