mirror of
https://github.com/itHotL/PlayerStats.git
synced 2025-02-28 03:42:53 +01:00
Made it possible to disable stat-request-limiting in the config
This commit is contained in:
parent
fac5ee0a6b
commit
ce6a1d0dab
@ -57,7 +57,7 @@ public class ThreadManager {
|
|||||||
statThreadID += 1;
|
statThreadID += 1;
|
||||||
String cmdSender = request.getCommandSender().getName();
|
String cmdSender = request.getCommandSender().getName();
|
||||||
|
|
||||||
if (statThreads.containsKey(cmdSender)) {
|
if (config.limitStatRequests() && statThreads.containsKey(cmdSender)) {
|
||||||
Thread runningThread = statThreads.get(cmdSender);
|
Thread runningThread = statThreads.get(cmdSender);
|
||||||
if (runningThread.isAlive()) {
|
if (runningThread.isAlive()) {
|
||||||
adventure.sender(request.getCommandSender()).sendMessage(messageWriter.requestAlreadyRunning(request.isBukkitConsoleSender()));
|
adventure.sender(request.getCommandSender()).sendMessage(messageWriter.requestAlreadyRunning(request.isBukkitConsoleSender()));
|
||||||
|
@ -73,6 +73,10 @@ public class ConfigHandler {
|
|||||||
return config.getInt("debug-level", 1);
|
return config.getInt("debug-level", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean limitStatRequests() {
|
||||||
|
return config.getBoolean("only-allow-one-lookup-at-a-time-per-player", true);
|
||||||
|
}
|
||||||
|
|
||||||
/** Returns the config setting for include-whitelist-only.
|
/** Returns the config setting for include-whitelist-only.
|
||||||
<p>Default: false</p>*/
|
<p>Default: false</p>*/
|
||||||
public boolean whitelistOnly() {
|
public boolean whitelistOnly() {
|
||||||
|
@ -14,6 +14,10 @@ config-version: 5
|
|||||||
# 3 = high (log all tasks and time taken)
|
# 3 = high (log all tasks and time taken)
|
||||||
debug-level: 1
|
debug-level: 1
|
||||||
|
|
||||||
|
# Whether players have to wait for their lookup to finish before they can request another statistic
|
||||||
|
# Warning: disabling this could allow players to stress out your server by spamming the stat-command!
|
||||||
|
only-allow-one-lookup-at-a-time-per-player: true
|
||||||
|
|
||||||
# Filtering options to control which players should be included in statistic calculations
|
# Filtering options to control which players should be included in statistic calculations
|
||||||
include-whitelist-only: false
|
include-whitelist-only: false
|
||||||
exclude-banned-players: false
|
exclude-banned-players: false
|
||||||
|
Loading…
Reference in New Issue
Block a user