Just add to first bucket, since update(...) has been called.

This commit is contained in:
asofold 2013-03-13 06:20:14 +01:00
parent 414796b938
commit 1ec7f997cf

View File

@ -14,7 +14,7 @@ import fr.neatmonster.nocheatplus.utilities.TickTask;
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() {
@ -38,12 +38,12 @@ public class Logins extends Check implements IRemoveData{
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();