Exclude mods from chat throttle, add extra description to options

This commit is contained in:
calzoneman 2013-11-20 10:14:39 -06:00
parent ee9b19b0ff
commit d36dcc5352
2 changed files with 4 additions and 10 deletions

View File

@ -2243,15 +2243,9 @@ Channel.prototype.tryChat = function(user, data) {
msg = msg.substring(0, 240);
}
if (this.opts.chat_antiflood &&
if (user.rank < 2 && this.opts.chat_antiflood &&
user.chatLimiter.throttle(this.opts.chat_antiflood_params)) {
user.socket.emit("chatCooldown", 1000/this.opts.chat_antiflood_params.sustained);
/*
user.socket.emit("noflood", {
action: "chat",
msg: "sending messages too quickly!"
});
*/
return;
}

View File

@ -31,21 +31,21 @@
</div>
<!-- chat flood burst -->
<div class="control-group">
<label class="control-label" for="opt_chat_antiflood_burst"># of messages allowed before throttling</label>
<label class="control-label" for="opt_chat_antiflood_burst" title="The number of messages someone can send with no restriction before the rate limit is applied"># of messages allowed before throttling</label>
<div class="controls">
<input type="text" id="opt_chat_antiflood_burst">
</div>
</div>
<!-- chat flood sustained -->
<div class="control-group">
<label class="control-label" for="opt_chat_antiflood_sustained"># of messages allowed per second (sustained)</label>
<label class="control-label" for="opt_chat_antiflood_sustained" title="The number of messages (after the burst is exceeded) per second a non-moderator can send"># of messages allowed per second (sustained)</label>
<div class="controls">
<input type="text" id="opt_chat_antiflood_sustained">
</div>
</div>
<!-- chat flood cooldown -->
<div class="control-group">
<label class="control-label" for="opt_chat_antiflood_cooldown">Cooldown time after being throttled (seconds)</label>
<label class="control-label" for="opt_chat_antiflood_cooldown" title="The number of seconds since the last message before someone can burst again">Cooldown time after being throttled (seconds)</label>
<div class="controls">
<input type="text" id="opt_chat_antiflood_cooldown">
</div>