展示阵容字段修改
This commit is contained in:
@@ -28,6 +28,7 @@ import { PrivateMessageModel } from "../../../db/PrivateMessage";
|
|||||||
import { RoleCeModel } from "../../../db/RoleCe";
|
import { RoleCeModel } from "../../../db/RoleCe";
|
||||||
import { CalCe } from "../../../services/role/calCe";
|
import { CalCe } from "../../../services/role/calCe";
|
||||||
import { getSchoolPoint } from "../../../services/roleService";
|
import { getSchoolPoint } from "../../../services/roleService";
|
||||||
|
import { LadderMatchModel } from "../../../db/LadderMatch";
|
||||||
|
|
||||||
|
|
||||||
export default function (app: Application) {
|
export default function (app: Application) {
|
||||||
@@ -714,14 +715,12 @@ export class FriendHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let seasonNum: number = this.app.get('pvpSeasonNum');
|
let ladder = await LadderMatchModel.findByRoleId(oppoRoleId);
|
||||||
let r = new Rank(REDIS_KEY.PVP_RANK, { seasonNum });
|
|
||||||
let rank = await r.getMyRank({ roleId: oppoRoleId });//去redis中获取排名
|
|
||||||
|
|
||||||
result = new PlayerDetail(oppoRoleId, heroes, rank);
|
result = new PlayerDetail(oppoRoleId, heroes);
|
||||||
result.setPlayer(role);
|
result.setPlayer(role);
|
||||||
result.setCe(topLineupCe);
|
result.setCe(topLineupCe);
|
||||||
result.setWarStar(role.warStar, rank, towerLv - 1);
|
result.setWarStar(role.warStar, ladder?.rank||0, towerLv - 1);
|
||||||
|
|
||||||
return resResult(STATUS.SUCCESS, result);
|
return resResult(STATUS.SUCCESS, result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,8 +65,9 @@ class PlayerDetailBattle {
|
|||||||
main: string[] = [];
|
main: string[] = [];
|
||||||
tower: string[] = [];
|
tower: string[] = [];
|
||||||
pvp: string[] = [];
|
pvp: string[] = [];
|
||||||
|
ladder: string[] = [];
|
||||||
|
|
||||||
constructor(warStar: WarStar[], pvp: number, tower: number) {
|
constructor(warStar: WarStar[], ladder: number, tower: number) {
|
||||||
let main = 0;
|
let main = 0;
|
||||||
for(let { id, warType } of warStar) {
|
for(let { id, warType } of warStar) {
|
||||||
if(warType == WAR_TYPE.NORMAL) {
|
if(warType == WAR_TYPE.NORMAL) {
|
||||||
@@ -77,7 +78,11 @@ class PlayerDetailBattle {
|
|||||||
if(curDicWar) {
|
if(curDicWar) {
|
||||||
this.main.push(`${curDicWar.chapter}`, `${curDicWar.section}`);
|
this.main.push(`${curDicWar.chapter}`, `${curDicWar.section}`);
|
||||||
}
|
}
|
||||||
this.pvp.push(pvp.toString());
|
if(ladder <= 0 || ladder >= 3001) {
|
||||||
|
this.ladder.push('未上榜');
|
||||||
|
} else {
|
||||||
|
this.ladder.push(`第${ladder}名`)
|
||||||
|
}
|
||||||
this.tower.push(tower.toString());
|
this.tower.push(tower.toString());
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -102,7 +107,7 @@ export class PlayerDetail {
|
|||||||
|
|
||||||
battle?: PlayerDetailBattle = new PlayerDetailBattle([], 0, 0);
|
battle?: PlayerDetailBattle = new PlayerDetailBattle([], 0, 0);
|
||||||
|
|
||||||
constructor(roleId: string, heroes: PlayerDetailHero[], rank: number) {
|
constructor(roleId: string, heroes: PlayerDetailHero[], rank?: number) {
|
||||||
this.roleId = roleId;
|
this.roleId = roleId;
|
||||||
this.heroes = heroes;
|
this.heroes = heroes;
|
||||||
this.rank = rank;
|
this.rank = rank;
|
||||||
|
|||||||
Reference in New Issue
Block a user