mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-29 18:27:36 +02:00
Limit expire timer
This commit is contained in:
@ -47,6 +47,8 @@ import static java.util.stream.Collectors.toSet;
|
||||
*/
|
||||
public class FastLoginCore<P extends C, C, T extends PlatformPlugin<C>> {
|
||||
|
||||
private static final long MAX_EXPIRE_RATE = 1_000_000;
|
||||
|
||||
private final Map<String, String> localeMessages = new ConcurrentHashMap<>();
|
||||
private final ConcurrentMap<String, Object> pendingLogin = CommonUtil.buildCache(5, -1);
|
||||
private final Collection<UUID> pendingConfirms = new HashSet<>();
|
||||
@ -88,8 +90,12 @@ public class FastLoginCore<P extends C, C, T extends PlatformPlugin<C>> {
|
||||
}
|
||||
|
||||
int maxCon = config.getInt("anti-bot.connections", 200);
|
||||
int expireTime = config.getInt("anti-bot.expire", 5);
|
||||
rateLimiter = new RateLimiter(maxCon, expireTime * 60 * 1_000);
|
||||
long expireTime = config.getInt("anti-bot.expire", 5) * 60 * 1_000L;
|
||||
if (expireTime > MAX_EXPIRE_RATE) {
|
||||
expireTime = MAX_EXPIRE_RATE;
|
||||
}
|
||||
|
||||
rateLimiter = new RateLimiter(maxCon, expireTime);
|
||||
Set<Proxy> proxies = config.getStringList("proxies")
|
||||
.stream()
|
||||
.map(HostAndPort::fromString)
|
||||
|
Reference in New Issue
Block a user