From 13570982f4ecc2962fe25d8243bbcd425fce6e0a Mon Sep 17 00:00:00 2001 From: luying Date: Thu, 14 Jan 2021 18:37:13 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=88=B7=E6=96=B0=E5=AF=B9=E6=89=8B?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=89=BE=E5=88=B0=E6=AD=A6=E5=B0=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/pvpService.ts | 6 +- shared/db/PvpDefense.ts | 8 ++- shared/pubUtils/interface.ts | 4 +- shared/pubUtils/playerCe.ts | 2 +- shared/resource/jsons/dic_zyz_event.json | 72 ++++++++++++------------ 5 files changed, 47 insertions(+), 45 deletions(-) diff --git a/game-server/app/services/pvpService.ts b/game-server/app/services/pvpService.ts index 08caf0c28..f3ad1bd76 100644 --- a/game-server/app/services/pvpService.ts +++ b/game-server/app/services/pvpService.ts @@ -138,7 +138,7 @@ export async function matchPlayerByRank(oppPlayers: OppPlayers[], mapWarJson: Di if(result.length <= 0) return false; oppRoleId = result[0]; - let pvpdefense = await PvpDefenseModel.findByRoleId(oppRoleId); + let pvpdefense = await PvpDefenseModel.findByRoleIdIncludeAll(oppRoleId); let pvpHistoryOpp = await generPlayerOppHis(pvpdefense, mapWarJson, roleId, pos); oppPlayers.push({ @@ -192,8 +192,8 @@ async function generPlayerOppHis(result: PvpDefenseType, mapWarJson: DicWarJson[ for(let warJson of mapWarJson) { if(warJson.relation == 1) continue; let h = result.heroes.find(cur => cur.dataId == warJson.dataId); - if(h) { - let hs = heroScores.find(cur => cur.hid == warJson.actorId); // 这个武将的军功 + if(h && h.hero) { + let hs = heroScores.find(cur => cur.hid == h.actorId); // 这个武将的军功 let hero = h.hero; let heroInfo = new PvpHeroInfo(); heroInfo.setHeroInfo(hero); diff --git a/shared/db/PvpDefense.ts b/shared/db/PvpDefense.ts index 7c71b7fd0..f485f4ea6 100644 --- a/shared/db/PvpDefense.ts +++ b/shared/db/PvpDefense.ts @@ -201,14 +201,18 @@ export default class PvpDefense extends BaseModel { public static async findByRoleIdIncludeAll(roleId: string) { const result: PvpDefenseType = await PvpDefenseModel.findOne({ roleId }) - .populate('role', 'headHid sHid topFiveCe roleId roleName lv') + .populate('role', 'headHid sHid topFiveCe roleId roleName lv globalCeAttr') .populate('heroes.hero') .populate('oppPlayers.oppDef', 'oppRoleId pos roleName headHid sHid rankLv pLv defCe heroes').lean(); return result; } public static async findByTeamLv(min: number, max: number) { - const result: PvpDefenseType[] = await PvpDefenseModel.find({ pLv: { $gte: min, $lte: max } }).lean(); + const result: PvpDefenseType[] = await PvpDefenseModel.find({ pLv: { $gte: min, $lte: max } }) + .populate('role', 'headHid sHid topFiveCe roleId roleName lv globalCeAttr') + .populate('heroes.hero') + .populate('oppPlayers.oppDef', 'oppRoleId pos roleName headHid sHid rankLv pLv defCe heroes') + .lean(); return result; } diff --git a/shared/pubUtils/interface.ts b/shared/pubUtils/interface.ts index d6f8885f1..a38a86c6e 100644 --- a/shared/pubUtils/interface.ts +++ b/shared/pubUtils/interface.ts @@ -1,9 +1,7 @@ // 一些通用的interface定义 -import { RoleType } from "../db/Role"; -import { Robot } from "../db/PvpDefense"; import { reduceCe } from "./util"; -import { PvpHeroInfo, PvpEnemies } from "../db/generalField"; +import { PvpEnemies } from "../db/generalField"; export interface RewardInter { id: number; diff --git a/shared/pubUtils/playerCe.ts b/shared/pubUtils/playerCe.ts index 373ce10f6..c8564a38e 100644 --- a/shared/pubUtils/playerCe.ts +++ b/shared/pubUtils/playerCe.ts @@ -140,7 +140,7 @@ async function calculateTopFive(role: RoleType, hid: number, ce: number, heroId: } else { // 原来就是最强5人 if (ce < topFive[topFive.length - 1].ce) { // 滑出最强 let heroes = await HeroModel.getTopHero(role.roleId, 5); - topFive = heroes.map(cur => { return { hid: cur.hid, ce: cur.ce } }); + topFive = heroes.map(cur => { return { hid: cur.hid, ce: cur.ce, hero: cur._id } }); } else { topFive[index].ce = ce; } diff --git a/shared/resource/jsons/dic_zyz_event.json b/shared/resource/jsons/dic_zyz_event.json index 86d35dc0d..2e7890ca8 100644 --- a/shared/resource/jsons/dic_zyz_event.json +++ b/shared/resource/jsons/dic_zyz_event.json @@ -11,7 +11,7 @@ "suitLevel": "1&20", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "1&4", "winDialogue": "&", "loseDialogue": "&" @@ -28,7 +28,7 @@ "suitLevel": "1&20", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "2&3", "winDialogue": "&", "loseDialogue": "&" @@ -45,7 +45,7 @@ "suitLevel": "1&20", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "1&4", "winDialogue": "&", "loseDialogue": "&" @@ -62,7 +62,7 @@ "suitLevel": "1&20", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "16&17", "winDialogue": "18&", "loseDialogue": "19&" @@ -79,7 +79,7 @@ "suitLevel": "1&20", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "16&17", "winDialogue": "18&", "loseDialogue": "19&" @@ -96,7 +96,7 @@ "suitLevel": "1&20", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "20&21&22&23&24", "winDialogue": "25&", "loseDialogue": "26&" @@ -113,7 +113,7 @@ "suitLevel": "1&20", "warId": 2001, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "5&6", "winDialogue": "3&", "loseDialogue": "7&" @@ -130,7 +130,7 @@ "suitLevel": "1&20", "warId": 2002, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "27&28&29&30&31", "winDialogue": "32&33", "loseDialogue": "34&" @@ -147,7 +147,7 @@ "suitLevel": "1&20", "warId": 2003, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "8&9&10&11", "winDialogue": "12&13", "loseDialogue": "14&15" @@ -164,7 +164,7 @@ "suitLevel": "21&40", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "1&4", "winDialogue": "&", "loseDialogue": "&" @@ -181,7 +181,7 @@ "suitLevel": "21&40", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "2&3", "winDialogue": "&", "loseDialogue": "&" @@ -198,7 +198,7 @@ "suitLevel": "21&40", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "1&4", "winDialogue": "&", "loseDialogue": "&" @@ -215,7 +215,7 @@ "suitLevel": "21&40", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "16&17", "winDialogue": "18&", "loseDialogue": "19&" @@ -232,7 +232,7 @@ "suitLevel": "21&40", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "16&17", "winDialogue": "18&", "loseDialogue": "19&" @@ -249,7 +249,7 @@ "suitLevel": "21&40", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "20&21&22&23&24", "winDialogue": "25&", "loseDialogue": "26&" @@ -266,7 +266,7 @@ "suitLevel": "21&40", "warId": 2001, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "5&6", "winDialogue": "3&", "loseDialogue": "7&" @@ -283,7 +283,7 @@ "suitLevel": "21&40", "warId": 2002, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "27&28&29&30&31", "winDialogue": "32&33", "loseDialogue": "34&" @@ -300,7 +300,7 @@ "suitLevel": "21&40", "warId": 2003, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "8&9&10&11", "winDialogue": "12&13", "loseDialogue": "14&15" @@ -317,7 +317,7 @@ "suitLevel": "41&100", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "1&4", "winDialogue": "&", "loseDialogue": "&" @@ -334,7 +334,7 @@ "suitLevel": "41&100", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "2&3", "winDialogue": "&", "loseDialogue": "&" @@ -351,7 +351,7 @@ "suitLevel": "41&100", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "1&4", "winDialogue": "&", "loseDialogue": "&" @@ -368,7 +368,7 @@ "suitLevel": "41&100", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "16&17", "winDialogue": "18&", "loseDialogue": "19&" @@ -385,7 +385,7 @@ "suitLevel": "41&100", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "16&17", "winDialogue": "18&", "loseDialogue": "19&" @@ -402,7 +402,7 @@ "suitLevel": "41&100", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "20&21&22&23&24", "winDialogue": "25&", "loseDialogue": "26&" @@ -419,7 +419,7 @@ "suitLevel": "41&100", "warId": 2001, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "5&6", "winDialogue": "3&", "loseDialogue": "7&" @@ -436,7 +436,7 @@ "suitLevel": "41&100", "warId": 2002, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "27&28&29&30&31", "winDialogue": "32&33", "loseDialogue": "34&" @@ -453,7 +453,7 @@ "suitLevel": "41&100", "warId": 2003, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "8&9&10&11", "winDialogue": "12&13", "loseDialogue": "14&15" @@ -470,7 +470,7 @@ "suitLevel": "61&100", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "1&4", "winDialogue": "&", "loseDialogue": "&" @@ -487,7 +487,7 @@ "suitLevel": "61&100", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "2&3", "winDialogue": "&", "loseDialogue": "&" @@ -504,7 +504,7 @@ "suitLevel": "61&100", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "1&4", "winDialogue": "&", "loseDialogue": "&" @@ -521,7 +521,7 @@ "suitLevel": "61&100", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "16&17", "winDialogue": "18&", "loseDialogue": "19&" @@ -538,7 +538,7 @@ "suitLevel": "61&100", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "16&17", "winDialogue": "18&", "loseDialogue": "19&" @@ -555,7 +555,7 @@ "suitLevel": "61&100", "warId": 0, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "20&21&22&23&24", "winDialogue": "25&", "loseDialogue": "26&" @@ -572,7 +572,7 @@ "suitLevel": "61&100", "warId": 2001, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "5&6", "winDialogue": "3&", "loseDialogue": "7&" @@ -589,7 +589,7 @@ "suitLevel": "61&100", "warId": 2002, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "27&28&29&30&31", "winDialogue": "32&33", "loseDialogue": "34&" @@ -606,7 +606,7 @@ "suitLevel": "61&100", "warId": 2003, "weight": 1, - "movePointArray": "26&27&28&29", + "movePointArray": "44&46&48&50", "startDialogue": "8&9&10&11", "winDialogue": "12&13", "loseDialogue": "14&15"