军团活动:蛮夷入侵主动接口

This commit is contained in:
luying
2021-03-18 16:42:50 +08:00
parent 9bb07f5b21
commit 442a53359e
9 changed files with 257 additions and 38 deletions
+11 -1
View File
@@ -628,8 +628,18 @@ export async function getMyUnionRank(key: string, serverId: number, roleId: stri
return myRank + 1;
}
export async function getRankScore(key: string, serverId: number, field: string) {
/**
* 获取拼接得分的排行榜的某一个人的得分
* @param key REDIS_KEY中配置的
* @param serverId 分服
* @param field 查询的人
*/
export async function getRankScore(key: string, serverId: number, field: string, needDecode = false) {
let score = await redisClient().zscoreAsync(getKeyName(key, serverId), field);
if(!score) score = 0;
if(needDecode) {
score = decodeScoreWithTime(score.toString());
}
return score;
}