Skip to content

Commit

Permalink
Update mmrCache from ladder update response
Browse files Browse the repository at this point in the history
  • Loading branch information
Slayer95 committed Dec 6, 2024
1 parent 0a7800a commit 1fb250e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/room-battle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,12 @@ export class RoomBattle extends RoomGame<RoomBattlePlayer> {
this.p1.name, this.p2.name, p1score, this.room
);
void this.logBattle(score, p1rating, p2rating);
if (Config.remoteladder) {
const p1 = Users.getExact(this.p1.name);
const p2 = Users.getExact(this.p2.name);
if (p1) p1.updateRatingCache(this.format, p1rating);
if (p2) p2.updateRatingCache(this.format, p2rating);
}
Chat.runHandlers('onBattleRanked', this, winnerid, [p1rating, p2rating], [this.p1.id, this.p2.id]);
}
async logBattle(
Expand Down

0 comments on commit 1fb250e

Please sign in to comment.