Fix negative values being accepted in ban commands (solve issue #949) #953
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The changes add a check on all ban commands to see whether the given duration is 0 or more. If the duration given is smaller than zero, it will tell the player and the ban will not proceed.
Motivation and Context
The motivation behind this pull request is that this fixes an open issue. Issue #949. According to the issue, banning with a negative time value is useless and only bans the player for the session. With this pull request banning with a negative value should not be possible anymore
How Has This Been Tested?
The changes have been tested on my own community server on a real player. When entering a negative value, we want the entire command to stop after giving the command issuer a warning. This approach should be valid and should not affect any other areas in the code. Values of 0 or higher have also been tested and these do get accepted by the command.
Screenshots (if appropriate):
Types of changes
Checklist: