mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-26 18:37:59 +01:00
Just add to first bucket, since update(...) has been called.
This commit is contained in:
parent
414796b938
commit
1ec7f997cf
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user