Enhancement: Improve on warn punishments
EvilOlaf opened this issue ยท 11 comments
Actually you can configure individual commands to run when a player exceeds a defined limit of warnings (warningActions
). For example a kick or a temporary ban.
My issue is that the command is run immediately after the player receives his warn.
So he actually has no chance to see for what reason he got warned before get kicked or banned.
So my suggestion is to add a configurable delay (in seconds) before executing the command or commands.
I handled this issue by adding the information why he was warned, placeholder [reason].
The idea is good, but for aesthetic reason I punish the players "for receiving too many warnings".
Why not just add the command /tempban [player] 5d Received too many warnings (Latest: [reason])
Something like this would suffice?
http://dev.bukkit.org/bukkit-plugins/command-delay/
I could add in a delay command of some sorts into BM, but I feel it's out of the scope of the plugin.
Adding a delay option for each individual command in the config would mean no longer being able to use a simple list e.g.
- ban [player] [reason]
- kick [player]
it could be something like
- { cmd: 'ban [player]', delay: '10s' }
- { cmd: 'kick [player]' }
but I'd need to confirm if the bundled YAML version with Bukkit/Spigot supports that syntax.
Your suggested plugin would it make possible to delay the warn
command itself which does not need a delay. Could also be realized by MyCommand for example.
I'd like to delay the commands resulting in exceeding the warn limit.
Basicly what you suggested secondly.
I have a feeling that the disadvantage of the new more difficult configuration outweigh the benefit having delayed action commands. Also the work to implement those...
How about just adding a #pause 5 in the command list, which would simply wait 5 second until executing the next command. Since the whole warning actions thing runs async, you could just use the Thead.sleep to make this conveniently easy.
With the plugin I posted earlier, from what I understand from its description, you should be able to do:
- commandDelay 100 ban [player] [reason]
However I understand not wanting to add another plugin for a relatively small feature.
I'll try and get the other syntax supported in the config.
Commands are run on the main thread, so a sleep wouldn't be appropriate. It also wouldn't be appropriate async as BM makes use of Bukkit's worker threads, meaning it may affect other plugins if I enforce a delay within it. Using the inbuilt bukkit scheduler will work better. The only thing would be if someone were to set a long delay, and restarted the server before the actions were ran, but I think it's an acceptable loss without having to create a fully fledged persisted command scheduler.
Thanks for the clarification, I thought that the command dispatcher code was run on an async thread.