pvp:修复赛季相关

This commit is contained in:
luying
2021-11-02 10:16:50 +08:00
parent 15ed1f71fe
commit 4c80a22ccf
15 changed files with 178 additions and 91 deletions
+4 -4
View File
@@ -930,10 +930,10 @@ export async function setRankRedisFromDb(type: string, args?: { serverId?: numbe
await r.setRankWithGuildInfoArrParam(guild.code, [guild.lv, guild.activeWeekly, guild.activeUpdateTime], guild);
}
} else if (type == REDIS_KEY.PVP_RANK) {
let pvpConfig = await PVPConfigModel.findCurPVPConfig();
if(pvpConfig) {
let ranks = await PvpDefenseModel.getRank(pvpConfig.seasonNum);//获得全服前1000名的排名,加入到redis中
let r = new Rank(type, {});
let seasonNum: number = pinus.app.get('pvpSeasonNum');
if(seasonNum > 0) {
let ranks = await PvpDefenseModel.getRank(seasonNum);//获得全服前1000名的排名,加入到redis中
let r = new Rank(type, { seasonNum });
r.setIsInit(true);
for (let { roleId, role: _role, score, updatedAt } of ranks) {
let role = <RoleType>_role;