Skip to content

Commit 72ed83d

Browse files
committed
Fix
1 parent 8360519 commit 72ed83d

File tree

1 file changed

+33
-30
lines changed

1 file changed

+33
-30
lines changed

src/rest/player.controller.ts

+33-30
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import FinishedMatchEntity from 'gameserver/model/finished-match.entity';
3535
import { makePage } from 'gateway/util/make-page';
3636
import { ProcessRankedMatchHandler } from 'gameserver/command/ProcessRankedMatch/process-ranked-match.handler';
3737
import { AchievementKey } from 'gateway/shared-types/achievemen-key';
38+
import { measure } from 'util/measure';
3839

3940
@Controller("player")
4041
@ApiTags("player")
@@ -172,8 +173,10 @@ offset $2 limit $3`,
172173
};
173174
}
174175

176+
175177
@CacheTTL(120)
176178
@Get("/summary/:version/:id")
179+
@measure("playerSummary")
177180
async playerSummary(
178181
@Param("version") version: Dota2Version,
179182
@Param("id") steam_id: string,
@@ -185,36 +188,36 @@ offset $2 limit $3`,
185188
});
186189

187190
// if it exists in the view, we happy
188-
if (lb) {
189-
return {
190-
rank: lb.rank,
191-
192-
steam_id: lb.steam_id,
193-
mmr: lb.mmr,
194-
195-
games: lb.games,
196-
wins: lb.wins,
197-
198-
kills: lb.kills,
199-
deaths: lb.deaths,
200-
assists: lb.assists,
201-
202-
play_time: lb.play_time,
203-
playedAnyGame: lb.any_games > 0,
204-
205-
hasUnrankedAccess: lb.bot_wins > 0,
206-
207-
newbieUnrankedGamesLeft:
208-
lb.ranked_games > 0
209-
? 0
210-
: Math.max(0, UNRANKED_GAMES_REQUIRED_FOR_RANKED - lb.games),
211-
212-
calibrationGamesLeft: Math.max(
213-
ProcessRankedMatchHandler.TOTAL_CALIBRATION_GAMES - lb.ranked_games,
214-
0,
215-
),
216-
};
217-
}
191+
// if (lb) {
192+
// return {
193+
// rank: lb.rank,
194+
//
195+
// steam_id: lb.steam_id,
196+
// mmr: lb.mmr,
197+
//
198+
// games: lb.games,
199+
// wins: lb.wins,
200+
//
201+
// kills: lb.kills,
202+
// deaths: lb.deaths,
203+
// assists: lb.assists,
204+
//
205+
// play_time: lb.play_time,
206+
// playedAnyGame: lb.any_games > 0,
207+
//
208+
// hasUnrankedAccess: lb.bot_wins > 0,
209+
//
210+
// newbieUnrankedGamesLeft:
211+
// lb.ranked_games > 0
212+
// ? 0
213+
// : Math.max(0, UNRANKED_GAMES_REQUIRED_FOR_RANKED - lb.games),
214+
//
215+
// calibrationGamesLeft: Math.max(
216+
// ProcessRankedMatchHandler.TOTAL_CALIBRATION_GAMES - lb.ranked_games,
217+
// 0,
218+
// ),
219+
// };
220+
// }
218221

219222
const summary: Summary | undefined =
220223
await this.playerService.fullSummary(steam_id);

0 commit comments

Comments
 (0)