pvp: 修复重复对手bug

This commit is contained in:
luying
2021-04-09 16:14:05 +08:00
parent 7b8b009d1a
commit f1b5867a5d
5 changed files with 47 additions and 17 deletions
+6 -1
View File
@@ -233,7 +233,12 @@ export async function getRank(key: string, serverId: number, roleId: string, lim
// 获取我的排名
export async function getMyRank(key: string, serverId: number, roleId: string) {
let myRank = await redisClient().zrevrankAsync(getKeyName(key, serverId), roleId);
return myRank + 1;
if(!myRank && myRank != 0) {
return 0
} else {
return myRank + 1;
}
}
// 获取排名第几名的信息