From 49c095979d0978973f6a895ff2241e20b503acf6 Mon Sep 17 00:00:00 2001 From: luying Date: Mon, 26 Dec 2022 11:45:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E6=8E=92=E8=A1=8C=E6=A6=9C)?= =?UTF-8?q?:=20=E7=99=BB=E5=BD=95=E8=B6=85=E6=97=B6=E5=90=8E=E6=8E=92?= =?UTF-8?q?=E8=A1=8C=E6=A6=9C=E4=B8=AD=E4=B8=8D=E5=86=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/rankService.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/game-server/app/services/rankService.ts b/game-server/app/services/rankService.ts index 72bec08a1..bbeda75d0 100644 --- a/game-server/app/services/rankService.ts +++ b/game-server/app/services/rankService.ts @@ -667,6 +667,7 @@ export class Rank { public async getRankListWithMyRank(myId: myIdInter, isReverse = true) { let ranks = await this.getRankByRange('+inf', '-inf', isReverse); + console.log('#### ranks', ranks); let newRanks = [], newMyRank: any; let myRank = ranks.find(cur => { return cur.isMyInfo(myId); @@ -674,7 +675,7 @@ export class Rank { if (this.generFields) { for (let rank of ranks) { let n = await this.generFields(rank); - newRanks.push(n); + if(n) newRanks.push(n); } if (myRank) { newMyRank = await this.generFields(myRank); @@ -737,9 +738,12 @@ export class Rank { let raws = await this.getRankByRangeRaw(max, min, isReverse); let ranks = new Array(); - for (let { rank, field, scores } of raws) { - let param = await this.getParam(rank, field, scores); - if(param) ranks.push(param); + let l = 1; + for (let { field, scores } of raws) { + let param = await this.getParam(l, field, scores); + if(param) { + ranks.push(param); l++; + } } return ranks }