Added option to set rate limit timeframe
This commit is contained in:
@@ -80,9 +80,11 @@ class PacketWindowItems(plugin: EcoPlugin) : AbstractPacketAdapter(plugin, Packe
|
||||
|
||||
modifyRateValueBy(player, 1)
|
||||
|
||||
scheduledExecutor.schedule({
|
||||
modifyRateValueBy(player, -1)
|
||||
}, 1, TimeUnit.SECONDS)
|
||||
scheduledExecutor.schedule(
|
||||
{ modifyRateValueBy(player, -1) },
|
||||
this.getPlugin().configYml.getInt("async-display.ratelimit.timeframe").toLong(),
|
||||
TimeUnit.SECONDS
|
||||
)
|
||||
}
|
||||
|
||||
private fun usingAsync(player: Player): Boolean {
|
||||
|
||||
@@ -52,9 +52,14 @@ async-display:
|
||||
ratelimit:
|
||||
# If rate limit async display should be used.
|
||||
enabled: true
|
||||
# The amount of window items packets per second needed to enable async display
|
||||
# The amount of window items packets per timeframe needed to enable async display
|
||||
# for a specified player.
|
||||
cutoff: 5
|
||||
# The length of the timeframe in seconds.
|
||||
# Cutoff 5, Timeframe 1 means that if there are more than 5 window items packets
|
||||
# being sent per second for a player, then that player should have their packets
|
||||
# handled asynchronously.
|
||||
timeframe: 1
|
||||
|
||||
mysql:
|
||||
enabled: false # Set to false, data.yml will be used instead.
|
||||
|
||||
Reference in New Issue
Block a user