mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-03 19:00:30 +02: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{
|
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>();
|
private final Map<String, ActionFrequency> counts = new HashMap<String, ActionFrequency>();
|
||||||
|
|
||||||
public Logins() {
|
public Logins() {
|
||||||
|
@ -38,12 +38,12 @@ public class Logins extends Check implements IRemoveData{
|
||||||
final ActionFrequency freq = getActionFrequency(player.getWorld().getName(), 6, durBucket, cc.loginsPerWorldCount);
|
final ActionFrequency freq = getActionFrequency(player.getWorld().getName(), 6, durBucket, cc.loginsPerWorldCount);
|
||||||
freq.update(now);
|
freq.update(now);
|
||||||
final boolean cancel = freq.score(1f) > cc.loginsLimit; // TODO: >= ... This will be 1 after the first login (!).
|
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;
|
return cancel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by ChatL1.istener
|
* Called by ChatListener
|
||||||
*/
|
*/
|
||||||
public void onReload() {
|
public void onReload() {
|
||||||
counts.clear();
|
counts.clear();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user