Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Fixed rate-limit setting and autosave on bukkit.
Browse files Browse the repository at this point in the history
Former-commit-id: 0a1a971
  • Loading branch information
xneox committed Dec 2, 2020
1 parent 06bb514 commit 19dcfb0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public ModuleManager(EpicGuard epicGuard) {

public void load() {
Config config = new Config("spigot.yml", "plugins/EpicGuard");
config.setHeader("If you don't know what these settings do, feel free to ask in the discord server.");
config.setHeader("See https://github.com/xxneox/EpicGuard/wiki/Spigot-Configuration");

allowedCommands = config.getOrSetDefault("allowed-commands.list", Arrays.asList("/example", "/example2"));
allowedCommandsBypass = config.getOrSetDefault("allowed-commands.bypass-permission", true);
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/me/xneox/epicguard/core/EpicGuard.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public EpicGuard(PlatformPlugin plugin) {
this.plugin.scheduleTask(new MonitorTask(this), 1L);
this.plugin.scheduleTask(new AttackResetTask(this), 40L);
this.plugin.scheduleTask(new UpdateCheckerTask(this), 1800L);
this.plugin.scheduleTask(new DataSaveTask(this), TimeUnit.SECONDS.toMinutes(this.config.autoSaveInterval));
this.plugin.scheduleTask(new DataSaveTask(this), TimeUnit.MINUTES.toSeconds(this.config.autoSaveInterval));

EpicGuardAPI.setInstance(this);
Logger.log("EpicGuard v5 finished startup successfully.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean handle(@Nonnull BotUser user) {
}

private boolean rateLimitCheck(BotUser user) {
Cooldown cooldown = new Cooldown(user.getAddress(), 10);
Cooldown cooldown = new Cooldown(user.getAddress(), this.getConfig().rateLimit);
if (this.getEpicGuard().getCooldownManager().hasCooldown(user.getAddress())) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,6 @@ public class PluginConfiguration {
@CfgName("custom-proxy-check-url")
public String customProxyCheck = "disabled";

@CfgComment("Limit of requests sent by the proxy/vpn checker.")
@CfgComment("Default (1000) is limit for proxycheck.io with free key.")
@CfgComment("request-limit")
public int requestLimit = 1000;

@CfgComment("If log message contains one of these words, it will")
@CfgComment("be hidden. This can save a lot of CPU on big attacks.")
@CfgCollectionStyle(CollectionStyle.ALWAYS_NEW_LINE)
Expand Down

0 comments on commit 19dcfb0

Please sign in to comment.