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 }