feat(排行榜): pvp排行榜添加区服名

This commit is contained in:
luying
2022-11-02 14:53:34 +08:00
parent 28495373fc
commit 76f35af7f8
7 changed files with 33 additions and 12 deletions
@@ -24,6 +24,8 @@ import { getSeconds, nowSeconds } from '../../../pubUtils/timeUtil';
import { PlayerDetail, PlayerDetailHero } from '../../../domain/battleField/guild';
import { PvpSaveDataModel } from '../../../db/PvpSaveData';
import { PVPConfigModel } from '../../../db/PvpConfig';
import { getAllServerName } from '../../../services/redisService';
import { RoleRankInfo } from '../../../domain/rank';
export default function (app: Application) {
new HandlerService(app, {});
@@ -474,7 +476,13 @@ export class PvpHandler {
if(checkPvpSeasonIsWaiting()) { // 休赛期
seasonNum ++;
}
let serverNames = await getAllServerName();
let r = new Rank(REDIS_KEY.PVP_RANK, { seasonNum });
r.setGenerFieldsFun(function (param: RoleRankInfo) {
let { serverId } = param;
return { ...param, serverName: serverNames[serverId]||'无' };
});
let { ranks, myRank } = await r.getRankListWithMyRank({ roleId });
if (!myRank) {