mirror of
https://github.com/smogon/pokemon-showdown-loginserver.git
synced 2026-04-26 01:31:42 -05:00
Include suspect eligibility in ladderget responses
This commit is contained in:
parent
61db6f5308
commit
ffc676bfdc
|
|
@ -446,7 +446,14 @@ export const actions: {[k: string]: QueryHandler} = {
|
|||
const user = Ladder.isValidPlayer(params.user);
|
||||
if (!user) throw new ActionError("Invalid username.");
|
||||
|
||||
return Ladder.getAllRatings(user);
|
||||
const ratings = await Ladder.getAllRatings(user) as (LadderEntry & {suspect?: boolean})[];
|
||||
for (const rating of ratings) {
|
||||
const suspect = await tables.suspects.get(rating.formatid);
|
||||
if (suspect) {
|
||||
rating.suspect = !!rating.first_played && rating.first_played > suspect.start_date;
|
||||
}
|
||||
}
|
||||
return ratings;
|
||||
},
|
||||
|
||||
async mmr(params) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user