Skip to content

Commit

Permalink
Just add to first bucket, since update(...) has been called.
Browse files Browse the repository at this point in the history
  • Loading branch information
asofold committed Mar 13, 2013
1 parent 414796b commit 1ec7f99
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -14,7 +14,7 @@

public class Logins extends Check implements IRemoveData{

/** Per world count (only used if set in config). */
/** Per world count (if set in the config, only "" is used). */
private final Map<String, ActionFrequency> counts = new HashMap<String, ActionFrequency>();

public Logins() {
Expand All @@ -38,12 +38,12 @@ public boolean check(final Player player, final ChatConfig cc, final ChatData da
final ActionFrequency freq = getActionFrequency(player.getWorld().getName(), 6, durBucket, cc.loginsPerWorldCount);
freq.update(now);
final boolean cancel = freq.score(1f) > cc.loginsLimit; // TODO: >= ... This will be 1 after the first login (!).
if (!cancel) freq.add(now, 1f);
if (!cancel) freq.add(1f);
return cancel;
}

/**
* Called by ChatL1.istener
* Called by ChatListener
*/
public void onReload() {
counts.clear();
Expand Down

0 comments on commit 1ec7f99

Please sign in to comment.