From 4ba3050e955c0cdbe01e350c3b8ff9a246cdcfbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=A4=AA?= Date: Wed, 9 Jul 2014 18:53:24 +1000 Subject: [PATCH] Add messages for tournament autodq --- js/client-chat-tournament.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/js/client-chat-tournament.js b/js/client-chat-tournament.js index 569a84a73..d607c0cce 100644 --- a/js/client-chat-tournament.js +++ b/js/client-chat-tournament.js @@ -283,6 +283,18 @@ this.room.$chat.append("
" + Tools.escapeHTML(data[0]) + " has been disqualified from the tournament
"); break; + case 'autodq': + if (data[0] === 'off') { + this.room.$chat.append("
The tournament's automatic disqualify timeout has been turned off
"); + } else if (data[0] === 'on') { + this.room.$chat.append("
The tournament's automatic disqualify timeout has been set to " + (data[1] / 1000 / 60) + " minutes
"); + } else { + var seconds = Math.floor(data[1] / 1000); + app.addPopupMessage("Please respond to the tournament within " + seconds + " seconds or you may be automatically disqualified"); + this.room.notifyOnce("Tournament Automatic Disqualification Warning", "Room: " + this.room.title + "\nSeconds: " + seconds, 'tournament-autodq-warning'); + } + break; + case 'update': $.extend(this.updates, JSON.parse(data.join('|'))); break; @@ -461,6 +473,10 @@ appendError("There aren't enough users."); break; + case 'InvalidAutoDisqualifyTimeout': + appendError("That isn't a valid timeout value."); + break; + case 'InvalidMatch': appendError("That isn't a valid tournament matchup."); break;