名将擂台:刷新对手

This commit is contained in:
luying
2022-07-19 17:14:11 +08:00
parent 4ee1f25876
commit 7394f14e9d
17 changed files with 48281 additions and 72 deletions
+40 -2
View File
@@ -4,7 +4,9 @@ import Hero from '../../db/Hero';
import { LadderMatchType } from "../../db/LadderMatch";
import { LadderMatchRecType } from "../../db/LadderMatchRec";
import { RoleType } from "../../db/Role";
import { EXTERIOR } from "../../pubUtils/dicParam";
import { EXTERIOR, LADDER } from "../../pubUtils/dicParam";
import { DicLadderDifficultRatio } from "../../pubUtils/dictionary/DicLadderDifficultRatio";
import { RoleRankInfo } from "../rank";
// ladderMatch表
export class LadderDefenseHero {
@@ -134,7 +136,7 @@ export class LadderDefenseReturn {
}
export class LadderOppPlayerReturn {
rank: number; // 对手拍名
rank: number; // 对手排名
roleId: string; // 对手玩家id
roleName: string; // 对手玩家名
head: number; // 头像
@@ -144,6 +146,33 @@ export class LadderOppPlayerReturn {
title: number; // 对手爵位
defCe: number; // 对手防守阵容战力
isRobot: boolean; // 是否是机器人
constructor(rank: number, isRobot: boolean) {
this.rank = rank;
this.isRobot = isRobot;
}
setByRedis(param: RoleRankInfo, defCe: number) {
this.roleId = param.roleId;
this.roleName = param.roleName;
this.head = param.head;
this.frame = param.frame;
this.spine = param.spine;
this.lv = param.lv;
this.title = param.title;
this.defCe = defCe;
}
setByRobot(ladderDifficultRatio: DicLadderDifficultRatio) {
this.roleId = `robot${this.rank}`;
this.roleName = LADDER.LADDER_ROBOT_NAME;
this.frame = EXTERIOR.EXTERIOR_FACECASE;
this.head = ladderDifficultRatio.head;
this.spine = ladderDifficultRatio.spine;
this.lv = ladderDifficultRatio.level;
this.title = 1;
this.defCe = ladderDifficultRatio.ce;
}
}
export class LadderDataReturn {
@@ -180,4 +209,13 @@ export class LadderDataReturn {
this.oppPlayers = oppPlayers;
}
}
export class LadderOppPlayerInDB {
@prop({ required: true })
rank: number;
@prop({ required: true })
roleId: string;
@prop({ required: true })
isRobot: boolean;
}
+1
View File
@@ -306,6 +306,7 @@ export class KeyName {
case REDIS_KEY.GATE_ACTIVITY:
case REDIS_KEY.RACE_ACTIVITY:
case REDIS_KEY.TOWER_RANK:
case REDIS_KEY.LADDER:
return `${this.key}:${this.serverId}`;
case REDIS_KEY.HERO_RANK:
return `${this.key}:${this.serverId}:${this.hid}`;