From d0fb6a1c4e79ca7d07dbff90cd4def392632144f Mon Sep 17 00:00:00 2001 From: Ivo Julca Date: Tue, 21 Oct 2014 20:55:43 -0500 Subject: [PATCH] Fix delay in some tournament messages --- tournaments/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tournaments/index.js b/tournaments/index.js index 1fd2059a63..c0e804a969 100644 --- a/tournaments/index.js +++ b/tournaments/index.js @@ -233,6 +233,7 @@ Tournament = (function () { } else { this.removeUser(user); } + this.room.update(); } }, this); }; @@ -538,6 +539,7 @@ Tournament = (function () { if (Date.now() > time + this.autoDisqualifyTimeout && this.isAutoDisqualifyWarned.get(user)) { this.disqualifyUser(user); + this.room.update(); } else if (Date.now() > time + this.autoDisqualifyTimeout - AUTO_DISQUALIFY_WARNING_TIMEOUT && !this.isAutoDisqualifyWarned.get(user)) { var remainingTime = this.autoDisqualifyTimeout - Date.now() + time; if (remainingTime <= 0) { @@ -646,6 +648,7 @@ Tournament = (function () { this.inProgressMatches.set(challenge.from, {to: user, room: room}); this.room.add('|tournament|battlestart|' + challenge.from.name + '|' + user.name + '|' + room.id); + this.room.update(); this.isBracketInvalidated = true; this.runAutoDisqualify(); @@ -674,14 +677,14 @@ Tournament = (function () { this.runAutoDisqualify(); this.update(); - return; + return this.room.update(); } var error = this.generator.setMatchResult([from, to], result, room.battle.score); if (error) { // Should never happen this.room.add("Unexpected " + error + " from setMatchResult([" + from.userid + ", " + to.userid + "], " + result + ", " + room.battle.score + ") in onBattleWin(" + room.id + ", " + winner.userid + "). Please report this to an admin."); - return; + return this.room.update(); } this.room.add('|tournament|battleend|' + from.name + '|' + to.name + '|' + result + '|' + room.battle.score.join(',')); @@ -699,6 +702,7 @@ Tournament = (function () { this.runAutoDisqualify(); this.update(); } + this.room.update(); }; Tournament.prototype.onTournamentEnd = function () { this.room.add('|tournament|end|' + JSON.stringify({