Users can spam commands to destroy the CPU
Describe the bug
Users can spam commands such as /commands to destroy the CPU.
I believe this issue is solely caused by the 'send user a list of messages' code. See Expected behavior below.
To fix this, I believe the commands should be locked until the previous usage of the command has finished sending the entire list of messages.
To Reproduce
Have a bot rapidly run list-based commands such as /commands, and most likely also /scripts, /help, and so on.
Expected behavior This is where the issue kind-of separates into a feature request. Here's the intended behavior I am thinking of:
- User runs
/commands - Commands start to display to the user
- Two seconds later, whilst the previous command is still being ran, the user runs
/commandsagain - Second command fails as the user is already being displayed the output of
/commandsfrom their first usage.
Stack Trace or logs Well, my logs would be full of someone destroying the server by constantly running such commands.
Server (please complete the following information): Not applicable to the issue.
Client (if relevant) Not applicable to the issue.
Additional context I have temporarily disabled these commands on The Hallway due to their misuse.
This is resolved by my two PRs, #721 and #722